User:Eladkse/global.js

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

/* Page Tally Module */ function PageTallyModule { if ($('#WikiaPageHeader .tally em').length != 0 && wgMainPageTitle != wgPageName && wgIsArticle == true) { var pagetally = $('#WikiaPageHeader .tally em').text;

$('.WikiaActivityModule').before(' Pages on ' + wgSiteName + '  Add a Page ' + pagetally + ' pages on this wiki '); } } addOnloadHook(PageTallyModule);

/* Recent Changes Links */ function RecentChanges { $('.WikiaActivityModule a.more').replaceWith('See more &gt;'); $('a.wikia-button[data-id$="wikiactivity"]').replaceWith(' Wiki Activity'); $('nav.contribute').after(' Recent Changes'); } addOnloadHook(RecentChanges);

/* 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(''+ theText + ''); 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);

/* User Dropdown Items */ function UserItems { $('#AccountNavigation ul.subnav li:first-child').after('<a href="/wiki/User_blog:Eladkse">My blog</a></li><a href="/wiki/Special:Contributions/Eladkse">My contributions</a></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>'); $('.page-User_talk_Eladkse #WikiaUserPagesHeader li[data-id="following"]').replaceWith('<a href="/wiki/Special:Watchlist" title="Special:Watchlist">Watchlist</a></li>'); $('.page-Special_Contributions_Eladkse #WikiaUserPagesHeader li[data-id="following"]').replaceWith('<a href="/wiki/Special:Watchlist" title="Special:Watchlist">Watchlist</a></li>'); $('.page-User_blog_Eladkse #WikiaUserPagesHeader li[data-id="following"]').replaceWith('<a href="/wiki/Special:Watchlist" title="Special:Watchlist">Watchlist</a></li>'); $('.page-Message_Wall_Eladkse #WikiaUserPagesHeader li[data-id="following"]').replaceWith('<a href="/wiki/Special:Watchlist" title="Special:Watchlist">Watchlist</a></li>'); } addOnloadHook(UserItems);

/* Editor Dropdown */ function EditorDropdown { $('section#EditPage nav.wikia-menu-button ul').prepend('<a id="wpHistory" href="/wiki/'+ encodeURI(wgPageName) +'?action=history"> History </a></li>'); $('section#EditPage nav.wikia-menu-button ul').append('<a id="wpCancel" href="/wiki/'+ encodeURI(wgPageName) +'"> Cancel </a></li>'); } addOnloadHook(EditorDropdown);