User:Bourgeoisie/global.js

/* Chat modifications */ $(document).ready(function {   if( wgCanonicalSpecialPageName === "Chat" && mainRoom.isInitialized ) {        $(' | Talk').insertAfter('.ChatWindow .ChatHeader .User .username');    } });

/* Add Editcount tab on all user pages and user talk pages */ $(function {   var wikiUrl = window.location.hostname;    var olds = $(".tabs-container > ul.tabs").html;    var address = "http://" + wikiUrl + "/wiki/Special:Editcount/" + wgTitle;    var adds = "Editcount";    var news = olds + adds;    $(".tabs-container > ul.tabs").html(news); }); /* Add a link to Recent Changes to the Wikia nav */ if (wgUserGroups.indexOf('sysop')==-1||wgUserGroups.indexOf('bureaucrat')==-1) { $('.WikiHeader nav ul li.marked ul').append('Recent Changes'); } /* Add a link to Logs to the Wikia nav */ $(function {       $('.WikiHeader nav ul li.marked ul').append('Log'); }); /* Add contributions link to the user dropdown on the Wikia bar */ $(document).ready(function {   $('My contributions</a>  </li>').insertAfter('.AccountNavigation > li > .subnav > li:first-child'); }); $(document).ready(function {   if (mw.config.get('wgUserGroups') === null)        $('<a href="/wiki/Special:MyContributions">My contributions</a>  </li>').insertBefore('.contribute ul li:first-child'); }); /* Add editcount link to the user dropdown on the Wikia bar */ $(document).ready(function {   $('<a href="/wiki/Special:Editcount/' + wgUserName + '">My editcount</a>  </li>').insertAfter('.AccountNavigation > li > .subnav > li:nth-child(3)'); }); /* Add quicklink to Special:Statistics */ $(document).ready(function {   $(' <a href="/wiki/Special:Statistics">Statistics</a> (<a href="/wiki/Special:WikiStats">Advanced</a>)  </li>').insertAfter('.toolbar > .tools > li:nth-child(3)'); }); /* Wikia API CP on all wikis */ $(document).ready(function {   if (wgDBname !== "api542") {        $('<a href="http://api.wikia.com/wiki/Special:ApiGate">API Control Panel</a>  </li>').insertAfter('.AccountNavigation > li > .subnav > li:nth-child(4)');    } }); /* Purge page */ $(document).ready(function {   var currentPageURL = window.location.href;    $(' <a href="' + currentPageURL + '?action=purge">Purge this page</a></li>').appendTo('.WikiaBarWrapper .toolbar .tools .tools-menu'); });

