[Mediawiki-l] custom extension including <script> tags

Alistair Johnson JohnsonA at rembrandt.co.nz
Mon Dec 6 23:38:20 UTC 2004


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 at rembrandt.co.nz



More information about the MediaWiki-l mailing list