From 1ff55374dbd2b56bc9b4cfceb3a0afb86b676865 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 28 Sep 2015 19:04:44 -0700 Subject: [PATCH] improve facebook sharing copy --- client/main.js | 11 ++++++----- server/views/challengeMap/show.jade | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/main.js b/client/main.js index 5128ddb5e4..47a9905394 100644 --- a/client/main.js +++ b/client/main.js @@ -423,16 +423,17 @@ $(document).ready(function() { e.preventDefault(); var challengeBlockName = $(this).children().attr('id'); var challengeBlockEscapedName = challengeBlockName.replace(/\s/, '%20'); + var username = typeof window.username !== "undefined" ? window.username : ""; var link = 'https://www.facebook.com/dialog/feed?' + 'app_id=1644598365767721' + '&display=page&' + - 'caption=I%20just%20completed%20' + + 'caption=I%20just%20completed%20the%20' + challengeBlockEscapedName + - '%20on%20Free%20Code%20Camp' + - '&link=http%3A%2F%2Ffreecodecamp.com' + - '&redirect_uri=http://freecodecamp.com/map'; - + '%20section%20on%20Free%20Code%20Camp%2E%20Check%20out%20my%20portfolio%20so%20far%2E' + + '&link=http%3A%2F%2Ffreecodecamp%2Ecom%2F' + + username + + '&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap'; setMapShare(challengeBlockName); window.location.href = link; }); diff --git a/server/views/challengeMap/show.jade b/server/views/challengeMap/show.jade index a7408ada09..4ac3064426 100644 --- a/server/views/challengeMap/show.jade +++ b/server/views/challengeMap/show.jade @@ -135,9 +135,10 @@ block content .button-spacer .row .col-xs-12.col-sm-8.col-md-6.col-sm-offset-3.col-md-offset-2 - a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete! Tell your friends. + a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete. Share your Portfolio with your friends. .hidden(id="#{challengeBlock.name}") - + script. + var username = !{JSON.stringify(user && user.username || "")}; // #announcementModal.modal(tabindex='-1') // .modal-dialog.animated.fadeInUp.fast-animation // .modal-content