[Mediawiki-l] Adding Scripts to a Page

Tels nospam-abuse at bloodgate.com
Sat Jun 3 02:22:29 UTC 2006


Moin,

On Friday 02 June 2006 23:05, Brion Vibber wrote:
> Richard Minerich wrote:
> > I am currently working on an extension for MediaWiki and am having
> > some trouble getting scripts into the <head>
> > it seems as though $wgOut->addScript() does not work in the following
> > case:
> [snip]
> > I am unsure if it is because the timing of when I call addScript or
> > what. Any help would be greatly appreciated.
>
> You may not touch $wgOut or its output at wikitext render time (when
> parser hook extensions are called). First, output is also aggressively
> cached  so your hook will usually not be run again at actual output
> time.
>
> Keep in mind also that rendering may happen as a background task *while
> something else is being displayed*, or in a maintenance script, etc. By
> touching $wgOut directly you may be corrupting the display of another
> page.
>
> I've got an experimental hack for attaching additional extension hooks
> to run at display time which can be set from a paser hook; see
> http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Aggregator/
>
> This work is incomplete at this time.

Still cool. Please make sure that the extension can set different hooks 
for preview and final (aka saveas) rendering, as this is the only way for 
extensions generating files to know which files can be removed safely 
later on.

Best wishes,

Tels

-- 
 Signed on Sat Jun  3 04:21:08 2006 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "The campaign should combat the messages of pornography by putting signs
 on buses saying sex with children is not OK." -- Mary Anne Layden in
 ttp://tinyurl.com/6a9cy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://lists.wikimedia.org/pipermail/mediawiki-l/attachments/20060603/877bcff9/attachment.pgp 


More information about the MediaWiki-l mailing list