Jump to content

User:MacGyverMagic/welcome.js

From Wikipedia, the free encyclopedia
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.
 // A small piece of JS writen by [[User:MatthewFenton]], his first piece of JS.
function welcome() {
        if (document.title.indexOf('Editing User talk:') == 0) {
                document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '==' + 'Welcome' + '==\n' + '{{subst:User:' + 'MacGyverMagic/Welcome}}\n~~' + '~~';
                document.editform.wpSummary.value = 'Welcome a user to Wikipedia using JS WW';
        }
}
function welcome_tab() {
                add_link('javascript:welcome()', 'Welcome');
}

if (document.title.indexOf('Editing User talk:') == 0) {
        addOnloadHook(welcome_tab);
}