User:Renamed user 1118e35231e79f4dfb50928b1223c248/SummaryBrute.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | This user script seems to have a documentation page at User:Renamed user 1118e35231e79f4dfb50928b1223c248/SummaryBrute. |
var path = document.location.href;
var regex = /(wiki|w)\/(index\.php\?title=|)Draft:.*(\?|&)action=(edit.*&preload=Template:AFC_submission\/Subst.*|submit)/gi;
var override = /&toxiran=1/;
var version = "v1.6.1";
var ad = " (using [[User:ToxiBoi/SummaryBrute|SB "+version+"]])";
function AskForConfirmation() {
if (window.ToxiSummaryBrute.BypassDialog === true) {
return true;
} else {
return confirm('It looks like you are trying to submit a draft. Would you like to activate SummaryBrute?');
}
}
var IfSubmit = regex.test(path);
console.log("SummaryBrute Results (Submission): "+IfSubmit);
var IfOverride = override.test(path);
console.log("SummaryBrute Results (Override): "+IfOverride);
if (IfOverride) {
mw.notify("SummaryBrute has finished. You should now be able to submit without any problems.");
}
if (IfSubmit === true && IfOverride === false && AskForConfirmation()) {
mw.notify("Running SummaryBrute...");
document.location.href = path+"&toxiran=1&summary=Submitting draft"+ad;
}