User:BobBobBob/uncyclopedia.js

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Note: After saving, you have to bypass your browser's cache to see the changes.

  • Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
  • Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
  • Opera, Konqueror and Safari users can just click the Reload button.
  • Chrome: press Ctrl+F5 or Shift+F5
/* <nowiki> */

window.onload = Main;
function Main() {
    morelinks();
    addtoolbox();
}

function addlilink(tabs, url, name, id) {
    var na = document.createElement('a');
    na.href = url;
    na.id = id;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}

function morelinks() {
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(document.title.indexOf("Editing") == 0) addlilink(tabs, 'javascript:mtu()', 'mtu', '');
}

function mtu() {
    document.editform.wpSummary.value = '+MTU tagging (please move/expand/delete)';
    document.editform.wpMinoredit.checked = true;
    document.editform.wpWatchthis.checked = false;
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{MTUsign|~~~~~}}';
    document.editform.wpSave.focus();
}

function addtoolbox() {
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlilink(tb, 'irc://irc.freenode.net/uncyclopedia', 'IRC link', 't-irc');
    addlilink(tb, 'http://irc.wikicities.com/uncyclopedia/', 'cgi IRC link', 't-irccgi');
}

/* </nowiki> */