Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// [[User:PxMa/rfacloser.js]]
importScript("User:PxMa/simpleajax.js");
importScript("User:Azatoth/morebits.js");


 function rfahelperload(){
 if(wgTitle.indexOf("Requests for adminship") == -1){
  return;
 }
 mw.util.addPortletLink("p-cactions", "javascript:rfahelper('archive')", "archive", "ca-archive", "archive", "");
}
$(rfahelperload);
 if (type == "close"){
  var params = window.prompt("unsuccessful/successful");
  if(params == null){
   params = "";
  }else{
   params = " " + params;
  }
  
 if(type == "denied"){
  var params = window.prompt("v/bio/nn/web/corp/music/dict/context/blank/neo/joke/lang/blp/npov/not");
  if(params == null){
   params = "";
  }else{
   params = " " + params;
  }
  var tag = "{" + "{" + "subst:afc"+params+"}}";
  simpleAJAXPrepend(wgPageName, ":"+tag+" ~~"+"~~"+"\n", "Article denied", false, true, "<h3>Editing...</h3>", "<h3>Saved!</h3>", false);
 }
 if(type == "archive"){
  var result = window.prompt("p/f/h", "Archiving");
  simpleAJAXAppendPrepend(wgPageName, "{"+"{"+"subst:rfa"+result+"}}", "{"+"{"+"subst:rfab}}", "Archiving", false, false, "<h3>Archiving...</h3>", "<h3>Archived, reloading...</h3>", true);
 }
}