Twitter appends the URL automatically
authorAlexander Ebert <ebert@woltlab.com>
Fri, 6 Dec 2013 15:22:57 +0000 (16:22 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 6 Dec 2013 15:22:57 +0000 (16:22 +0100)
wcfsetup/install/files/js/WCF.Message.js

index d1fa1da9496cab3c0e37e1d2f29335b114d0f7a6..05e5f538288933e2f316f62a6898e0dede71a7c5 100644 (file)
@@ -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);
        },
        
        /**