User talk:Nmajdan/welcome newuser.js

From OpenWetWare
Jump to: navigation, search



'welcome_newuser is a javascript file that contains a function that allows you to quickly add a welcome template to a new user's talk page. I created this file by modifying Omegatron's 'tag unverified image' script.

How it works

For this to work, you must be in edit mode on a user's talk page. For most new users, they will not have anything on their talk page so when you go there, it will automatically be in edit mode. When in edit mode, a tab will appear at the top of the screen that says "welcome." Clicking this tab executes the function. It adds whatever template you want (the default template is {{welcomeh}}) to the talk page and adds an edit summary and saves the change.


To use a different welcome template, you will need to copy the javascript code directly into your monobook.js file. Then you will need to change the following line:

//The welcome template you are wanting to use
var welcome_msg = 'welcomeh'

In place of welcomeh, replace with whatever welcome template you are wanting to use.


Has been tested in Firefox 2.0, Internet Explorer 6, and the Monobook skin.


Add the above scripts and following to your script file (usually found at User:YOUR_USER_NAME_HERE/monobook.js):

/**** welcome new user ****/
document.write('<script type="text/javascript"' +
  'src="' +

Remember to refresh your browser's cache (Ctrl-F5 for IE, Shift-Ctrl-R for Firefox) before complaining it doesn't work!



I hope you all enjoy this new script. Let me know if you have any issues!--NMajdantalk 16:41, 11 January 2007 (UTC)

A couple enhancements

I added a couple enhancements, viz. that you can disable watching the user's page (the new default) and that the edit summary is also configurable. See User:Flex/welcome_newuser.js (sorry about the spacing getting messed up). --Flex (talk|contribs) 18:23, 15 February 2007 (UTC)

Not working

It isn't working. - PatricknoddyTALK (reply here)|HISTORY 10:59, 17 March 2007 (UTC)

Im using internet explorer 7, and its not working :( EvilHom3r 02:31, 7 August 2007 (UTC) Never mind, i found out that none of my scripts were working. All fixed now and your script is working fine ^.^! EvilHom3r 11:31, 7 August 2007 (UTC)

Some bugs to fix

I'm not sure why the script wouldn't work in IE (see previous section), but I did spot a few bugs while eyeballing it:

  1. The two instances of "ca-unverified" should be "ca-welcome".
  2. The check for indexOf(tag) isn't likely to do much anyway, unless you accidentally click the tab twice. At least, it won't detect the presence of an already substed welcome message on the page.

The first should be trivial to fix; the second, if considered a bug at all, may need some further thought. —Ilmari Karonen (talk) 07:13, 7 August 2007 (UTC)