User:Pxma/afdcloser.js

importScript("User:PxMa/simpleajax.js"); importScript("User:Azatoth/morebits.js"); function afdhelperload{ if(wgTitle.indexOf("Articles for deletion/") == -1){ return; } mw.util.addPortletLink("p-cactions", "javascript:afdhelper('Close')", "Close", "ca-close", "close", ""); } $(afdhelperload); function afdhelper(type){ if(type == "Close"){ var params = window.prompt("add the results"); if(params == null){ params = ""; }else{ params = " " + params; } var tag = "{" + "{" + "subst:afd top"+params+"}}"; simpleAJAXAppendPrepend(wgPageName, "{"+"{"+"subst:afd top}}" +params+ "\~\~\~\~", "{"+"{"+"subst:afd bottom}}", "Closing AfD", false, false, " Archiving... ", " Archived, reloading... ", true, false); } document.forms["editform"].wpTextbox1.replace(/\{\{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD\|[^\}]*\}\}/, ''); }