Jump to content

User:Arbitrarily0/closeDRV.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Jon (WMF) (talk | contribs) at 15:51, 28 May 2021 (maintenance: more info). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
//See User:Lifebaka/closedrv.js
function autodrv_result()
{
  var close = prompt("Result of debate?")
  var f = document.editform, t = f.wpTextbox1;
  t.value = t.value.split('====[[').join('{{subst:' + 'drt|1=[[');
  t.value = t.value.split(']]====').join(']]|2=' + close + '}}');
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "drb" + "}}";
  f.wpSummary.value += "closing: " + close;
}
 
function autodrv_add_drv_tabs()
{
  // Only add for pages with the right string somewhere in the title
  if ((document.title.indexOf("Editing Wikipedia:Deletion review/Log/") != -1) && (document.title.indexOf("(section)") != -1))
    {
      mw.util.addPortletLink('p-cactions', 'javascript:autodrv_result()', "close");
    }
}
 
$(autodrv_add_drv_tabs);