MediaWiki:Gadget-Massblock.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Refactor da Utente:Daimona_Eaytoy/Massblock2.js: oggetti-classe anziché roba globale, meno promises a giro, fix vari |
+opzione per bloccare la talk anche qui |
||
(5 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 54:
// OOUI element
var submitBtn,
// Ideally this would use $wgBlockAllowsUTEdit, but it's not available in JS.
blockAllowsTalkEdit =
mwapi = new mw.Api();
Riga 108:
this.protectReason = $( "#wpMassBlockProtectReason input" ).val().trim();
this.isInfty = isInfinity(
// Several actions can only be executed if the block is infinite
this.protectTalk = $( "#wpMassBlockProtectTalk input" ).prop( 'checked' ) && this.isInfty;
Riga 127:
return doProtectPage( page, 'edit=sysop|move=sysop' )
.done( function() {
this[counter]++;
} )
.fail( function( e ) {
Riga 141:
return doEditPage( talkPage, FormData.talkMessage, FormData.talkSummary, !FormData.isInfty )
.then(
function() {
this.talkpageedited++;
if ( FormData.protectTalk ) {
return this._protect( talkPage, true,
}
}.bind( this ),
Riga 162:
function( data ) {
var exists = Object.keys( data.query.pages )[ 0 ] !== -1;
return this._protect( talkPage, exists,
}.bind( this ),
function( e ) {
Riga 177:
this.userpageedited++;
if ( FormData.protectUser ) {
return this._protect( userPage, true,
}
}.bind( this ),
Riga 195:
function( data ) {
var exists = Object.keys( data.query.pages )[ 0 ] !== -1;
return this._protect( userPage, exists,
}.bind( this ),
function( e ) {
Riga 309:
*/
function doPostBlockActions() {
var errors = ErrorHandler.errors;
if ( Object.keys( errors ).length > 0 ) {
Line 710 ⟶ 709:
var style ='.massblock-horiz-element{ width: 40%; }';
mw.util.addCSS( style );
mw.loader.using( [
.done( function loadMsg() {
mwapi.loadMessagesIfMissing( [ 'Ipbreason-dropdown' ] )
Line 722 ⟶ 721:
} );
} else {
mw.util.addPortletLink( 'p-tb', mw.
}
} );
|