Jump to content

User:Sock of Steel359/unblock.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sock of Steel359 (talk | contribs) at 14:37, 19 May 2007 (Created page with '// <pre> function addLink(where, url, name, id, title, key, after) { // addLink() accepts either an id or a DOM node, addPortletLink() only takes a node if...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(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.
// <pre>

function addLink(where, url, name, id, title, key, after) {
    // addLink() accepts either an id or a DOM node, addPortletLink() only takes a node
    if (after && !after.cloneNode)
        after = document.getElementById(after);

    return addPortletLink(where, url, name, id, title, key, after);
}

  if (document.title.indexOf("Editing User talk:") != -1) {

  var url = wgServer + '/wiki/' + wgPageName + '?action=edit';
  var f = document.editform, t = f.wpTextbox1;

// ---------------------------------------------------------------------------------------------------------------

function declineunblock()
{
  var reason1 = prompt(Reason for declining?)
  if ( !reason1 ) {
  return;
 } else {
  window.open(url);
  var unblock = RegExp("\{\{[U|u]nblock\|(.*?)\}\}");
  var reviewed = "{"+"{Unblock reviewed|1=$1|decline=" + reason1 + "}}";
  t.value = t.value.split(unblock).join(reviewed);
  document.forms[0].wpDiff.click();
 }
}

function declineunblock_tagging()
{
  addPortletLink('p-interaction', 'function declineunblock()', "Decline unblock");
}