User:Legoktm/bleh.js

mw.loader.using( ['mediawiki.api', 'mediawiki.user'],	function {		function isAutoconfirmed {			return mw.config.get('wgUserGroups').indexOf('autoconfirmed') > -1;		}		if ( !isAutoconfirmed ) {			// If the user is not autoconfirmed, disable it			mw.user.options.set('visualeditor-enable', 0);			// If the user is logged in, lets also save this preference			if ( mw.config.get( 'wgUserName' ) != null && mw.user.options.get('visualeditor-betatempdisable') !== 1 ) {				var api = new mw.Api;				api.get({ action: 'tokens', type: 'options' }).done(function (json) { api.post({							action: 'options',							change: 'visualeditor-betatempdisable=1',							token: json.tokens.optionstoken						}); });			}

}	} );