User:Agent Spy/mywiki.js

// BotoneraPopups importScriptURI('http://dev.wikia.com/wiki/BotoneraPopups/Code/en.js?action=raw&ctype=text/javascript&templates=expand'); importStylesheetPage('BotoneraPopups/code.css', 'dev'); // Create if not exists if (!window.BotoneraPopups) { window.BotoneraPopups = {}; } // Open popup on keypress if (BotoneraPopups.setDisplayOnKeyDown) { BotoneraPopups.setDisplayOnKeyDown(true); } else { BotoneraPopups.displayOnKeyDown = true; } // EditIntroButton // WhatLinksHere var nsNr = mw.config.get( 'wgNamespaceNumber' ); function addMenuButtons { 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('Current diffLinksEdit intro'); } addMenuButtons; // Logs if ( wgPageName == "Special:WikiActivity" || wgPageName == "Special:WikiActivity/watchlist" || wgPageName == "Special:WikiActivity/activity" ) { appTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader .activity-nav ul' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstheading' ) ); appTo.append( 'Logs' ); } else if ( wgPageName == "Special:Log" || wgPageName == "Special:RecentChanges" ) { appTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader > h2' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstheading' ) ); appTo.append( '<a href="/wiki/Special:WikiActivity">Activity</a></li>' ); } // Add back WikiActivity $( '#WikiHeader > nav .subnav-2.firstChild' ).prepend( '<a class="subnav-2a" href="/wiki/Special:WikiActivity">Wiki Activity</a></li>' ); // RevealAnonIP */ // http://dev.wikia.com/wiki/RevealAnonIP window.RevealAnonIP = { permissions : ['*'] }; importArticles({   type: "script",    articles: [        'u:dev:RevealAnonIP/code.js',    ] }); switch (wgPageName) { case 'Special:B3': case 'Special:Chatbot': case 'Special:Tasks': case 'Special:Maintenance': case 'Special:CVN': importScriptPage('MediaWiki:B3.js', 'monchbox'); };

// 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');    } });

// 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 = "<a href='" + address + "'>Editcount</a></li>";    var news = olds + adds;    $(".tabs-container > ul.tabs").html(news); }); // Add sandbox link to the user dropdown on the Wikia bar $(document).ready(function {   $('<a href="/wiki/User:Agent Spy/Sandbox">Sandbox</a>  </li>').insertAfter('.AccountNavigation > li > .subnav > 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>').appendTo('.WikiaBarWrapper .toolbar .tools .tools-menu'); }); // 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'); }); // 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>'); }

// 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>').appendTo('.WikiaBarWrapper .toolbar .tools .tools-menu'); }); // Add link to my test wiki $(document).ready(function {   if (wgDBname !== "trcsandbox") {        $('<a href="http://trcsandbox.wikia.com">Test Wiki</a>  </li>').insertAfter('.AccountNavigation > li > .subnav > li:nth-child(5)');    } });