User:Pcj/global.js

$(function {	$('#wpAutoApproved').prop('checked',true); });

/* Change RecentChanges layout to not-ugly */ /* Remove if https://phabricator.wikimedia.org/T202916 ever gets fixed */ mw.loader.using("mediawiki.user", function {	if ( mw.user.options.get('usenewrc') !== 0 ) {		mw.loader.load("mediawiki.notify");		( new mw.Api ).postWithToken( 'options', { action: "options", change: "usenewrc=0" } ).done( function { mw.loader.using("mediawiki.notify", function{				mw.notify( "RecentChanges formatting has been reset. You may need to change the URL to remove 'enhanced=1'." );			} );		} );	} } );

importArticles({   type: 'script',    articles: [    	'u:dev:MediaWiki:ThemeToggler.js',        'u:dev:MediaWiki:RemoveLegacyThreads.js'    ] });

mw.loader.using('mediawiki.api').then(function{	if (mw.config.get('wgWikiaEnvironment') !== "sandbox") return;	if (mw.config.get('skin') === "fandomdesktop") return;	if (mw.config.get('wgCanonicalSpecialPageName') === "ThemeDesigner") return;	new mw.Api.saveOption('skin','fandomdesktop').then(function { location.reload; }); });

$(function {	if (mw.config.get('skin') !== 'fandomdesktop') return;	var theme = mw.util.getParamValue('usetheme');	if (['light','dark'].indexOf(theme) === -1) return;	$.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); }); });