User:Eladkse/global.js

importScriptPage('MediaWiki:Torus.js', 'monchbox');

$(window).load(function { if(wgCanonicalNamespace == 'Special' && wgTitle == 'Torus') {Torus.ui.fullscreen;} });

$(window).load(function { $('.chat-join button').replaceWith('Join the Chat '); });

/* -- Imports -- */ /* AjaxRC */ importScriptPage('MediaWiki:AjaxRC.js', 'casualty');

/* Editor Dropdown */ function EditorDropdown { $('section#EditPage nav.wikia-menu-button ul').prepend(' History '); $('section#EditPage nav.wikia-menu-button ul').append(' Cancel '); } addOnloadHook(EditorDropdown);

/* User Dropdown Items */ function UserItems { $('#AccountNavigation ul.subnav li:first-child').after('My blogMy contributions</li><a href="/wiki/Special:Watchlist">My watchlist</a></li>'); $('.page-User_Eladkse #WikiaUserPagesHeader li[data-id="following"]').replaceWith('<a href="/wiki/Special:Watchlist" title="Special:Watchlist">Watchlist</a></li>'); } addOnloadHook(UserItems);

/* Purge Button */ function PurgeDropdownMenuItem { if( wgNamespaceNumber >= 0 && !window.PurgeButtonsLoaded && document.getElementById('control_purge') == null && wgNamespaceNumber != 500 && wgNamespaceNumber != 502 ) { addOnloadHook( addPurgeButton ); }	var PurgeButtonsLoaded = true; // prevent duplicate running (but not dupe buttons from outside this code)

function addPurgeButton { var theText = 'Purge'; //default text, ala SMW if( typeof PurgeButtonText == "string" ) { theText = PurgeButtonText; }

switch( 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 href="/wiki/'+encodeURIComponent(wgPageName)+'?action=purge">'+ theText + '</a></li>'); break;

case 'oasis': case 'wikia': $(((wgNamespaceNumber == 2 || wgNamespaceNumber == 3) ? '.UserProfileActionButton' : '#WikiaPageHeader') + ' > .wikia-menu-button > ul').append('<a href="/wiki/'+encodeURIComponent(wgPageName)+'?action=purge">'+ theText + '</a></li>'); break;

}	} }

addOnloadHook(PurgeDropdownMenuItem);

/* Recent Changes Links */ function RecentChanges { $('.WikiaActivityModule a.more').replaceWith('<a class="more" title="Special:RecentChanges" href="/wiki/Special:RecentChanges">See more &gt;</a>'); $('a.wikia-button[data-id$="wikiactivity"]').replaceWith('<a data-id="recentchanges" class="wikia-button secondary" accesskey="g" title="Wiki Activity" href="/wiki/Special:RecentChanges"><img height="0" width="0" class="sprite activity" src="http://images1.wikia.nocookie.net/common/skins/common/blank.gif"> Wiki Activity</a>'); $('nav.contribute').after('<a data-id="recentchanges" class="wikia-button secondary" accesskey="g" title="Recent Changes" href="/wiki/Special:RecentChanges"><img height="0" width="0" class="sprite activity" src="http://images1.wikia.nocookie.net/common/skins/common/blank.gif"> Recent Changes</a>'); } addOnloadHook(RecentChanges);