User:Servian/wikia.js

/* add a button that increases the content size and hides the rail */ function CreateContentResizeButton { if(wgTitle != wgMainPageTitle) { $('ul.wikia-menu-button').after(' Expand <--> '); } }

addOnloadHook(CreateContentResizeButton);

function ExpandContent { $('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'}); $('ul#resizeButton').replaceWith(' Compress >--< '); }

function CompressContent { $('header#WikiaPageHeader.WikiaPageHeader details').css({"width": '670px'}); $('article#WikiaMainContent.WikiaMainContent').css({"width": '680px'}); $('div#catlinks.catlinks').css({"width": '638px'}); $('div#WikiaRail.WikiaRail').css({"display": 'block'}); $('ul#resizeButton').replaceWith(' Expand <--> '); }

/* Adding the following CSS support is recommended for WikiActivity2RecentChanges... /- Widen area for Random Page and Wiki Activity buttons -/ .WikiHeader .buttons { width: 290px; }

function WikiActivity2RecentChanges { $('a.wikia-button[data-id$="wikiactivity"]').replaceWith('Recent Changes'); } addOnloadHook(WikiActivity2RecentChanges);

/* Add history to the Edit dropdown menu for pages */ function HistoryDropdownMenuItem { $('ul.wikia-menu-button li:first-child ul li:first-child').before('<a href="/index.php?title='+ encodeURIComponent (wgPageName) +'&action=history">History</a></li>'); }

addOnloadHook(HistoryDropdownMenuItem);

/* The above solution works better function History4EditProfile { $('a.wikia-button[data-id$="editprofile"]').before('<a class="wikia-button" href="/wiki/' + wgPageName + '?action=history" accesskey="h" data-id="history">History</a>'); if ( (wgCanonicalNamespace == 'User') || (wgCanonicalNamespace == 'User_talk') ) { $('ul.wikia-menu-button').before('<a class="wikia-button" href="/wiki/' + wgPageName + '?action=history" accesskey="h" data-id="history">History</a>'); } } addOnloadHook(History4EditProfile);

function Return2PatrolledPage { $('p#mw-returnto > a').before('<a href="/wiki/' + wgPageName + '">' + wgTitle + '</a> or '); }

addOnloadHook(Return2PatrolledPage);