FANDOM


if (!$.isArray(window.SocialMediaButtonsNamespaces)) {

   window.SocialMediaButtonsNamespaces = [0, 6, 14, 500];

}

// Check namespace of article, cross-reference with namespaces entered if (SocialMediaButtonsNamespaces.indexOf(mediaWiki.config.get('wgNamespaceNumber')) > -1 && wgAction === 'view') {

   (function ($, mw, Wikia) {
       "use strict";
       //Configuration
       var config = window.SocialMediaButtons = $.extend(true, {
           position: 'top', //Position of the buttons: "top" or "bottom"
           colorScheme: 'dark', //Color scheme of the buttons: "dark", "light" or "color"
           buttonSize: 'default', //Button size: "default" or "#px"
           wikiTwitterAccount: 'default', //Wiki Twitter account: "default" or "accountname"
           userLang: true, //i18n settings: "true"
           // English
           es: {
               google: "Share this on Google+",
               facebook: "Share this on Facebook",
               twitter: "Share this on Twitter",
               vkontakte: "Share this on VKontakte",
               weibo: "Share this on Weibo",
               via: "via",
               twitterAccount: "Wikia",
               twitterMessage: "+from+the+most+knowledgeable+fans+on+the+planet.+"
           }
       }, window.SocialMediaButtons || {});

       // i18n function
       function msg(name) {
           if (config.userLang && mw.config.get('wgUserLanguage') in config && name in config[mw.config.get('wgUserLanguage')]) {
               return config[mw.config.get('wgUserLanguage')][name];
           }
           if (mw.config.get('wgContentLanguage') in config && name in config[mw.config.get('wgContentLanguage')]) {
               return config[mw.config.get('wgContentLanguage')][name];
           }
           return config.en[name];
       }

       // Image colorscheme
       if (config.colorScheme === 'light') {
           var gInactive = 'http://img2.wikia.nocookie.net/__cb20140620025252/gravityfalls/es/images/5/5b/Google-logo.png',
               fbInactive = 'http://img2.wikia.nocookie.net/__cb20140620024914/gravityfalls/es/images/9/9d/Facebook-logo.png',
               twitterInactive = 'http://img4.wikia.nocookie.net/__cb20140620025100/gravityfalls/es/images/6/67/Twitter-logo.png';
       } else if (config.colorScheme === 'color') {
           var gInactive = 'http://img2.wikia.nocookie.net/__cb20140620025252/gravityfalls/es/images/5/5b/Google-logo.png',
               fbInactive = 'http://img2.wikia.nocookie.net/__cb20140620024914/gravityfalls/es/images/9/9d/Facebook-logo.png',
               twitterInactive = 'http://img4.wikia.nocookie.net/__cb20140620025100/gravityfalls/es/images/6/67/Twitter-logo.png';
           
       } else {
           var gInactive = 'http://img2.wikia.nocookie.net/__cb20140620025252/gravityfalls/es/images/5/5b/Google-logo.png',
               fbInactive = 'http://img2.wikia.nocookie.net/__cb20140620024914/gravityfalls/es/images/9/9d/Facebook-logo.png',
               twitterInactive = 'http://img4.wikia.nocookie.net/__cb20140620025100/gravityfalls/es/images/6/67/Twitter-logo.png';
       }
       var gHover = 'http://img2.wikia.nocookie.net/__cb20140620025252/gravityfalls/es/images/5/5b/Google-logo.png',
           fbHover = 'http://img2.wikia.nocookie.net/__cb20140620024914/gravityfalls/es/images/9/9d/Facebook-logo.png',
           twitterHover = 'http://img4.wikia.nocookie.net/__cb20140620025100/gravityfalls/es/images/6/67/Twitter-logo.png';

       // Pre-load the hover images to avoid delay
       var gHoverLoad = new Image(),
           fbHoverLoad = new Image(),
           twitterHoverLoad = new Image();
       gHoverLoad.src = gHover;
       fbHoverLoad.src = fbHover;
       twitterHoverLoad.src = twitterHover;

       

       // Share URL's
       var currentURL = document.URL;
       var currentSiteName = mw.config.get('wgSiteName').replace(/ /g, "+");
       var currentPageName = mw.config.get('wgPageName').replace(/_/g, "+").replace(/"/g, "%22");

       var gShare = 'https://plus.google.com/share?url=' + currentURL;
       var fbShare = 'https://facebook.com/sharer/sharer.php?u=' + currentURL;

       if (config.wikiTwitterAccount !== 'default') {
           var twitterAcc = config.wikiTwitterAccount;
       } else {
           var twitterAcc = msg('twitterAccount');
       }
       var twitterShare = 'https://twitter.com/intent/tweet?original_referer=' + currentURL + '&text=' + currentPageName + msg('twitterMessage') + currentSiteName + '&url=' + currentURL + '&via=' + twitterAcc; + '&via=' + twitterAcc;

       //Border color, positioning and HTML for the various namespaces
       if (mediaWiki.config.get('wgNamespaceNumber') === 500) {
           var borderColor = $('#WikiaUserPagesHeader').css('border-bottom-color');
           var appendTo = '#WikiaUserPagesHeader';
           var topHTML = 'float: right; margin-top: -24px;';
       } else if (mediaWiki.config.get('wgNamespaceNumber') === 1201) {
           var borderColor = $('#mw-content-text .BreadCrumbs').css('border-bottom-color');
           var appendTo = '#mw-content-text .BreadCrumbs';
           var topHTML = 'float:right;';
       } else {
           var borderColor = $('#WikiaPageHeader').css('border-bottom-color');
           var appendTo = '#WikiaPageHeader';
           if (mediaWiki.config.get('wgPageName') === mediaWiki.config.get('wgMainPageTitle').replace(/ /g, '_')) {
               var topHTML = 'padding-top: 4px; position: absolute; top: 29px; right: 0;';
           } else {
               var topHTML = 'position: absolute; top: 29px; right: 0;';
           }
       }

       // Append the buttons
       $(function () {
           if (config.position === 'top') {
               if (config.buttonSize !== 'default') {
                   var buttonSizePX = config.buttonSize;
               } else {
                   var buttonSizePX = "21px";
               }
var socialHTML = '';
               $(appendTo).append(socialHTML);

               if ($('#WikiaPageHeader').length) {
                   var WikiaPageHeaderHeight = $('#WikiaPageHeader').height();
                   if (mediaWiki.config.get('wgPageName') !== mediaWiki.config.get('wgMainPageTitle').replace(/ /g, '_')) {
                       var paddingBottom = parseInt(buttonSizePX.replace('px', )) + 5 + 'px';
                       $('#WikiaPageHeader').css('padding-bottom', paddingBottom);
                   } else if (mediaWiki.config.get('wgPageName') === mediaWiki.config.get('wgMainPageTitle').replace(/ /g, '_')) {
                       var paddingBottom = parseInt(buttonSizePX.replace('px', )) + 8 + 'px';
                       $('#WikiaPageHeader').css('padding-bottom', paddingBottom);
                   }
               }
           } else {
               if (config.buttonSize !== 'default') {
                   var buttonSizePX = config.buttonSize;
               } else {
                   var buttonSizePX = "64px";
               }
var socialHTML = '<section class="SocialMediaButtons" id="SocialMediaButtons" style="border-top: 1px solid ' + borderColor + '; text-align: center; margin-top: 20px;"></section>';
               $('#mw-content-text').append(socialHTML);
           }

if (mw.config.get('wgUserLanguage') === 'ru') {

               if (config.position === 'top') {
                   $('.socialmedia-share').prepend('<a target="_blank" title="' + msg("vkontakte") + '" href="' + vkShare + '"><img style="cursor: pointer;" class="share-button vkontakte ' + config.colorScheme + '" height="' + buttonSizePX + '" width="' + buttonSizePX + '" src="' + vkInactive + '" /></a>');
               } else {
                   $('.socialmedia-share').prepend('<a target="_blank" title="' + msg("vkontakte") + '" href="' + vkShare + '"><img style="cursor: pointer;" class="share-button vkontakte ' + config.colorScheme + '" height="' + buttonSizePX + '" width="' + buttonSizePX + '" src="' + vkInactive + '" /></a>');
                   $('.socialmedia-share .googleplus').css('padding-left', '5px');
               }
           }
           if (mw.config.get('wgContentLanguage') === "zh") {
               if (config.position === 'top') {
                   $('.socialmedia-share').prepend('<a target="_blank" title="' + msg("weibo") + '" href="' + weiboShare + '"><img style="cursor: pointer;" class="share-button weibo ' + config.colorScheme + '" height="' + buttonSizePX + '" width="' + buttonSizePX + '" src="' + weiboInactive + '" /></a>');
               } else {
                   $('.socialmedia-share').prepend('<a target="_blank" title="' + msg("weibo") + '" href="' + weiboShare + '"><img style="cursor: pointer;" class="share-button weibo ' + config.colorScheme + '" height="' + buttonSizePX + '" width="' + buttonSizePX + '" src="' + weiboInactive + '" /></a>');
                   $('.socialmedia-share .googleplus').css('padding-left', '5px');
               }
           }

           // Change the button on hover
           $('.socialmedia-share .googleplus').hover(function () {
               $(this).attr('src', gHover);
           }, function () {
               $(this).attr('src', gInactive);
           });
           $('.socialmedia-share .facebook').hover(function () {
               $(this).attr('src', fbHover);
           }, function () {
               $(this).attr('src', fbInactive);
           });
           $('.socialmedia-share .twitter').hover(function () {
               $(this).attr('src', twitterHover);
           }, function () {
               $(this).attr('src', twitterInactive);
           });
           // Pop-up instead of new window
           function createPopup(url, windowName) {
               var popupWindow = window.open(url, windowName, 'height=500,width=600,menubar=0,toolbar=0,location=1,scrollbars=1,status=1,resizable=1');
               if (window.focus) {
                   popupWindow.focus();
               }
               return false;
           }

           function trackClick(label, event) {
               return Wikia.Tracker.track({
                   action: Wikia.Tracker.ACTIONS.CLICK_LINK_BUTTON,
                   browserEvent: event,
                   category: 'custom-share',
                   label: label,
                   trackingMethod: 'ga'
               });
           }

           $('.socialmedia-share img').on('click', function (event) {
               event.preventDefault();
               var socialNetwork = $(this).attr('class');
               var socialNetworkURL = $(this).parent().attr('href');
               if (socialNetwork.indexOf('googleplus') >= 0) {
                   createPopup(socialNetworkURL, 'googleplusPopup');
                   trackClick('googleplus', event);
               } else if (socialNetwork.indexOf('facebook') >= 0) {
                   createPopup(socialNetworkURL, 'facebookPopup');
                   trackClick('facebook', event);
               } else if (socialNetwork.indexOf('twitter') >= 0) {
                   createPopup(socialNetworkURL, 'twitterPopup');
                   trackClick('twitter', event);
               }
           });
       });
   }(jQuery, mediaWiki, Wikia));

}

¡Interferencia de bloqueo de anuncios detectada!


Wikia es un sitio libre de uso que hace dinero de la publicidad. Contamos con una experiencia modificada para los visitantes que utilizan el bloqueo de anuncios

Wikia no es accesible si se han hecho aún más modificaciones. Si se quita el bloqueador de anuncios personalizado, la página cargará como se esperaba.

También en FANDOM

Wiki al azar