this.fluidbook.stats.track(5);
},
sendTwitter: function (url) {
- var tweet = this.fluidbook.datas.twitter_description.replace('%title%', this.getShareTitle(url))
- tweet = tweet.replace('%short%', '');
- tweet = tweet.replace('%url%', '');
+ var tweet = this.fluidbook.datas.twitter_description.replace('%title%', this.getShareTitle(url));
+ var hasUrlInTweet = tweet.indexOf('%url%') >= 0 || tweet.indexOf('%short%') >= 0;
- this.fluidbook.wopen('http://twitter.com/intent/tweet?source=webclient&url=' + encodeURIComponent(this.getShareURL(url)) + '&text=' + encodeURIComponent(tweet), 'share_twitter', 'width=650,height=400');
+ url = this.getShareURL(url);
+ var escaped_url = encodeURIComponent(url);
+ tweet = tweet.replace('%short%', url);
+ tweet = tweet.replace('%url%', url);
+
+ var urlshare = '';
+ if (!hasUrlInTweet) {
+ urlshare = '&url=' + escaped_url;
+ }
+
+ this.fluidbook.wopen('http://twitter.com/intent/tweet?source=webclient' + urlshare + '&text=' + encodeURIComponent(tweet), 'share_twitter', 'width=650,height=400');
this.fluidbook.stats.track(13);
},
sendFacebook: function (url) {