Skip to content

Commit

Permalink
modified hashtag addition to take into account message length
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico Costanza committed Apr 30, 2015
1 parent 072ea0b commit 8bfc3a9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion static/js/sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ var twitterCampaigner = common.campaigner('twitter');
tweetButton.dataset.url = refUrlTwitter;
tweetButton.dataset.counturl = window.location.origin + path;
tweetButton.dataset.text = postTitle;
tweetButton.dataset.hashtags = [twitterCampaigner.hashtags, 'NepalEarthquake', 'PrayforNepal'];
//
if (postTitle.length < 70) {
tweetButton.dataset.hashtags = [twitterCampaigner.hashtags, 'NepalEarthquake', 'PrayforNepal'];
} else if (postTitle.length < 82) {
tweetButton.dataset.hashtags = [twitterCampaigner.hashtags, 'NepalEarthquake'];
} else if (postTitle.length < 95) {
tweetButton.dataset.hashtags = ['NepalEarthquake', ];
} else {
tweetButton.dataset.hashtags = ['Nepal', ];
}


var facebookShareButton = document.getElementById('facebook-share-button');

Expand Down

0 comments on commit 8bfc3a9

Please sign in to comment.