User:AoV2/mkredir.js

importScript("User:AoV2/query_string.js");

function mkredir{ if(qs.action != "edit" || !qs.mkredir) return; if(getElementsByClassName(document, "*", "permissions-errors").length) return; // this needs a unique id; this is really clumsy tb1 = document.getElementById("wpTextbox1"); if(tb1.value.length && !qs.aov_force) return; tb1.value = "#redirect " + qs.mkredir.replace(/_/g, " ") + ""; document.getElementById("wpSummary").value = qs.mkredir.toLowerCase; if(qs.aov_autosave) document.getElementById("wpSave").click; }

$(mkredir);