if (this.fluidbook.datas.twitter) {
shareLinks['twitter'] = 'Twitter';
}
+ if (this.fluidbook.datas.whatsapp) {
+ shareLinks['whatsapp'] = 'WhatsApp';
+ }
if (this.fluidbook.datas.googleplus) {
shareLinks['googleplus'] = 'Google Plus';
}
window.location = mailto;
this.fluidbook.stats.track(5);
},
- sendTwitter: function (url, context) {
+
+ _getShortShare: function (url, context) {
var tweet = this.getTweetContent(url, context);
var hasUrlInTweet = tweet.indexOf('%url%') >= 0 || tweet.indexOf('%short%') >= 0;
if (!hasUrlInTweet) {
urlshare = '&url=' + escaped_url;
}
+ return {url: urlshare, content: tweet};
+ },
- this.fluidbook.wopen('http://twitter.com/intent/tweet?source=webclient' + urlshare + '&text=' + encodeURIComponent(tweet), 'share_twitter', 'width=650,height=400');
+ sendTwitter: function (url, context) {
+ var data = this._getShortShare(url, context);
+
+ this.fluidbook.wopen('https://twitter.com/intent/tweet?source=webclient' + data.url + '&text=' + encodeURIComponent(data.content), 'share_twitter', 'width=650,height=400');
this.fluidbook.stats.track(13);
},
+ sendWhatsapp: function (url, context) {
+ var data = this._getShortShare(url, context);
+ this.fluidbook.wopen('https://api.whatsapp.com/send?text=' + encodeURIComponent(data.content), 'share_whatsapp', 'width=600,height=600');
+ this.fluidbook.stats.track(12);
+ },
sendFacebook: function (url, context) {
this.fluidbook.wopen('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(this.getShareURL(url)), 'share_facebook', 'width=650,height=400');
this.fluidbook.stats.track(12);