Utente:Daimona Eaytoy/Massblock.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m tweak expiry
m Beautify, -controllo non necessario
Riga 44:
 
for ( i = 0; i < users.length; i++ ) {
var user = users[ i ].trim();
var api = new mw.Api();
if ( user.length > 0 ) {
api.postWithToken( "csrf", {
var api = new mw.Api();
action: 'block',
api.postWithToken( "csrf", {
allowusertalk: wpMassBlockTalkpage,
action: 'block',
autoblock: wpMassBlockAutoblock,
allowusertalk: wpMassBlockTalkpage,
nocreate: wpMassBlockNocreate,
autoblock: wpMassBlockAutoblock,
expiry: wpMassBlockExpiry === "" ? "indefinite" : wpMassBlockExpiry,
nocreate: wpMassBlockNocreate,
anononly: wpMassBlockAnononly,
expiry: wpMassBlockExpiry === "" ? "indefinite" : wpMassBlockExpiry,
noemail: wpMassBlockEmail,
anononly: wpMassBlockAnononly,
noemailreblock: wpMassBlockEmailwpMassBlockReblock,
reason: wpMassBlockReasons === "other" ? wpMassBlockReason : wpMassBlockReasons + ( wpMassBlockReason ? ": " + wpMassBlockReason : "" ),
reblock: wpMassBlockReblock,
user: user
reason: wpMassBlockReasons === "other" ? wpMassBlockReason : wpMassBlockReasons + ( wpMassBlockReason ? ": " + wpMassBlockReason : "" ),
user:} user)
} ).then(
.thenfunction( data ) {
functionconsole.log( data ) {;
var isInfty = isInfinity( wpMassBlockExpiry );
console.log(data);
blocked++;
var isInfty = isInfinity( wpMassBlockExpiry );
if ( wpMassBlockTagwpMassBlockMessage !== "" ) {
blocked++;
if doEditPage( 'User talk:' + user, wpMassBlockMessage, !==wpMassBlockSummaryTalk, ""isInfty ) {
.done( function( data ) {
doEditPage( 'User talk:' + user, wpMassBlockMessage, wpMassBlockSummaryTalk, isInfty )
.done( function( data ) {talkpageedited++;
talkpageedited++;} )
}.fail( function( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
.fail( function( e ) {
failed.push( 'User talk:' + user );
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failederror.push( 'User talk:' + usere );
error.push( e} );
} );
}if ( !isInfty ) {
// No pages should be protected, and the UP should be left as is
if ( !isInfty ) {
} )return;
// No pages should be protected, and the UP should be left as is
return;}
}
 
if ( wpMassBlockProtectTalk ) {
doProtectPage( 'User talk:' + user )
.done( function( data ) {
talkpageprotected++;
} )
.fail( function( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( 'User talk:' + user );
error.push( e );
} );
}
if ( wpMassBlockTag !== "" ) {
doEditPage( 'User:' + user, wpMassBlockTag, wpMassBlockSummaryUser )
.done( function( data ) {
userpageedited++;
} )
.fail( function( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( 'User:' + user );
error.push( e );
} );
}
if ( wpMassBlockProtectUserPage ) {
doProtectPage( 'User:' + user )
.done( function( data ) {
userpageprotected++;
} )
.fail( function( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( 'User:' + user );
error.push( e );
} );
}
},
function( e ) {console.log(e);
// If not blocked, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( "Special:Block/" + user );
error.push( e );
}
if ( wpMassBlockTag !== "" ) {
);
doEditPage( 'User:' + user, wpMassBlockTag, wpMassBlockSummaryUser )
}
.done( function( data ) {
userpageedited++;
} )
.fail( function( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( 'User:' + user );
error.push( e );
} );
}
if ( wpMassBlockProtectUserPage ) {
doProtectPage( 'User:' + user )
.faildone( function( edata ) {
userpageprotected++;
} )
.fail( function( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( 'User:' + user );
error.push( e );
} );
}
},
function( e ) {console.log(e);
console.log(data e );
// If not blocked, add the title to the "failed" array and a description of the error to the "error" array.
failed.push( "Special:Block/" + user );
error.push( e );
}
);
 
}
 
Riga 256:
msg[ 'upmsg' ] + '<br />' +
'<textarea tabindex="3" accesskey="," name="wpMassBlockTag" id="wpMassBlockTag" rows="10" cols="80"></textarea>' +
'<br /><br /><fieldset><legend>' + msg[ 'block-options-label' ] + '</legend>' +
'<table style="background-color:transparent">' +
'<tr><td>' + msg[ 'common-reasons' ] + '</td>' +
Riga 282:
'<tr><td>' + msg[ 'override' ] + '</td><td><input type="checkbox" id="wpMassBlockReblock" name="wpMassBlockReblock" checked="checked" /></td></tr>' +
'</table></fieldset>' +
'<fieldset><legend>' + msg[ 'further-options-label' ] + '</legend>' +
'<table style="background-color:transparent">' +
'<tr><td>' + msg[ 'talksummary' ] + '</td>' +
'<td><input type="text" id="wpMassBlockSummaryTalk" name="wpMassBlockSummaryTalk" maxlength="255" value="' +
msg[ 'summary-default' ] + '"/></td></tr>' +
'<tr><td>' + msg[ 'talkprotect' ] + '</td>' +
'<td><input type="checkbox" id="wpMassBlockProtectTalk" name="wpMassBlockProtectTalk" /></td></tr>' +
'<tr><td>' + msg[ 'upsummary' ] + '</td>' +
'<td><input type="text" id="wpMassBlockSummaryUser" name="wpMassBlockSummaryUser" maxlength="255" value="' +
msg[ 'summary-default' ] + '"/></td></tr>' +
'<tr><td>' + msg[ 'upprotect' ] + '</td>' +
'<td><input type="checkbox" id="wpMassBlockProtectUser" name="wpMassBlockProtectUser" /></td></tr>';