User:Qwerfjkl/scripts/massXFD.js: Difference between revisions

Content deleted Content added
Fix issue with batches not being sync, cleanup code [Factotum]
Fix regression with handling large numbers of edits by spacing them out [Factotum]
Line 1:
// <nowiki>
// redirect check + old nom prefill
 
// todo: make counter inline, remove progresss and progressElement from editPAge(), more dynamic reatelimit wait.
// counter semi inline; adjust align in createProgressBar()
// Function to wipe the text content of the page inside #bodyContent
 
// update normalise function for CfD - use mw.Title()
 
function capitalise(s) {
Line 1,447 ⟶ 1,446:
}
const promises = options.titles.map(async (title) => {[];
for (const title of options.titles) {
let data = deepCopy(options);
if (XFD === 'RFD' && data.type === 'prepend') {
Line 1,463:
const promise = editPage(data);
return promises.push(trackPromise(promise));
});
if (!window.abortEdits) await sleep(100); // space out calls - not needed if they're being rejected
await massXFDratelimitPromise; // stop if ratelimit reached (global variable)
}
await Promise.allSettled(promises);
Line 1,483 ⟶ 1,486:
}
}