User:Fandyllic/wikia.js

/* Add "View History" button for Message Wall and threads */ function WallHistory { if (wgCanonicalNamespace == 'Thread') { $('#WallBrickHeader').append('View History'); }	if (wgCanonicalNamespace == 'Message_Wall' && wgAction != 'history') { $('.WikiaMainContent').prepend(' View History '); } } addOnloadHook(WallHistory);

/* Add "Greeting" button to see Message Wall Greeting */ function WallGreetingButton { if (wgCanonicalNamespace == 'Message_Wall' && wgAction != 'history' && wgTitle == wgUserName) { $('.WikiaMainContent').prepend(' Greeting '); } } addOnloadHook(WallGreetingButton);

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

/* Add a history link to most diffs */ function HistoryOnDiff { /* Does not work for "User:" or "User talk:" */ if (wgCanonicalNamespace == "") { $('p > a[accesskey="c"]').after(' &#124; History of this page (' + wgTitle + ')'); } else { $('p > a[accesskey="c"]').after(' &#124; History of this page (' + wgCanonicalNamespace + ':' + wgTitle + ')'); } }

addOnloadHook(HistoryOnDiff);

/* Add History and What Links Here links to 3rd wiki menu after 1st item */ /* function ToolsMenuItems { $('section header nav ul li:nth-last-child(2) ul li:first-child').after('History</li><li>What Links here</a></li>'); } addOnloadHook(ToolsMenuItems);

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

/* Add history to the Edit dropdown menu for User pages */ /* Wikia made this the default functionality and now also for User pages function UserHistoryDropdownMenuItem { if ( (wgCanonicalNamespace == 'User') || (wgCanonicalNamespace == 'User_talk') ) { $('ul.wikia-menu-button li:first-child ul li:first-child').after('<li>History</a></li>'); } }

addOnloadHook(UserHistoryDropdownMenuItem);

/* Works, but disable for now. */ /* function Talk4Forum { if (wgCanonicalNamespace == 'Forum') { $('ul.wikia-menu-button').after('Forum talk</a>'); } } addOnloadHook(Talk4Forum);