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

Contenuto cancellato Contenuto aggiunto
Inizio nuova versione
 
m min
Riga 44:
reason: wpMassBlockReasons === "other" ? wpMassBlockReason : wpMassBlockReasons + (wpMassBlockReason ? ": " + wpMassBlockReason : ""),
user: user
} )
.then(
function(data) {
Riga 75:
 
function doEditUserPage() {
new mw.Api().postWithEditToken( {
action: 'edit',
title: 'User:' + user,
Riga 81:
summary: wpMassBlockSummaryUser,
watchlist: 'nochange'
} ).done ( function ( data ) {
userpageedited++;
} ).fail ( function ( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push("User talk:" + user);
error.push( e );
} );
}
 
function doEditTalk() {
new mw.Api().postWithEditToken( {
action: 'edit',
title: 'User talk:' + user,
Riga 97:
summary: wpMassBlockSummaryTalk,
watchlist: 'nochange'
} ).done ( function ( data ) {
talkpageedited++;
} ).fail ( function ( e ) {
//If not edited, add the title to the "failed" array and a description of the error to the "error" array.
failed.push("User talk:" + user);
error.push( e );
} );
}
 
Riga 158:
 
document.getElementById("wpMassBlockReasons").onchange = function() {
var maxlength = (document.getElementById("wpMassBlockReasons").value === "other" ? 255 : 253(255 - ': '.length) - document.getElementById("wpMassBlockReasons").value.length); //It's 25e because of the two characters (": ") in addition to the selected summary.
 
document.getElementById("wpMassBlockReason").setAttribute("maxlength", maxlength);
};
}
 
if (mw.config.get("wgNamespaceNumber") === -1 &&
(mw.config.get("wgTitle") == "Massblock" || mw.config.get("wgTitle") === "MassBlock") &&
/sysop/.test(mw.config.get("wgUserGroups"))
) {
$(massblockform);
}