User:Lady Aleena/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
//If you are not editing a page, a tab will appear allowing you to edit the 0th section of a page (the top area usually used as an introduction.

function addEditSection0() {
  ta['ca-edit-0'] = ['', 'Edit the zeroth section of this page'];
  if (!document.getElementById) return;
  x = document.getElementById('ca-edit');
  if(!x) return;
  y = document.createElement('LI');
  y.id = 'ca-edit-0';
  if (x.className == 'selected') {
    if (/&action=edit&section=0$/.test(window.location.href)) {
      x.className = 'istalk';
      y.className = 'selected';
    } else {
      x.className = 'selected istalk';
    }
  } else if (x.className == 'selected istalk') {
    if (/&action=edit&section=0$/.test(window.location.href)) {
      x.className = 'istalk';
      y.className = 'selected istalk';
    } else {
      y.className = 'istalk';
    }
  } else {
    y.className = x.className;
    x.className = 'istalk';
  }
  z = document.createElement('A');
  if (x.children) {
    z.href = x.children[0].href + '&section=0';
    z.appendChild(document.createTextNode('0'));
    y.appendChild(z);
    document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling);
  } else {
    z.href = x.childNodes[0].href + '&section=0';
    z.appendChild(document.createTextNode('0'));
    y.appendChild(z);
    document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling);
  }
}

if (document.title.indexOf("Editing ") == -1) {
  addOnloadHook(addEditSection0);
}

//
/*
__NOTOC__
==function getPname()==

* This function is required for [[User:Howcheng/quickimgdelete.js|Howcheng's image deletion script]].

<pre>*/
function getPname() {
  z=document.getElementById("content").childNodes;
  for (var n=0;n<z.length;n++) { 
    if (z[n].className=="firstHeading") {
      var text = z[n].textContent ? z[n].textContent : z[n].innerText;
      return text;
    }
  }
}
/*
</pre>

==function addLink()==

*This function will add a link to your Wikipedia toolbar.  It is required both for [[User:Howcheng/quickimgdelete.js|Howcheng's image deletion script]] and my template replacement script.

<pre>
*/

/* This code may be problematic when it comes to titles with ampersands, etc, which are stored as ''& amp ;'' in HTML (without the spaces).
  A solution that solves this is the following:
    return document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));
*/

