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

Contenuto cancellato Contenuto aggiunto
+Hack per attendere tutte le richieste col when, anziché fermarsi al primo fallimento
m Hmmmmm
Riga 133:
// promises, so that the final $.when will resolve after all promises
// have been processed, and not after the first rejection.
talkDone = $.when(),
userDone = $.when();
 
blocked++;
Riga 189 ⟶ 190:
if ( wpMassBlockProtectUser ) {
return doProtectPage( userPage, 'edit=sysop|move=sysop' )
.done( function( data ) {
console.log( 'p1' );
userpageprotected++;
} )
Riga 201 ⟶ 203:
.fail( function( e ) {
errorHandler( e, user, "edit-user" );
// Return so that this counts as resolved
return $.when();
} );
} else if ( wpMassBlockProtectUser ) {
Riga 213 ⟶ 215:
prType = exists ? 'edit=sysop|move=sysop' : 'create=sysop';
return doProtectPage( userPage, prType )
.done( function( data ) {
console.log( 'p2' );
userpageprotected++;
} )
.fail( function( e ) {
errorHandler( e, user, "protect-user" );
// Return so that this counts as resolved
return $.when();
} );
} )
.fail( function( e ) {
errorHandler( e, user, "query-user" );
// Return so that this counts as resolved
return $.when();
} );
}
Riga 253 ⟶ 256:
}
 
$.when.apply( $, deferreds ).always( function() {console.log('post'deferreds[0].isResolved());console.log(deferreds[1].isResolved());
console.log( 'post' );
doPostBlockActions( errors );
OO.ui.alert(