User:Person from Ninjago/global.js

importArticles({   type: 'script',    articles: [	'u:dev:MediaWiki:WDSIcons/code.js'    ] });

$(function {   if (mw.config.get('skin') !== 'fandomdesktop' || window.ThemeTogglerLoaded) return;	window.ThemeTogglerLoaded = true;	mw.hook('dev.wds').add(function(wds) { $('.page-side-tools').append(' '); $('.skin-theme-toggle').append( wds.icon('eye-small') ); function toggleWithoutReload { var theme = $('body').hasClass('theme-fandomdesktop-light') ? 'light' : 'dark'; var newTheme = theme === 'light' ? 'dark' : 'light'; $.get(mw.util.wikiScript('wikia')+'?controller=ThemeApi&method=themeVariables&variant='+newTheme+'&cb='+(new Date.getTime)).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-'+newTheme);			}); }	   var api = new mw.Api; $('.skin-theme-toggle').click( function {			var theme = $('body').hasClass('theme-fandomdesktop-light') ? 'light' : 'dark';			var newTheme = theme === 'light' ? 'dark' : 'light';			toggleWithoutReload;	       api.postWithToken( 'csrf', { action: 'options', optionname: 'theme', optionvalue: newTheme });	    }) $('.skin-theme-toggle-temporal').click( function {			toggleWithoutReload;		}) }) })