User:SilverLocust/sandbox.js: Difference between revisions

Content deleted Content added
m may need to be an edit token
protect links
Line 1:
$(".mwprotect-newpages-pagenamebutton").on('click', function(e) {
e.preventDefault();
var titlepage = this.innerText,
message = 'MarkProtect ' + titlepage + ' as reviewed?',
params = {
action: 'queryprotect',
formattitle: 'json'page,
protections: 'edit=extendedconfirmed|move=extendedconfirmed',
titles: title,
propexpiry: 'infoinfinite',
reason: '[[WP:ARBECR|Arbitration enforcement]]: [[WP:PIA]]',
},
format: 'json'
api = new mw.Api(),
pid};
api.get( params ).done( function ( data ) {
var pages = data.query.pages,
p;
for ( p in pages ) {
pid = p;
}
} );
if(confirm(message)) {
api = new mw.Api(),;
api.postWithEditToken('pagetriageaction',
api.postWithToken( 'csrf', params );
{
action: 'pagetriageaction',
reviewed: 1,
skipnotif: 1,
pageid: pid
}
);
}
});