User:Joritochip/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:DupImageList/code.js',        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:AjaxRC.js',        'u:dev:MediaWiki:SmoothGlobalNav/code.js',        'u:dev:MediaWiki:UTCClock/code.js',        'u:dev:MediaWiki:Wikimarks/code.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:WHAM/code.2.js',    ] });

$(function {   if (mw.config.get('skin') !== 'fandomdesktop') return;    var theme = $('body').hasClass('theme-fandomdesktop-light') ? 'light' : 'dark';    var cssCache = {};    function applyTheme(data, cached) {    	if (!cached) cssCache[theme] = data;        var $s = $('#pcjThemeSwitch')[0] || $(' ').attr('id','pcjThemeSwitch').appendTo('body');        $($s).text(data);        $('body').removeClass('theme-fandomdesktop-light theme-fandomdesktop-dark').addClass('theme-fandomdesktop-'+theme);    }	function switchTheme {		theme = theme === 'light' ? 'dark' : 'light';		if (cssCache[theme]) {			applyTheme(cssCache[theme], true);		} else {			$.get(mw.util.wikiScript('wikia')+'?controller=ThemeApi&method=themeVariables&variant='+theme).done(applyTheme);		}	}    $('.tools').append($(' Toggle theme').click(switchTheme)); });