[dokuwiki] JavaScript include conditionals (was: pending patches?)

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 19 Jan 2007 10:48:01 +0100

> So I'm looking for a way to conditionally include this code.
> 
> Two solutions came to mind.
> 1. Allow a specially formatted comment inside a script file that tags
> part of the script file as conditional:
> /*loadOnlyOnce:Name-of-block*/
>    conditional js code here
> /*loadOnlyOnce:Name-of-block*/
> 
> in js.php during the clean out process capture each of these
> conditionals and when detected in another file ignore them.

I like this idea. Maybe we could even add an include mechanism, to
solve the problem many people had with only one script being allowed.
So instead of catting all my script files into one script.js I could
also use

/*include: script1.js*/
/*include: script2.js*/
/*include: script3.js*/

What do others think? The same could probably added to the CSS files as
well.

Andi

-- 
http://www.splitbrain.org
-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: