User:Bot523/monobook.js

// // AfD decatting, substituting closeboxes addOnloadHook(function { if(location.href.indexOf('afddecat=Y')!=-1) { var subst;  if(document.editform.wpTextbox1.value.indexOf(     'The following discussion is an archived debate of the proposed deletion of '+     'the article below.')==-1 &&document.editform.wpTextbox1.value.indexOf("")==-1 &&document.editform.wpTextbox1.value.indexOf("")==-1 &&document.editform.wpTextbox1.value.indexOf("")==-1) {window.close; return;} //still open, do nothing subst=1;  if(document.editform.wpTextbox1.value.indexOf("")==-1 &&document.editform.wpTextbox1.value.indexOf("")==-1 &&document.editform.wpTextbox1.value.indexOf("")==-1) subst=0; document.editform.wpTextbox1.value=document.editform.wpTextbox1.value.    split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|").join("{{ns:0|");  document.editform.wpTextbox1.value=document.editform.wpTextbox1.value.    split("").join("{{subs"+"t:at}}").split("").join("{{subs"+"t:at}}").    split("").join("{{subs"+"t:at}}");  document.editform.wpTextbox1.value=document.editform.wpTextbox1.value.    split("{{a"+"b}}").join("{{subs"+"t:ab}}").split("{{afd "+"b}}").join("{{subs"+"t:ab}}").    split("{{afd "+"bottom}}").join("{{subs"+"t:ab}}");  document.editform.wpMinoredit.checked='checked';  document.editform.wpSummary.value="BOT: Removing category from closed"     + " AfD debate"+(subst?" and substing closebox":"");  document.editform.wpSave.click; } else if(location.href.indexOf("Wikipedia:Articles_for_deletion/")!=-1) window.close; }); //