User:ARandomCitizen/global.js

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

$( function {	var wikiname = mw.config.get('wgDBname');	if (wikiname === 'wikia') {		// stolen from dev:ThemeToggler		$.when( $.get(mw.util.wikiScript( 'wikia' ) + '?controller=ThemeApi&method=themeVariables&variant=dark&cb=' + ( new Date.getTime ) ), $.get( mw.util.wikiScript( 'load' ) + '?modules=ext.fandom.DesignSystem.GlobalNavigation.brand.dark.css%7Cext.fandom.DesignSystem.brand.dark.css&only=styles' ) )		.done( function( wikiTheme, brandTheme ) { var css = wikiTheme[0] + brandTheme[0]; var $s = $( ' ' ).attr( 'id', 'pcjThemeSwitch' ).appendTo('body'); $($s).text(css); $( 'body' ).removeClass( 'theme-fandomdesktop-light' ).addClass( 'theme-fandomdesktop-dark' ); mw.config.set( 'isDarkTheme', !mw.config.get( 'isDarkTheme' ) ); } );	} } );