MediaWiki:Gadget-SpecialPages.js/UserCreation.js

// Special:Log //     Special:Log/newusers // //( function ( mw, $ ) { if ( mw.config.get( 'wgPageName' ) === 'Special:Log/newusers' ) {    var arrNewUsers = [];    $( 'li.mw-logline-newusers' ).each( ( row, newUser ) => { var userName = $( newUser ).find( 'bdi' ).text.replace( ' ', '_' ); $( newUser ).attr( 'id', userName ); arrNewUsers.push( userName ); } );   do {      var getUsers = arrNewUsers.slice( 0, 49 );      getUsers = getUsers.join( '|' );      arrNewUsers = arrNewUsers.slice( 50 );      ( new mw.Api ).get( { action: 'query', format: 'json', list: 'users', usprop: 'blockinfo', ususers: getUsers } ).done( function ( usersData ) {//console.log('usersData: %o', usersData.query.users); usersData.query.users.forEach( userData => {         var userNameE = userData.name.replace( ' ', '_' );          if ( userData.blockid ) {            var strReason = ( userData.blockreason || 'None' );            if ( /\[\[(.*?)\]\]/.test( strReason ) ) {              var arrLinks = [ ... strReason.matchAll( /\[\[(.*?)\]\]/ ) ];              arrLinks.forEach( link => { var linkParts = link[ 1 ].split( '|' ); var strPage = linkParts[ 0 ]; var strTitle = ( linkParts[ 1 ] || linkParts[ 0 ] ); strReason = strReason.replace( link[ 0 ], '' + strTitle + '' ); } );           }            $( 'li#' + userNameE + ' a.mw-usertoollinks-block' ).replaceWith( ' (unblock | change block) Blocked by: ' + userData.blockedby + ' (talk | contribs | block) Blocked on: ' + userData.blockedtimestamp + '</a> Expires: ' + userData.blockexpiry + ' Reason: ' + strReason + ' ' );            $( 'span#spammer-link-' + userNameE ).remove;          }        } ); } );   } while ( arrNewUsers.length > 0 );  } //} )( mediaWiki, jQuery ); //