Content deleted Content added
ask before continuing |
fix purge, add refreshReuseBubble option |
||
Line 6:
mw.loader.using( [ 'mediawiki.util', 'mediawiki.api' ] ).then( function() {
var pageList = [];
const reuse = ( typeof refreshReuseBubble === 'undefined' ? false : refreshReuseBubble );
function getWait(d, type, totalCount) {
Line 45 ⟶ 46:
}
function postFail(code, error) {
var apiParams = {▼
title: pageList.shift(),▼
postDone();▼
};▼
function postSuccess() {
var tag = reuse ? 0 : count;
▲ var apiParams = {action: action};
if (action == "purge") {
apiParams.titles = pageList.shift();
apiParams.forcerecursivelinkupdate = "1";
new mw.Api().post(apiParams).fail(postFail).done(
} else {
apiParams.watchlist = "nochange";
apiParams.nocreate = "1";
apiParams.appendtext = "";
new mw.Api().postWithEditToken(apiParams).fail(
▲ console.error(error);
▲ if (confirm("Error performing " + action + ":" + code + "!\n\nContinue?") == true) {
▲ postDone();
▲ }
▲ mw.notify((count + 1) + " of " + totalCount + " page(s) were updated", { tag: "bubble"+count } );
▲ postDone();
▲ } );
}
}
|