User:Void/findInactiveSysops.js: Difference between revisions

m
Per removal. Consul action
(Undid revision 24616 by RhinosF1 (talk), please let me know what issues you get instead of (or at least in addition to) reverting code changes; also update ZppixBot to MirahezeBots)
Tag: Undo
m (Per removal. Consul action)
 
(20 intermediate revisions by 3 users not shown)
Line 2:
//<nowiki>
//This script automates the process of finding inactive sysops.
//Warning: the script will replace the contents of the page you are currently viewing when you click the link at the top right of the page.
//Output is in the format of "[[User:Example|Example]] || [[Special:PermanentLink/1234|timestamp]] || [[Special:Log/Example|timestamp]]"
mw.loader.using(['oojs-ui', 'mediawiki.util']).done( function () {
Line 88 ⟶ 87:
 
windowManager.addWindows([ inactiveUsersProc ]);
$('#bodyContentbody').append(windowManager.$element);
windowManager.openWindow(inactiveUsersProc);
 
var checked = 0;
var inactive = [];
var checkList = [];
var total = 0;
 
// Get user list
Line 124 ⟶ 125:
function filterUsers ( userlist ) {
var userstring = userlist.toString();
var exempt = ["John", "Void", "NDKilla", "Reception123", "Revi", "Southparkfan", "Abuse filter", "Void-bot", "VoidwalkerZppix", "PaladoxRhinosF1", "ZppixMediaWiki message delivery", "MirahezeBotsMediaWiki default", "RhinosF1Babel AutoCreate", "MediaWikiDmehus", message"Revibot", delivery"Delete page script", "ZIMove Jonypage script", "BonnedavFlow talk page manager", "BabelUniversal AutoCreateOmega", "HeartsDo", "MacFan4000"];
 
for ( i = 0; i < exempt.length; i++ ) {
Line 130 ⟶ 131:
}
 
var reducedListcheckList = userstring.split( "," );
for ( xtotal = 0; x < reducedListcheckList.length; x++ ) {
checkUser( reducedList[x], reducedListcheckList.lengthpop() );
}
}
 
function checkUser( user, total ) {
$.getJSON(
mw.util.wikiScript( 'api' ),
Line 158:
var activeLogs, activeTribs, active, tribsInfo;
 
if( typeof( logsData[0].timestamp ) != "undefined" ) {
activeLogs = compareDates( logsData[0].timestamp, "logs" );
} else {
Line 176:
 
checked++;
progressBar.setProgress( parseInt(checked (checked/ total) * 100 ) );
 
if( checkedcheckList.length ==> total0 ) {
checkUser( checkList.pop() );
} else {
listInactiveUsers();
}
Line 217 ⟶ 219:
if( dataType === "logs" ) {
date = data.slice( 0, data.indexOf('T') );
date = date.replace( "/-"/g, "" );
} else if( dataType === "tribs" ) {
date = data.slice( data.indexOf('|') + 1, data.indexOf('T') );
date = date.replace( "/-"/g, "" );
}
 
Line 247 ⟶ 249:
}
 
var logsInfo = logsArray[0].timestamp;
if( logsArray[0] !== undefined ) {
logsInfo = logsInfo.slice( 0, logsInfo.indexOf("T") );
logsInfo = "logsArray[[Special:Log/" + userName + "|" + logsInfo + "]0]".timestamp;
logsInfo = logsInfo.slice( 0, logsInfo.indexOf("T") );
logsInfo = "[[Special:Log/" + userName + "|" + logsInfo + "]]";
} else {
logsInfo = 'None';
}
 
textPanel.$element.append( "<li>" + userLink + " || " + tribsInfo + " || " + logsInfo + "</li>" );