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
*
* 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().
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:
reason: $( "#wpMassBlockProtectReason input" ).val().trim(),
watchlist: 'nochange',
format: 'json',
} ); } );
}
|