User:Jfingers88/monobook.js

From Wikipedia, the free encyclopedia

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.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//<nowiki> Admin-like RC Patrol tools
 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:VoA/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
//</nowiki>
 
// <nowiki>
 
window.onload = Main;
function Main() {
    addactions();
}
 
function addactions() {
    addwelcome();
}
 
function addwelcome() { 
    if(!document.editform) return;
    var txt = document.editform.wpTextbox1;
    var url = window.location;
    if(txt.value.length == 0) {
        if (url.search.indexOf("User_talk:") != -1) {
            var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
            if(document.title.indexOf("Editing") == 0) addlilink(tabs, 'javascript:welcome()', 'welcome', 'ca-welcome');
        }
    }
}
 
function welcome() {
    document.editform.wpSummary.value = 'Welcome!';
    document.editform.wpMinoredit.checked = false;
    document.editform.wpWatchthis.checked = false;
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{subst:User:Jfingers88/Templates/Welcome}} -~~~~';
    document.editform.wpSave.focus();
}
 
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;
}
 
// </nowiki>
 
 
// [[User:Lupin/popups.js]]
 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');