[dokuwiki] Re: JavaScript include conditionals

Andreas Gohr wrote:
On Fri, 19 Jan 2007 13:56:37 +0000
Chris Smith <chris@xxxxxxxxxxxxx> wrote:

I'm not so keen on this "extra syntax".  I think the helper plugin
idea works better.  If helper plugins are in place for common php
code, why not use them for common javascript and css too.  That to me
makes more sense than introducing a new syntax.

I see it not as replacement to the helper plugins, but as addition. We
already enhanced the CSS syntax by adding the replacement patterns.
Introducing something alike for JavaScipt would make sense in my
opinion.


patterns (or variables) in CSS are a huge failure of CSS. Almost the first thing a programmer learns is to minimize the use of magic constants. In CSS, particularly for colour values, you are virtually forced to duplicate magic numbers throughout the file.

;)

maybe includes are a missing problem in JS. I think an issue with the include system is an inability to tell if the blocks are actually identical. I guess you could get around that by hashing the included block.

Helper plugins provide a single source so that isn't a problem. There is a potential for version issues with them. But I think the same version issues will occur with js includes. Hashing might be able to tell the two version apart and load both, however that just moves the problem into naming clashes.

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

Other related posts: