User:ToxiBoi/SummaryBrute.js

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 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; }