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'    ] }); importScriptPage('User:Joritochip/common.js', 'joritochip');

$(function {   if (mw.config.get('skin') !== 'fandomdesktop' || window.ThemeSwitcherLoaded) return;	window.ThemeSwitcherLoaded = true;    var theme = $('body').hasClass('theme-fandomdesktop-light') ? 'light' : 'dark';	var link = $('Toggle theme').click(function { theme = theme === 'light' ? 'dark' : 'light'; $.get(mw.util.wikiScript('wikia')+'?controller=ThemeApi&method=themeVariables&variant='+theme).done(function(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);		}); });	var listItem = $(' ').append(link);   $('#WikiaBar .toolbar .tools').append(listItem); });