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

Contenuto cancellato Contenuto aggiunto
m + un sacco di todo
Unbreak protezione (scritto male perché da mobile Ace fa pena)
Riga 6:
* Overwrite values in localMsg below to localize.
*
* @todo change how protection level is retrieved?, handle failures nicely
* @todo Protection doesn't work (needs right type),
* fix async loop, disable summary fields if no text,
* improve error reporting: make each error code a link
* to the page of the corrisponding module on m.o,
Riga 241:
*/
function doProtectPage( title ) {
return new mw.Api().postWithTokenget( 'csrf', {
action: 'query',
titles: title
} ).then ( function ( data ) {
var exists = Object.keys( data.query.pages )[0] !== -1,
prType = exists ? 'edit=sysop|move=sysop' : 'create=sysop';
return new mw.Api().postWithToken( 'csrf', {
action: 'protect',
title: title,
protections: 'edit=sysop|move=sysop|create=sysop'prType,
reason: $( "#wpMassBlockProtectReason input" ).val().trim(),
watchlist: 'nochange',
format: 'json',
} ); } );
}