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;'); $('nav.contribute').after(' Recent Changes'); } addOnloadHook(RecentChanges);

/* Purge Button */ function PurgeDropdownMenuItem { function addPurgeButton { var theText = 'Purge';

switch( skin ) { case 'uncyclopedia': case 'monobook': $('#p-cactions > .pBody > ul').append(''+ theText + ''); break;

case 'oasis': case 'wikia': $(((wgNamespaceNumber == 2 || wgNamespaceNumber == 3) ? '.UserProfileActionButton' : (wgNamespaceNumber == 500 ? '.WikiaBlogPostHeader' : '#WikiaPageHeader')) + ' > .wikia-menu-button > ul').append(''+ theText + '</li>'); break;

}	}

if( wgNamespaceNumber >= 0 && !window.PurgeButtonsLoaded && document.getElementById('control_purge') == null) { addOnloadHook( addPurgeButton ); }

var PurgeButtonsLoaded = true; // prevent duplicate running (but not dupe buttons from outside this code) } 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>');

var watchlistlink = '<a href="/wiki/Special:Watchlist" title="Special:Watchlist">Watchlist</a></li>';

$('.page-User_Eladkse li[data-id="following"]').replaceWith(watchlistlink); $('.page-User_talk_Eladkse li[data-id="following"]').replaceWith(watchlistlink); $('.page-Special_Contributions_Eladkse li[data-id="following"]').replaceWith(watchlistlink); $('.page-User_blog_Eladkse li[data-id="following"]').replaceWith(watchlistlink); $('.page-Message_Wall_Eladkse li[data-id="following"]').replaceWith(watchlistlink); } addOnloadHook(UserItems);

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

/* Disable Photo Tooltip */ function PhotoTooltip { $('.wikia-button.upphotos').removeAttr("data-original-title"); } addOnloadHook(PhotoTooltip);

function ADHeader { if ($('.AdminDashboardHeader').length) { var title = document.title.split(" -", 1); $('header.AdminDashboardHeader').replaceWith('<header id="WikiaPageHeader" class="WikiaPageHeader HideAdminDashboard"> ' + title + ' Special page '); $('.page-Special_Watchlist .HideAdminDashboard').append(' <a href="/Special:Watchlist" title="Special:Watchlist">View relevant changes</a> | <a href="/Special:Watchlist/edit" title="Special:Watchlist/edit">View and edit watchlist</a> | <a href="/Special:Watchlist/raw" title="Special:Watchlist/raw">Edit raw watchlist</a> '); } } addOnloadHook(ADHeader);