Skip to content

Commit e9ac6a8

Browse files
committed
added twitter specific counturl option which allows the bubble to show count for a different url from the shared url
1 parent 9c64469 commit e9ac6a8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

jquery.sharrre.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
twitter: { //http://twitter.com/about/resources/tweetbutton
6262
url: '', //if you need to personalize url button
6363
urlCount: false, //if you want to use personnalize button url on global counter
64+
counturl: '', //special option for twitter to change which url is shown in its bubble
6465
count: 'horizontal',
6566
hashtags: '',
6667
via: '',
@@ -156,7 +157,7 @@
156157
},
157158
twitter : function(self){
158159
var sett = self.options.buttons.twitter;
159-
$(self.element).find('.buttons').append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-count="'+sett.count+'" data-text="'+self.options.text+'" data-via="'+sett.via+'" data-hashtags="'+sett.hashtags+'" data-related="'+sett.related+'" data-lang="'+sett.lang+'">Tweet</a></div>');
160+
$(self.element).find('.buttons').append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-count="'+sett.count+'" data-text="'+self.options.text+'" data-via="'+sett.via+'" data-hashtags="'+sett.hashtags+'" data-related="'+sett.related+'" data-lang="'+sett.lang+'" data-counturl="'+sett.counturl+'">Tweet</a></div>');
160161
var loading = 0;
161162
if(typeof twttr === 'undefined' && loading == 0){
162163
loading = 1;

0 commit comments

Comments
 (0)