User:Kww/nove.js

mw.loader.using( ['mediawiki.util', 'jquery.client','mediawiki.api'],                function                  {                  if (autoconfirmed === 0)                   {                    mw.user.options.set('visualeditor-enable',0);                    if ( mw.config.get( 'wgUserName' ) != null )                     {                      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                                                                                     }); });                    }                   }                  function autoconfirmed                   {                    var userGroups = mw.config.get( 'wgUserGroups' );                    if ( userGroups )                      {                      for ( var i = 0; i < userGroups.length; i++ )                       {                        if ( userGroups[i] === 'autoconfirmed' )                         {                          return(1);                         }                       }                     }                    return(0);                   }                 }