User:JPhil2.0/global.js

/* =========================================================================    JS for monobook and oasis applied to all wikia wikis. @author JPhil2.0 ========================================================================== */

window.ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"]; var qtUserPageTemplate = ""; var qtEnableUserPageOverwrite = true; importArticles({   type: "script",    articles: [        "u:dev:WHAM/code.js",        "u:cpw:MediaWiki:Gadget-HotCat.js",        "u:dev:DisplayClock/code.js",        "u:dev:CapsFirst/code.js",        "u:dev:PortableCSSPad/code.js",        "u:dev:HeaderLinks/code.js",        "u:dev:AjaxRC/code.js",        "u:dev:AjaxUndo/code.js",        "u:dev:RevealAnonIP/usercode.js"    ] });

importScriptPage('View_Source/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Monchoman45/ChatPMs.js', 'c');

/* Custom Account Navigation */ $(function { $('Sysops').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('User blog').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Chat').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('Contributions').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('<a href="http://community.wikia.com/wiki/User:JPhil2.0/global.css">Global.css</a></li>').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('<a href="http://community.wikia.com/wiki/User:JPhil2.0/global.js">Global.js</a></li>').insertBefore('.AccountNavigation .subnav li:first'); }); $(function { $('<a href="http://community.wikia.com/wiki/Template:User:JPhil2.0">Global User page</a></li>').insertBefore('.AccountNavigation .subnav li:first'); });

/* Skin Switch Button from Monobook to Oasis */

$( function {	if ( !document.getElementById( 'ca-skins' ) ) {		if ( skin === 'oasis' || skin === 'wikia' ) {			$( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=monobook">MB</a></li>' ).appendTo( '#AccountNavigation' ); $( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">WM</a></li>' ).appendTo( '#AccountNavigation' );		} else {			$( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikia">Oasis</a></li>' ).appendTo( '#p-cactions > .pBody > ul' ); $( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">Mobile</a></li>' ).appendTo( '#p-cactions > .pBody > ul' );		} 	} } );

/* Wiki Activity to Recent Changes */

if (mw.config.get('skin') === 'oasis') { $(function {       $("a[data-canonical='wikiactivity']").attr('href', '/wiki/Special:RecentChanges').text('Recent Changes');        if (mw.config.get('wgCityId') == 177) {            $("a[data-canonical='chat']").click(function (event) { event.preventDefault; });       }    }); }