On Sun, 13 Mar 2005 08:44:32 -0500, Mike <mike(a)kordik.net> wrote:
I have enabled javascript in DefaultSetting.php:
$wgAllowUserJs = true;
1) Never edit DefaultSettings.php, as this is considered part of the
static software; local configuration should be made by copying the
appropriate parts to LocalSettings.php, will override the defaults in
DefaultSettings.
2) The "$wgAllowUserJs" doesn't ennable inclusion of arbitrary
JavaScript on any page, it enables each user to create a
[[User:<username>/<skinname>.js]] (e.g. [[User:IMSoP/monobook.js]])
page that will be executed every time that user loads that page. Maybe
the comments should be clearer on that.
I can't embed javascript in my pages using the
<script>....</script>.
What else do I need to do?
3) Note that allowing arbitrary JavaScript to be added to wiki pages
in this way is *extremely* risky - remember that the whole point of a
wiki is that anyone can edit any page they want to, so you'd be
allowing anyone to add any JavaScript to your pages; only do this if
you are very confident that only people you trust will be able to edit
the site.
4) That being said, the best way of introducing such a feature would
be to create an extension: see
http://meta.wikimedia.org/wiki/Write_your_own_MediaWiki_extension For
instance, you could handle <script>...</script> as an extension tag
which added the contents straight into the HTML, perhaps with some
sanitization. Or, if it's actually only a specific feature you want
(or several specific features), you could add extension for each one
of them (and thus have a lot more control over what code gets added).
HTH
--
Rowan Collins BSc
[IMSoP]