User:SilverLocust/sandbox.js: Difference between revisions

Content deleted Content added
np
change edit summary
 
(10 intermediate revisions by the same user not shown)
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|Arab-Israeli conflict]]',
},
format: 'json'
api = new mw.Api();
},;
api.get( params ).done( function ( data ) {
var pages = data.query.pages,
p;
for ( p in pages ) {
var pid = p;
}
} );
if(confirm(message)) {
api = new mw.postWithTokenApi({);
api.postWithToken( 'csrf', params );
action: 'pagetriageaction',
reviewed: 1,
skipnotif: 1,
pageid: pid
});
}
});