Utente:Daimona Eaytoy/Massblock.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m beautify, in js il foreach usa le key |
append |
||
Riga 58:
.then(
function( data ) {
var isInfty = /^(indefinite|indefinito|infinito|)$/i.test( wpMassBlockExpiry );
blocked++;
if ( wpMassBlockMessage !== "" ) {
doEditPage( 'User talk:' + user, wpMassBlockMessage, wpMassBlockSummaryTalk, isInfty )
.done( function( data ) {
talkpageedited++;
Riga 70 ⟶ 71:
} );
}
if ( !isInfty ) {
// No pages should be protected, and the UP should be left as is
return;
}
if ( wpMassBlockProtectTalk ) {
doProtectPage( 'User talk:' + user )
Riga 129 ⟶ 135:
}
function doEditPage( title, text, summary, append ) {
var appendText = append || false;
return mw.Api().postWithEditToken( {▼
var params = {
action: 'edit',
title: title,
text: text,▼
summary: summary,
watchlist: 'nochange'
}
if ( appendText ) {
params.appendtext = text;
} else {
}
}
Riga 157 ⟶ 169:
'blockusers': 'Users to block (one on each line, please):',
'talkmsg': 'Replace talk page with (leave blank to leave no message):',
'upmsg': 'Replace user page text with, or text to add if the expiry is not infinite (leave blank for no change):',
'common-reasons': 'Common reasons:',
'other-reason': 'Other reason',
Riga 192 ⟶ 204:
'blockusers': 'Utenti da bloccare (uno per riga):',
'talkmsg': 'Sostituisci la talk con (lasciare vuoto per non modificare la talk):',
'upmsg': 'Sostituisci la pagina utente con, oppure aggiungi alla talk se il blocco non è infinito (lasciare vuoto per non modificare la pagina utente):',
'common-reasons': 'Motivazioni comuni:',
'other-reason': 'Altra motivazione',
Riga 285 ⟶ 297:
var show = /^(indefinite|indefinito|infinito|)$/i.test( this.value.trim() );
var toggle = [ 'wpMassBlockTalkMsgLegend', 'wpMassBlockUserMsgLegend', 'wpMassBlockMessage', 'wpMassBlockTag',
];
|