User:Lifebaka/closedrv/test.js

This is an old revision of this page, as edited by Lifebaka (talk | contribs) at 18:36, 7 April 2014 (wooooo). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.
//this helps automate DRV closing by adding a 'close' tab to DRV debates when editing sections
//written by [[User:Lifebaka]], modified from [[Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js]] written by [[User:Johnleemk]]
//this code is for testing changes to [[User:Lifebaka/closedrv.js]] without making changes to the actual live javascript
//please do not import this code unless you are using it for testing purposes, as it is not guaranteed to work properly

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 User:Lifebaka/Sandbox/closedrv testing") != -1) && (document.title.indexOf("(section)") != -1))
    {
      addPortletLink('p-cactions', 'javascript:autodrv_result()', "close");
    }
}

addOnloadHook(autodrv_add_drv_tabs);
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy