Content deleted Content added
better status |
Sync from sandbox, add "dir" and "shuffle" options |
||
Line 7:
var pageList = [];
const reuse = ( typeof refreshReuseBubble === 'undefined' ? false : refreshReuseBubble );
function shuffleArray(array) {
console.log('Shuffling array...');
for (let i = array.length - 1; i >= 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
function getWait(d, totalCount) {
Line 51 ⟶ 59:
var err = error?.textStatus || code;
var errMsg;
//if (confirm("Error performing " + action + ": " + err + "!\n\nContinue?") == true) {
errMsg = "Continuing after "+err+" error...";
postDone();
//} else {
// errMsg = "Aborted due to "+err+" error!";
//}
mw.notify(errMsg, { tag: "bubble" + (reuse ? 0 : "error"), type: 'error',
autoHideSeconds: (action == 'purge') ? 'long' : 'short' } );
Line 78 ⟶ 86:
var numPages = wait.edit < 1000 ? 3 : 1;
apiParams.titles = pageList.splice(0, numPages).join('|');
console.log(apiParams.titles);
apiParams.forcerecursivelinkupdate = "1";
//apiParams.forcelinkupdate = "1";
Line 83 ⟶ 92:
} else {
apiParams.title = pageList.shift();
console.log(apiParams.title);
apiParams.watchlist = "nochange";
apiParams.nocreate = "1";
Line 99 ⟶ 109:
target,
addParams);
var list = target?.list || "pages";
if (queryParams.cmdir && window.refreshOrder) queryParams.cmdir = window.refreshOrder;
console.log(queryParams);
new mw.Api().post(queryParams).fail(function(code, error) {
console.error(error);
alert("Error fetching page titles: " + code + "!");
} ).done(function(q) {
if(q && q.warnings === undefined && q?.query?.[list]
if (
});▼
▲ }
▲ if (q["continue"] !== undefined
▲ getList(action, target, q["continue"]);
} else {
if (window.refreshShuffle) shuffleArray(pageList);
console.log(pageList);
new mw.Api().get( {
Line 169 ⟶ 176:
} else {
query = {
cmsort: 'timestamp',
cmdir: 'desc'
};
linkTitle = "category members";
|