User:Eladkse/global.js

function BlogDropdownMenuItem { $('#AccountNavigation ul.subnav li:first-child').after('My blog'); }

addOnloadHook(BlogDropdownMenuItem);

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

}	} }

addOnloadHook(PurgeDropdownMenuItem);

/* add a button that increases the content size and hides the rail - 2/1/11 */ function CreateContentResizeButton { var headerWidth = $('header#WikiaPageHeader.WikiaPageHeader details').width; var contentWidth = $('article#WikiaMainContent.WikiaMainContent').width; var catlinksWidth = $('div#catlinks.catlinks').width; if(contentWidth < 1000) { $('section article header h1 + nav.wikia-menu-button').after('Hide Sidebar'); $('section article header h1 + a.wikia-button').after('Hide Sidebar'); $('section article h1 + header.view-source').after('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px; margin-right:10px;" id="resizeButton" title="Expands the content area. Note that this will hide the sidebar.">Hide Sidebar</a>'); $('section article div.UserProfileActionButton nav.wikia-menu-button').before('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px; margin-right:10px;" id="resizeButton" title="Expands the content area. Note that this will hide the sidebar.">Hide Sidebar</a>'); $('section article div.UserProfileActionButton a.wikia-button:last-child').before('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px; margin-right:10px;" id="resizeButton" title="Expands the content area. Note that this will hide the sidebar.">Hide Sidebar</a>'); } } addOnloadHook(CreateContentResizeButton); function ExpandContent(headerWidth, contentWidth, catlinksWidth) { $('header#WikiaPageHeader.WikiaPageHeader details').css({"width": '980px'}); $('article#WikiaMainContent.WikiaMainContent').css({"width": '1000px'}); $('div#catlinks.catlinks').css({"width": '1000px'}); $('div#WikiaRail.WikiaRail').css({"display": 'none'}); $('nav.RelatedPagesModule ul').css({"margin-left": '165px'}); $('a#resizeButton').replaceWith('<a onclick="CompressContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px; margin-right:10px;" id="resizeButton" title="Compress the content area back to its original width, and restore the sidebar.">Show Sidebar</a>'); } function CompressContent(headerWidth, contentWidth, catlinksWidth) { $('header#WikiaPageHeader.WikiaPageHeader details').css({"width": headerWidth}); $('article#WikiaMainContent.WikiaMainContent').css({"width": contentWidth}); $('div#catlinks.catlinks').css({"width": catlinksWidth}); $('div#WikiaRail.WikiaRail').css({"display": 'block'}); $('nav.RelatedPagesModule ul').css({"margin-left": '0px'}); $('a#resizeButton').replaceWith('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px; margin-right:10px;" id="resizeButton" title="Expands the content area. Note that this will hide the sidebar.">Hide Sidebar</a>'); }