Jump to content

User:Kww/nove.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
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);
                   }
                 }