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

Contenuto cancellato Contenuto aggiunto
Unbreak protezione (scritto male perché da mobile Ace fa pena)
Tutti gli errori in un oggetto, raggruppati per utente
Riga 10:
* improve error reporting: make each error code a link
* to the page of the corrisponding module on m.o,
* specify which action raised the error, group errors;
* by user, show only the username in the contribs link;
* counters aren't updated.
*/
Riga 81 ⟶ 80:
talkpageprotected = 0,
userpageprotected = 0,
failederrors = [],{};
error = [];
var wpMassBlockAnononly = $( "#wpMassBlockAnononly input" ).prop( 'checked' ),
wpMassBlockNocreate = $( "#wpMassBlockNocreate input" ).prop( 'checked' ),
Riga 98 ⟶ 96:
 
var errorHandler = function( e, user ) {
if (errors[user]){
failed.push( "Special:Contributions/" + user );
error errors[user].push( e );
} else {
errors[user] = [ e ];
}
};
 
Riga 191 ⟶ 194:
 
$.when.apply( $, deferreds ).always( function() {console.log(deferreds);
doPostBlockActions( failed, errorerrors );
OO.ui.alert(
msg( 'result-alert' ).replace( '$1', blocked ).replace( '$2', talkpageedited ).replace( '$3', userpageedited )
Riga 202 ⟶ 205:
* Executed after all users have been processed.
*/
function doPostBlockActions( failed, errorerrors ) {
if ( failederrors.length > 0 ) {
var linkedList = "";
 
for ( xvar =user 0;in x < failed.length; x++errors ) {
var codes = errors[user].map(function (el) {return '<code style="color:red">' + el + '</code>';});
//Links the titles in the "failed" array
linkedList += "<li><a href=\"" + mw.config.get( 'wgScript' ) + "?title=Special:Contributions/" + encodeURIComponent( failed[ x ]user ) + "\">" + failed[ x ]user + "</a>: <code style=\"color:red\">" + error[ x ] + "</code></li>";
codes.join( ", " ) + "</li>";
}
$( "#wpMassBlockFailedContainer" ).html(