Jump to content

User:Ultraexactzz/afdsort2.js

From Wikipedia, the free encyclopedia
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.
//<pre><nowiki>
 function afdsort2() {
  var f = document.editform, t = f.wpTextbox1;
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|B}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|b}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|S}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|s}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|O}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|o}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|P}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|p}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|T}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|t}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|M}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|m}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|F}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|f}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|W}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|w}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|G}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|g}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|U}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|u}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|?}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|I}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|i}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|{{{category}}}}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|{{{cat}}}}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|Category}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|category}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|cat}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|null}}\r\n").join("{{subst:ns:0}}");
  t.value=t.value.split("{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|unsorted}}\r\n").join("{{subst:ns:0}}");
    f.wpSummary.value = "Removing sort template from closed debate using [[User:Ultraexactzz/afdsort|AFDsort]]";
    f.submit();
}
 
addOnloadHook(
 function addafdsortlink() { 
  if (document.title.indexOf("Editing Wikipedia:Articles for deletion") == 0)
  {
    mw.util.addPortletLink("p-cactions", "javascript:afdsort2()", "Unsort", "", "", "", "");
  } }
); 
//</nowiki></pre>