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 ul.wikia-menu-button').after('Hide Sidebar'); $('section article header a.wikia-button').after('Hide Sidebar'); $('section article header a.view-source').after('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px; margin-right:10px" data-id="resizeButton" title="Expands the content area. Note that this will hide the sidebar.">Hide Sidebar</a>'); if(wgCanonicalNamespace == 'User_blog') { $('section article div#WikiaUserPagesHeader a.wikia-button').after('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px;" data-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'}); $('ul#resizeButton').replaceWith('<a onclick="CompressContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px;" data-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'}); $('ul#resizeButton').replaceWith('<a onclick="ExpandContent(' + headerWidth + ', ' + contentWidth + ', ' + catlinksWidth + ');" class="wikia-button" style="margin-left:10px;" data-id="resizeButton" title="Expands the content area. Note that this will hide the sidebar.">Hide Sidebar</a>'); }