From c84864aeb21596fa7d2d4334b03879e5705354bb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 6 Dec 2013 16:22:57 +0100 Subject: [PATCH] Twitter appends the URL automatically --- wcfsetup/install/files/js/WCF.Message.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index d1fa1da949..05e5f53828 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -2865,37 +2865,38 @@ WCF.Message.Share.Page = Class.extend({ * * @param string objectName * @param string url + * @param boolean appendURL */ - _share: function(objectName, url) { - window.open(url.replace(/{pageURL}/, this._pageURL).replace(/{text}/, this._pageDescription + " " + this._pageURL), 'height=600,width=600'); + _share: function(objectName, url, appendURL) { + window.open(url.replace(/{pageURL}/, this._pageURL).replace(/{text}/, this._pageDescription + (appendURL ? " " + this._pageURL : "")), 'height=600,width=600'); }, /** * Shares current page with Facebook. */ _shareFacebook: function() { - this._share('facebook', 'https://www.facebook.com/sharer.php?u={pageURL}&t={text}'); + this._share('facebook', 'https://www.facebook.com/sharer.php?u={pageURL}&t={text}', true); }, /** * Shares current page with Google Plus. */ _shareGoogle: function() { - this._share('google', 'https://plus.google.com/share?url={pageURL}'); + this._share('google', 'https://plus.google.com/share?url={pageURL}', true); }, /** * Shares current page with Reddit. */ _shareReddit: function() { - this._share('reddit', 'https://ssl.reddit.com/submit?url={pageURL}'); + this._share('reddit', 'https://ssl.reddit.com/submit?url={pageURL}', true); }, /** * Shares current page with Twitter. */ _shareTwitter: function() { - this._share('twitter', 'https://twitter.com/share?url={pageURL}&text={text}'); + this._share('twitter', 'https://twitter.com/share?url={pageURL}&text={text}', false); }, /** -- 2.20.1