Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
var api = new mw.Api();
var reason = prompt('Why would you want to delete those again?');
api.get({
action: 'query',
meta: 'tokens'
}).done(function(data) {
console.log(data);
var token = data.query.tokens.csrftoken;
api.get({
action: 'query',
list: 'categorymembers',
cmtitle: mw.config.get('wgPageName'),
cmlimit: 'max'
}).done(function(data) {
// console.log(data);
$.each(data.query.categorymembers, function() {
var page = this;
api.post({
action: 'delete',
pageid: page.pageid,
reason: reason,
token: token
}).done(function(data){
console.log(page.title + ' must have been deleted');
})
})
});
});