MediaWiki:Wikia.js

/* --- CASUALTY WIKI OASIS JS */

/* - REMOVABLE FEATURES -- */

/* Disable Image Upload Pop-Ups */ $(document).ready(function {	$('a.wikia-button.upphotos').unbind('click',UploadPhotos.showDialog); });

function PlaceholderLink { $('.wikiaPlaceholder a').attr('href', '/wiki/Special:Upload').unbind('click'); } $(PlaceholderLink);

/* EDITOR DROPDOWN ITEMS  */

function EditorDropdown { $('section#EditPage nav.wikia-menu-button ul').prepend(' History '); $('section#EditPage nav.wikia-menu-button ul').append(' Cancel '); } addOnloadHook(EditorDropdown);

/* --- NAVIGATION LAYOUT FIXES --- */

function PageHead { if (wgCanonicalNamespace != 'Special' && wgCanonicalNamespace != 'Message_Wall' && wgCanonicalNamespace != 'Thread' && wgCanonicalNamespace != 'Message_Wall_Greeting' && wgIsArticle == 'true') { if (! wgCanonicalNamespace) { var talknamespace = 'Talk'; } else { var talknamespace = wgCanonicalNamespace + '_talk'; }		$('.WikiaPageHeader').prepend('  Talk '); $('.commentsbubble').attr("id","commentsbubble"); var csource = document.getElementById('commentsbubble'); if (csource!=null) { var ctarget = document.getElementById('newcomments'); csource = csource.parentNode.removeChild(csource); if (ctarget!=null) { ctarget.parentNode.insertBefore(csource,ctarget); }		}		if (wgIsMainPage == 'true') { $('.WikiaPageHeader .commentslikes').after(' <a href="/wiki/Special:CreatePage" title="Create a new page on this wiki" class="createpage"><img src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" height="0" width="0" class="sprite new"></a><a href="/wiki/Special:CreatePage" title="Special:CreatePage" class="createpage"> Add a Page</a> '); }	} } function PageCounter { if (wgIsMainPage == 'true') { $('.WikiaPageHeader .tally').css({"display": 'block !important'}); } else if (wgCanonicalNamespace != 'Special') { $('.WikiaPageHeader .tally em').attr("id","tally"); var tsource = document.getElementById('tally'); if (tsource!=null) { $('.WikiaActivityModule').before('<section class="WikiaPagesOnWikiModule module"> Pages on ' + wgSiteName + ' <a href="/wiki/Special:CreatePage" title="Create a new page on this wiki" class="wikia-button createpage"><img src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" height="0" width="0" class="sprite new"> Add a Page</a> pages on this wiki  ') var ttarget = document.getElementById('newtally'); tsource = tsource.parentNode.removeChild(tsource); if (ttarget!=null) { ttarget.parentNode.insertBefore(tsource,ttarget); }		}	} } addOnloadHook(PageHead); addOnloadHook(PageCounter);

/* -- MESSAGE WALL TOOLS - */

function WallTools { if (wgCanonicalNamespace == 'Thread') { $('#WallBrickHeader').append('<a href="/wiki/'+ wgPageName +'?action=history" class="wikia-button" style="margin-left:10px; margin-right:10px; float: right;" id="History">View History</a>'); }	if (wgCanonicalNamespace == 'Message_Wall' && wgAction != 'history') { $('.WikiaMainContent').prepend(' <a href="/wiki/'+ wgPageName +'?action=history" class="wikia-button" style="margin-left:10px; margin-right:10px;" id="History">View History</a> '); $('blockquote.wallgreeting').css('margin-top', '0px'); if (wgTitle == wgUserName) { $('.UserProfileActionButton').prepend('<a accesskey="e" href="/wiki/Message_Wall_Greeting:'+ wgUserName +'?action=edit" class="wikia-button" data-id="edit" id="talkArchiveEditButton" style="padding-left: 5px; padding-right: 8px;"><img alt="" class="sprite edit-pencil" height="16" src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" width="22"> Edit Greeting	</a>'); }	} } addOnloadHook(WallTools);