MediaWiki, for obvious security reasons, will treat scripts as random
text (meaning it will mangle it). What you have to do is make a tag
(say <popup>) that is translated by a simple extension into the needed
code. so
<popup>
is replaced by
<script language="JavaScript" type="text/JavaScript">
<!--
function popupEvent(ev, w, h) {
[code here]
}
//-->
</script>
This is too protect wikis from more serious attacks than they already are.
On Tue, 7 Dec 2004 12:38:20 +1300, Alistair Johnson
<johnsona(a)rembrandt.co.nz> wrote:
Dear all,
We're using MediaWiki for a corporate Intranet and have developed a number
of extensions which display dynamic data. I'm currently having a couple of
problems integrating a php calendar (
www.easilysimplecalendar.com/):
1. I have to include the following code in the page:
<script language="JavaScript" type="text/JavaScript">
<!--
function popupEvent(ev, w, h) {
[code here]
}
//-->
</script>
However MediaWiki is converting this to:
<script language="JavaScript" type="text/JavaScript">
<p><!--
function popupEvent(ev, w, h) {
</p>
<pre> [code here]
}
</pre>
<p>//-->
</script>
</p>
If I manually wrap the code in the <pre> tags I can get it processed by
MediaWiki in a non-mangled state, but then I end up with an ugly box on the
screen:
----
|
----
Any idea how I can work around this problem? I'm probably missing something
obvious ...
2. I also need to include some custom css code for this extension. I've
done this by adding it to the monobook css file, but I'd prefer an option
that wont get broken whenever MediaWiki is updated. Is there an approved
method of adding custom content within the <head></head> section?
I've lurked on the mailing lists for a couple of weeks now and found them
useful reading - $wgOut->enableClientCache(false) was a godsend for dynamic
content!
Regards,
al.
Alistair Johnson
IT Manager
Rembrandt Suits Limited
p +64 4 576 4822
f +64 4 567 0507
e johnsona(a)rembrandt.co.nz
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
--
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to Gmail!