I'm trying to add a box (a div tag) on the first page of my MediaWiki installation, as content, not page template (I don't want to modify the skin), and I want to execute a bit of JavaScript that modifies the div every time the page is loaded. Basically, I'm copying the calendar page from http://es.wikipedia.org/wiki/Wikipedia:Portal_de_la_comunidad, but I want it to reflect the date/time information at the time the Main Page is loaded, not when it was saved and/or cached.
What's the right place to put that JavaScript? I've thought of MediaWiki:Monobook.js, but I'm a bit uncomfortable adding things to it, as I assume it can change when upgrading MediaWiki. I can also use an extension tag (let's say, <calendar></calendar>) and insert the script from there, but it's very ugly.
Is there any other, better place?
Thanks,
/L/e/k/t/u
On 4/22/05, Juanma Barranquero lekktu@gmail.com wrote:
What's the right place to put that JavaScript? I've thought of MediaWiki:Monobook.js, but I'm a bit uncomfortable adding things to it, as I assume it can change when upgrading MediaWiki.
Well, the update installer won't overwrite it if you've manually editted it, so it won't stop working. The problem is more the opposite, that in the event that something changes in the software's version of that, you'll have to merge those changes in with your manual ones. But presumably your code will be all in one block, so that's easy enough if you remember.
I can also use an extension tag (let's say, <calendar></calendar>) and insert the script from there, but it's very ugly.
I think that's the best that can be offered, tbh. There's a <charinsert> extension that Wikimedia sites use for precisely this kind of thing - a little snippet of JavaScript that's otherwise stripped out of the wikitext.
On 4/22/05, Rowan Collins rowan.collins@gmail.com wrote:
The problem is more the opposite, that in the event that something changes in the software's version of that, you'll have to merge those changes in with your manual ones.
Yes, I know, but I'm trying hard to minimize the number of non-default MediaWiki:* pages I have.
I think that's the best that can be offered, tbh.
Well, at least is good to know I'm not overlooking something evident.
Thanks a lot,
mediawiki-l@lists.wikimedia.org