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

Contenuto cancellato Contenuto aggiunto
m Forse così
m fix
Riga 6:
* Overwrite values in getLocalMessage to localize.
*
* @todo Use durations dropdown, check OOUI is working, set disabled etc. on OOUI elements, handle async loop nicely, fix protect "protections", use azioni-dopo-blocco.js, edit and protect numbers aren't updated.
*/
( function( mw, $ ) {
Riga 356:
maxLength: 255,
id: 'wpMassBlockExpiry'
} );
 
var otherReasonField = new OO.ui.TextInputWidget( {
maxLength: 255,
id: 'wpMassBlockReason'
} ), {;
 
var reasonsDropdown = new OO.ui.DropdownInputWidget( {
options: reasonOpts,
id: 'wpMassBlockReasons'
} ).on( 'change', function() {
var reason = reasonsDropdown.getValue(),
maxlength = ( reason === "other" ? 255 : ( 255 - ': '.length ) - reason.length );
 
documentotherReasonField.getElementById( "wpMassBlockReason" )$element.setAttribute( "maxlength", maxlength );
} );
 
Riga 361 ⟶ 376:
var blockOptsArray = [
new OO.ui.FieldLayout(
reasonsDropddown, {
new OO.ui.DropdownInputWidget( {
options: reasonOpts,
id: 'wpMassBlockReasons'
} )
.on( 'change', function() {
var reason = document.getElementById( "wpMassBlockReasons" ).value,
maxlength = ( reason === "other" ? 255 : ( 255 - ': '.length ) - reason.length );
 
document.getElementById( "wpMassBlockReason" ).setAttribute( "maxlength", maxlength );
} ), {
label: msg[ 'common-reasons' ]
}
Riga 376 ⟶ 382:
 
new OO.ui.FieldLayout(
otherReasonField, {
new OO.ui.TextInputWidget( {
maxLength: 255,
id: 'wpMassBlockReason'
} ), {
label: msg[ 'extra-reason' ]
}
Riga 492 ⟶ 495:
}
};
 
talkProtectCb.on( 'change', toggleProtectionFields );
userProtectCb.on( 'change', toggleProtectionFields );