सदस्य:Mayur/closedrv.js

मुक्त ज्ञानकोश विकिपीडिया से

सूचना: यह पृष्ठ सुरक्षित करने बाद, परिवर्तनों को देखने लिए ब्राउज़र का कैश ख़ाली करने की आवश्यकता हो सकती है।

  • मोज़िला / फ़ायरफ़ॉक्स / सफ़ारी: shift hold करें जब आप reload क्लिक करते है, या Ctrl-Shift-R (अपल मैक में Cmd-Shift-R) दबाएँ;
  • गूगल क्रोम: Ctrl-shift-R (मैक में Cmd-Shift-R) दबाएँ
  • इंटरनेट एक्सप्लोरर: Ctrl hold करें जब आप refresh क्लिक करते हैं, या Ctrl-F5 क्लिक करते हैं;
  • कॉङ्करर: सिर्फ़ Reload बटन पर क्लिक करें, या F5 क्लिक करें;
  • ऑपरा सदस्य को Tools→Preferences में सम्पूर्ण कैश ख़ाली करने की ज़रूरत हो सकती है।
//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]]
//to use this code, simply add importScript('User:Lifebaka/closedrv.js'); to your monobook.js page
//feel free to copy and change this code as necessary (using your own copy, please); any modifications I have made from the source are public domain

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);