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

Contenuto cancellato Contenuto aggiunto
m Ormai di Tim c'era solo il nome...
Disabilita summary se non c'è text
Riga 6:
* Overwrite values in localMsg below to localize.
*
* @todo docs!!, changebetter howi18n, protection level is retrieved?editpage.then(protect), handle failures nicely
* disable summary fields if no text, counters aren't updated.
*/
( function( mw, $ ) {
Riga 311:
var reasons = mw.msg( 'Ipbreason-dropdown' ).split( '\*\*' ),
// OOUI elements
talkTextField, userTextField, talkProtectCb, talkSummaryField,
userSummaryField, userProtectCb, protectReasonField;
 
// Ideally this would use $wgBlockAllowsUTEdit, but it's not available.
Riga 321 ⟶ 322:
var form = new OO.ui.FormLayout( {
id: 'wpMassBlock'
} );
]
talkTextField = new OO.ui.MultilineTextInputWidget( {
rows: 10
} );
]
userTextField = new OO.ui.MultilineTextInputWidget( {
rows: 10
} );
 
Riga 336 ⟶ 345:
),
new OO.ui.FieldLayout(
talkTextField, {
new OO.ui.MultilineTextInputWidget( {
rows: 10
} ), {
label: msg( 'talkmsg' ),
align: 'top',
id: 'wpMassBlockMessage'
}
),
]
} );
 
userTextField =
new OO.ui.MultilineTextInputWidget( {
rows: 10
} );
 
basicFieldset.addItems( [
new OO.ui.FieldLayout( userTextField, {
label: msg( 'upmsg' ),
Riga 358 ⟶ 356:
id: 'wpMassBlockTag'
} )
] } );
 
var reasonOpts = [ {
Riga 472 ⟶ 470:
} );
 
 
talkSummaryField =
var furtherOpts = new OO.ui.FieldsetLayout( {
new OO.ui.TextInputWidget( {
label: msg( 'further-options-label' ),
itemsmaxLength: [255,
id: 'wpMassBlockSummaryTalk',
new OO.ui.FieldLayout(
value: msg( 'summary-default' )
new OO.ui.TextInputWidget( {
});
maxLength: 255,
id: 'wpMassBlockSummaryTalk',
talkTextField.on( 'change', function() {
value: msg( 'summary-default' )
talkSummaryField.setDisabled( talkTextField.getValue().trim() === '');
} ), {
label: msg( 'talksummary' )
}
)
]
} );
 
Riga 494 ⟶ 488:
value: msg( 'summary-default' )
} );
}
userTextField.on( 'change', function () {
userSummaryField.setDisabled( userTextField.getValue().trim() === '');
} ), {;
 
talkProtectCb =
Riga 528 ⟶ 526:
userProtectCb.on( 'change', toggleProtectionFields );
 
var furtherOpts = new OO.addItemsui.FieldsetLayout( [{
label: msg( 'further-options-label' ),
items: [
new OO.ui.FieldLayout( talkSummaryField, {
label: msg( 'talksummary' )
} ), {
new OO.ui.FieldLayout( userSummaryField, {
label: msg( 'upsummary' )
Riga 541 ⟶ 544:
label: msg( 'protect-reason-label' )
} )
] } );
 
expiryField.on( 'change', function() {