MediaWiki:Gadget-reasons.js

/* */ // FUNCTION EDITS FIELD WITH REASONS FOR DELETING THE PAGE // if there was "Delete" template, the reason is filled in // otherwise the field will be empty function deleteArticle{ // without deleting it make no sense to do this if (wgAction != "delete") return; // reasons wpReason = document.getElementById("wpReason"); if (!wpReason) return; // usual reasons usualReasons = /(content was|page was empty|content before blanking was)/i; // help string wpReasonSmall = wpReason.value.toLowerCase; // reasons edit if (usualReasons.test(wpReasonSmall)){ if((wpReasonSmall.indexOf("") != -1)) { indexStart = wpReasonSmall.indexOf(""); wpReason.value = wpReason.value.substring(indexStart, indexEnd); } else {wpReason.value = "";} } } addOnloadHook(deleteArticle); /* */