[Mediawiki-l] A few basic questions

Rob Church robchur at gmail.com
Sun May 13 19:51:39 UTC 2007

On 13/05/07, Mike <xclbur5150 at yahoo.com> wrote:
> What is a JavaScript helper function and how do I use it?

A "helper function" is just convenience code to do something that's
otherwise a bit more complex. In this case, I'm referring to functions
which add buttons to the toolbar. JavaScript is just the language
these are written in.

> Searched for common.js

No, "MediaWiki:Common.js" is a page which MediaWiki sends to the
client to be processed as JavaScript on page views, in all recent
release versions of the software. Code such as the example on the
English Wikipedia web site can take advantage of this to, for example,
call the code mentioned above to add edit buttons to the toolbar.

You'll want to "borrow" some of the code from
http://en.wikipedia.org/wiki/MediaWiki:Common.js and place the
appropriate lines into the MediaWiki:Common.js page on your wiki,
creating it if it doesn't exist. You will then most likely want to
alter the code to change what buttons you're adding, images, etc.

Rob Church

More information about the MediaWiki-l mailing list