function addLink(where, url, name, id, title, key, after){
    //* where is the id of the toolbar where the button should be added;
    //   i.e. one of "p-cactions", "p-personal", "p-navigation", or "p-tb".
    //
    //* url is the URL which will be called when the button is clicked.
    //   javascript: urls can be used to do more complex things.
    //
    //* name is what will appear as the name of the button.
    //
    //* id is the id of the button; it's best to define one.  
    //   Use a prefix to make sure its unique. Optional.
    //
    //* title is the tooltip title that gives a longer description 
    //   of the button; if you define a accesskey, mention it here. Optional.
    //
    //* key is the char you want for the accesskey. Optional.
    //
    //* after is the id of the button you want to follow this one. Optional.
    //
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
    if(after) {
        tabs.insertBefore(li,document.getElementById(after));
    } else {
        tabs.appendChild(li);
    }
    if(id) {
        if(key && title) { ta[id] = [key, title]; }
        else if(key) { ta[id] = [key, '']; }
        else if(title) { ta[id] = ['', title];} 
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}

/*
</pre>

==[[User:Interiot/Tool2/code.js]]==

*This code enabled Interiot's edit counter.  If you have this code in your monobook, go to [[User:Interiot/Tool2/code.js]] to use the tool.

<pre>
*/

document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/*
</pre>

==[[User:Howcheng/quickimgdelete.js]]==

*This code enables Howcheng's image deletion utilities.  If you include this code, on any image page, you will see four image deletion links in your toolbox on the right side of your screen.
*This functionality requires getPname() and addLink() above.

<pre>
*/

/**** quick image delete ****/
document.write('<script type="text/javascript"' +
  'src="http://en.wikipedia.org/w/index.php?title=User:Howcheng/quickimgdelete.js' +
  '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/* This is to keep track of who is using this extension: [[User:Howcheng/quickimgdelete.js]] */

/*
</pre>

==Template replacement functions==

*'''ReplaceDeletedTemplate_navigate()''' is called when you click the "Replace templates" link in your toolbox.  It navigates to the "edit this page" window for the current window.
*'''ReplaceDeletedTemplate_onload()''' is called on page load and adds the "Replace templates" link to your toolbox.  It also, if you have clicked the "Replace Template(s)" button will execute the requested template replacements.
*These functions require the '''addLink()''' function above.
*To add a template to be replaced, edit the call to the '''replace()''' function in '''ReplaceDeletedTemplate_onload()'''.  The first parameter is the original tempalte name and the second parameter is the new template name.

<pre>
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT}}', '{{User time zone|GMT|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT}}', '{{user time zone|GMT|watch}}');
</pre>

*The command '''addOnloadHook(ReplaceDeletedTemplate_onload);''' adds this functionality when a page is loaded.
*Please note that after you edit your monobook, you may have to refresh your browser for changes to take effect.

<pre>
*/
function ReplaceDeletedTemplate_navigate()
{
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
window.location = editlk + '&fakeaction=temp_template_remove';
}

function ReplaceDeletedTemplate_onload()
{
addLink('p-tb', 'javascript:ReplaceDeletedTemplate_navigate()', 'Replace templates', 'temp-replace-template', 'Replace templates');

var fakeaction = getParamValue('fakeaction');
  if (fakeaction == 'temp_template_remove')
{
document.editform.wpMinoredit.checked = true;
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT}}', '{{User time zone|GMT|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT}}', '{{User time zone|GMT|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT2}}', '{{User time zone|GMT+2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT2}}', '{{User time zone|GMT+2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT8}}', '{{User time zone|GMT+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT8}}', '{{User time zone|GMT+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT5:30}}', '{{User time zone|GMT+5:30|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT5:30}}', '{{User time zone|GMT+5:30|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+1}}', '{{User time zone|GMT+1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+1}}', '{{user time zone|GMT+1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+2}}', '{{User time zone|GMT+2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+2}}', '{{user time zone|GMT+2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+3}}', '{{User time zone|GMT+3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+3}}', '{{user time zone|GMT+3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+4}}', '{{User time zone|GMT+4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+4}}', '{{user time zone|GMT+4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+5}}', '{{User time zone|GMT+5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+5}}', '{{user time zone|GMT+5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+6}}', '{{User time zone|GMT+6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+6}}', '{{user time zone|GMT+6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+7}}', '{{User time zone|GMT+7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+7}}', '{{user time zone|GMT+7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+8}}', '{{User time zone|GMT+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+8}}', '{{user time zone|GMT+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+9}}', '{{User time zone|GMT+9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+9}}', '{{user time zone|GMT+9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+10}}', '{{User time zone|GMT+10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+10}}', '{{user time zone|GMT+10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+11}}', '{{User time zone|GMT+11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+11}}', '{{user time zone|GMT+11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT+12}}', '{{User time zone|GMT+12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT+12}}', '{{user time zone|GMT+12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-1}}', '{{User time zone|GMT-1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-1}}', '{{user time zone|GMT-1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-2}}', '{{User time zone|GMT-2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-2}}', '{{user time zone|GMT-2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-3}}', '{{User time zone|GMT-3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-3}}', '{{user time zone|GMT-3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-4}}', '{{User time zone|GMT-4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-4}}', '{{user time zone|GMT-4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-5}}', '{{User time zone|GMT-5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-5}}', '{{user time zone|GMT-5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-6}}', '{{User time zone|GMT-6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-6}}', '{{user time zone|GMT-6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-7}}', '{{User time zone|GMT-7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-7}}', '{{user time zone|GMT-7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-8}}', '{{User time zone|GMT-8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-8}}', '{{user time zone|GMT-8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-9}}', '{{User time zone|GMT-9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-9}}', '{{user time zone|GMT-9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-10}}', '{{User time zone|GMT-10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-10}}', '{{user time zone|GMT-10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-11}}', '{{User time zone|GMT-11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-11}}', '{{user time zone|GMT-11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User GMT-12}}', '{{User time zone|GMT-12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user GMT-12}}', '{{user time zone|GMT-12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+1}}', '{{User time zone|UTC+1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+1}}', '{{user time zone|UTC+1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+2}}', '{{User time zone|UTC+2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+2}}', '{{user time zone|UTC+2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+3}}', '{{User time zone|UTC+3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+3}}', '{{user time zone|UTC+3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+4}}', '{{User time zone|UTC+4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+4}}', '{{user time zone|UTC+4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+5}}', '{{User time zone|UTC+5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+5}}', '{{user time zone|UTC+5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+6}}', '{{User time zone|UTC+6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+6}}', '{{user time zone|UTC+6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+7}}', '{{User time zone|UTC+7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+7}}', '{{user time zone|UTC+7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+8}}', '{{User time zone|UTC+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+8}}', '{{user time zone|UTC+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC8}}', '{{User time zone|UTC+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC8}}', '{{User time zone|UTC+8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+9}}', '{{User time zone|UTC+9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+9}}', '{{user time zone|UTC+9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+10}}', '{{User time zone|UTC+10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+10}}', '{{user time zone|UTC+10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+11}}', '{{User time zone|UTC+11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+11}}', '{{user time zone|UTC+11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC+12}}', '{{User time zone|UTC+12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC+12}}', '{{user time zone|UTC+12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-1}}', '{{User time zone|UTC-1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-1}}', '{{user time zone|UTC-1|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-2}}', '{{User time zone|UTC-2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-2}}', '{{user time zone|UTC-2|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-3}}', '{{User time zone|UTC-3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-3}}', '{{User time zone|UTC-3|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-4}}', '{{User time zone|UTC-4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-4}}', '{{User time zone|UTC-4|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-5}}', '{{User time zone|UTC-5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-5}}', '{{User time zone|UTC-5|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-6}}', '{{User time zone|UTC-6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-6}}', '{{User time zone|UTC-6|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-7}}', '{{User time zone|UTC-7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-7}}', '{{User time zone|UTC-7|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-8}}', '{{User time zone|UTC-8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-8}}', '{{User time zone|UTC-8|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-9}}', '{{User time zone|UTC-9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-9}}', '{{User time zone|UTC-9|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-10}}', '{{User time zone|UTC-10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-10}}', '{{User time zone|UTC-10|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-11}}', '{{User time zone|UTC-11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-11}}', '{{User time zone|UTC-11|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User UTC-12}}', '{{User time zone|UTC-12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user UTC-12}}', '{{User time zone|UTC-12|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User BST}}', '{{User time zone|British Summer Time{{!}}BST|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user BST}}', '{{User time zone|British Summer Time{{!}}BST|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User CET}}', '{{User time zone|Central European Time{{!}}CET|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user CET}}', '{{User time zone|Central European Time{{!}}CET|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User CST}}', '{{User time zone|Central Standard Time Zone{{!}}CST|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user CST}}', '{{User time zone|Central Standard Time Zone{{!}}CST|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User WET}}', '{{User time zone|Western European Time{{!}}WET|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user WET}}', '{{User time zone|Western European Time{{!}}WET|watch}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User CSI}}', '{{User CSI series}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user CSI}}', '{{User CSI series}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User CSI: LV}}', '{{User CSI series|CSI}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user CSI: LV}}', '{{User CSI series|CSI}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User CSI: Miami}}', '{{User CSI series|Miami}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user CSI: Miami}}', '{{User CSI series|Miami}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User CSI: NY}}', '{{User CSI series|NY}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user CSI: NY}}', '{{User CSI series|NY}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User blogat', '{{User blog');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user blogat', '{{User blog');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User lj link', '{{User lj');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user lj link', '{{User lj');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User bright side}}', '{{User Monty Python|Always Look on the Bright Side of Life| always looks on the bright side of life}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user bright side}}', '{{User Monty Python|Always Look on the Bright Side of Life| always looks on the bright side of life}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User_bright side}}', '{{User Monty Python|Always Look on the Bright Side of Life| always looks on the bright side of life}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user_bright side}}', '{{User Monty Python|Always Look on the Bright Side of Life| always looks on the bright side of life}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User Camelot}}', '{{User Monty Python|Monty Python and the Holy Grail| is from Camelot, and eats ham and jam and spamalot}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user Camelot}}', '{{User Monty Python|Monty Python and the Holy Grail| is from Camelot, and eats ham and jam and spamalot}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User_Camelot}}', '{{User Monty Python|Monty Python and the Holy Grail| is from Camelot, and eats ham and jam and spamalot}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user_Camelot}}', '{{User Monty Python|Monty Python and the Holy Grail| is from Camelot, and eats ham and jam and spamalot}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User messiah}}', '{{User Monty Python|Monty Python\'s Life of Brian| is not the Messiah! He is a very naughty boy}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user messiah}}', '{{User Monty Python|Monty Python\'s Life of Brian| is not the Messiah! He is a very naughty boy}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User_messiah}}', '{{User Monty Python|Monty Python\'s Life of Brian| is not the Messiah! He is a very naughty boy}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user_messiah}}', '{{User Monty Python|Monty Python\'s Life of Brian| is not the Messiah! He is a very naughty boy}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User monty python alt}}', '{{User Monty Python|The Lumberjack Song| cuts down trees, wears high heels, suspenders, and a bra}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user monty python alt}}', '{{User Monty Python|The Lumberjack Song| cuts down trees, wears high heels, suspenders, and a bra}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{User_monty python alt}}', '{{User Monty Python|The Lumberjack Song| cuts down trees, wears high heels, suspenders, and a bra}}');
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{user_monty python alt}}', '{{User Monty Python|The Lumberjack Song| cuts down trees, wears high heels, suspenders, and a bra}}');
document.editform.wpSummary.value = 'Changed template(s) with master template(s). Hope you don\'t mind. - LA';
document.editform.wpSave.click();
}
}

addOnloadHook(ReplaceDeletedTemplate_onload);


/*unrelated stuff - ignore */

// Install InstaView
 document.write('<script type="text/javascript"  src="http://en.wikipedia.org/w/index.php?title=User:Pilaf/instaview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

InstaView.conf.user.name = 'Pilaf';

/* This is to keep track of who is using InstaView: [[User:Pilaf/instaview.js]] */

/************ OLD STUFF *************

// Live Preview customization,
// edit this to your own liking.

wpUserName   = 'Pilaf';   // User name to display in signatures
wpShowImages = true;      // Enable downloading and displaying of images

// Include Live Preview...
document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// Now set everything up
window.onload = Main;

function Main()
{
 LivePreviewInstall();
 // You may include here other "extensions"
}

 */