( function ( $, mw ) {   'use strict';    var nsNr = mw.config.get( 'wgNamespaceNumber' ),        translations = {            en: 'Refresh',            es: 'Actualizar',            de: 'Neu laden',            fr: 'Actualiser',            hu: 'Frissítés',            nl: 'Herladen',            pl: 'Odśwież',            ru: 'Обновить'        },        theText = (typeof window.PurgeButtonText === 'string' && window.PurgeButtonText) ||            translations[mw.config.get('wgContentLanguage')] || translations.en;    if ( nsNr < 0 || window.PurgeButtonsLoaded || document.getElementById( 'control_purge' ) ) {        return;    }    window.PurgeButtonsLoaded = true; // prevent duplicate running (but not dupe buttons from outside this code)    $( addPurgeButton );    function purgePage  {        var page = encodeURIComponent( mw.config.get( 'wgPageName' ) );        $.get( '/index.php?title=' + page + '&action=purge', function  { location.reload( true ); } );       $('html,body').css( { display: 'block', overflow: 'hidden' } );       $( '<div style="background: url(\'/skins/common/images/ajax.gif\') no-repeat fixed center center white;height: 100%;left: 0;opacity: 0.25;position: absolute;top: 0;width: 100%;z-index: 1000000000;"> ' ).appendTo( document.body )        .css( 'height', $( window ).height );    }    function addOasisPurgeButton  {        var selector;        switch (nsNr) {            case 500:            case 502:                selector = $( '#WikiaUserPagesHeader' );                break;            case 2:            case 3:                selector = $( '.UserProfileActionButton' );                if ( selector.length ) break;            default:                selector = $( '#WikiaPageHeader' );        }        selector.find('.wikia-menu-button').first.find('ul')        .append('<a id="purge" href="javascript:void(0)" title="Purge page">'+ theText + '</a></li>');    }    function addPurgeButton  { switch( mw.config.get( 'skin' ) ) { case 'uncyclopedia': /* monobook clone, pass to monobook */ case 'wowwiki': /* monobook clone, pass to monobook */ case 'lostbook': /* monobook clone, pass to monobook */ case 'monobook': $('#p-cactions > .pBody > ul').append('<a id="purge" href="javascript:void(0)" title="Purge page">'+ theText + '</a></li>'); break; case 'oasis': case 'wikia': addOasisPurgeButton; break; }       $( '#purge' ).click( purgePage ); }   } ( jQuery, mediaWiki ) );

/* Search wiki on WAM feature */ $(document).ready(function {   var wikiWAMsearch = window.location.hostname;    $(' <a href="http://www.wikia.com/WAM?verticalId=&date=&langCode=&searchPhrase=' + wikiWAMsearch + '" target="_blank">Search this wiki on WAM</a></li>').appendTo('.WikiaBarWrapper .toolbar .tools .tools-menu'); }); /* Search Google */ $(document).ready(function {   $(' <a href="http://www.google.com/search?q=' + wgPageName + '" target="_blank">Search this title on Google</a></li>').appendTo('.WikiaBarWrapper .toolbar .tools .tools-menu'); }); /* Admin CP link in Wikia Bar */ if (wgUserGroups.indexOf('sysop')!=-1||wgUserGroups.indexOf('bureaucrat')!=-1) { $('.WikiHeader nav ul li.marked ul').append('<a class="subnav-2a" href="/wiki/Special:AdminDashboard">Admin CP</a></li>'); } /* QQX */ $(document).ready(function {   var qqxPageURL = window.location.href;    $(' <a href="' + qqxPageURL + '?uselang=qqx">View QQX</a>  </li>').insertAfter('.toolbar > .tools > li:nth-child(5)'); }); /* Quicklink to Special:Contact */ $(document).ready(function {   $(' <a href="/wiki/Special:Contact/general">Contact Wikia</a> (<a href="mailto:support@wikia.com">Email</a>)  </li>').insertAfter('.toolbar > .tools > li:nth-child(6)'); });

/* Remove "Wiki Activity" from the contribute button since it's redundant to have it there and in the Wikia Bar */ $(document).ready(function {   $('.contribute .WikiaMenuElement li a[data-id="wikiactivity"]').remove;    $('.contribute .WikiaMenuElement li:empty').remove; }); /* View history link in edit window */ $(document).ready(function {   if ( wgNamespaceNumber == "0" ) {         $('<span class="cke_toolbar_expand" style="padding-left: 10px; border-left: 1px solid #ccc;"><a class="expand" href="/wiki/' + wgTitle + '?action=history" target="_blank" style="display: inline;"> view history ⌚ </a> ').insertAfter('.cke_toolbar_expand:first-of-type');    } else {        $('<span class="cke_toolbar_expand" style="padding-left: 10px; border-left: 1px solid #ccc;"><a class="expand" href="/wiki/' + wgCanonicalNamespace + ':' + wgTitle + '?action=history" target="_blank" style="display: inline;"> view history ⌚ </a> ').insertAfter('.cke_toolbar_expand:first-of-type');    } });

/* Skin Mods */ $('.WikiaBarWrapper .tools').append(' » ▲ ● ► ▼ <style type="text/css">#MagicSpells{font-family:Helvetica;padding:2px 5px !important}#trigger{font-size:16px;display:inline-block;margin-top:-1px;cursor:default;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}.spell{display:inline-block;margin:0 3px;vertical-align:top;cursor:pointer;transition:transform .5s,text-shadow .5s;-moz-transition:-moz-transform .5s,text-shadow .5s;-webkit-transition:-webkit-transform .5s,text-shadow .5s;-o-transition:-o-transform .5s,text-shadow .5s}.spell:hover{text-shadow:0 0 4px #305599} </li>'); $('#MagicSpells').mouseenter(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'}); } ); $('#MagicSpells').mouseleave(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'}); } ); $('.scroll-top').click(function {	$('html, body').animate({scrollTop:0}, 'slow'); } ); $('#toggle-ads').toggle(function {	$('#toggle-ads').attr('title','Show ads');	$('.wikia-ad, .SelfServeUrl').hide('slow'); },	function {		$('#toggle-ads').attr('title','Hide ads');		$('.wikia-ad, .SelfServeUrl').show('slow');	} ); $('#hide-rail').toggle(function {	$('#hide-rail').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'});	$('#hide-rail').attr('title', 'Show rail');	$('.WikiaRail').hide('slow');	$('.WikiaMainContent').animate({width:'1010'}, 'slow'); },	function {		$('#hide-rail').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'});		$('#hide-rail').attr('title', 'Hide rail');		$('.WikiaRail').show('slow');		$('.WikiaMainContent').animate({width:'670'}, 'slow');	} ); $('.scroll-bottom').click(function {	$('html, body').animate({scrollTop: $(document).height}, 'slow'); } );