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

Contenuto cancellato Contenuto aggiunto
Provo con risoluzione manuale
Ci siamo quasi
Riga 6:
* Overwrite values in localMsg below to localize.
*
* @todo docs!!, better i18n, protection counters aren't updated
*/
( function( mw, $ ) {
Riga 129:
userPage = 'User:' + user,
// @var {Promise} These track the state for all actions (edit and protect)
// on every page. IfThey everythingare succeeds,resolved theas promisesoon isas thea resultpage ofis processed, takenwith actions.or
// promises,without soa thatfailure. This way the final $.when will resolve after all promises
// Otherwise (i.e. if there's nothing to do or something failed) these are resolved
// promises, so that the final $.when will resolve after all promises
// have been processed, and not after the first rejection.
talkDone = $.Deferred(),
Riga 152 ⟶ 151:
.always( function() {
talkDone.resolve();
} );
} else {
talkDone.resolve();
Riga 176 ⟶ 175:
errorHandler( e, user, "protect-talk" );
} )
.always( function() {
talkDone.resolve();
} );
Riga 195 ⟶ 194:
doProtectPage( userPage, 'edit=sysop|move=sysop' )
.done( function( data ) {
console.log( 'p1' );
userpageprotected++;
} )
Riga 201 ⟶ 199:
errorHandler( e, user, "protect-user" );
} )
.always( function() {
userDone.resolve();
} );
Riga 222 ⟶ 220:
doProtectPage( userPage, prType )
.done( function( data ) {
console.log( 'p2' );
userpageprotected++;
} )
Riga 240 ⟶ 237:
}
 
$.when( talkDone, userDone ).always( function() {console.log(talkDone.state());console.log(userDone.state());} );
return $.when( talkDone, userDone );
};
Riga 265 ⟶ 261:
}
 
$.when.apply( $, deferreds ).always( function() {console.log(deferreds);console.log(deferreds[0].state());
console.log( 'post' );
doPostBlockActions( errors );
OO.ui.alert(