[dokuwiki] Re: JavaScript include conditionals

  • From: "Martin Tschofen" <martin.tschofen@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 20 Jan 2007 09:01:06 -0600

I wasn't thinking that DW checks if blocks are identical, I was just
assuming it compares names of blocks or scripts. Granted that could cause
all kinds of issues, hence the idea of script.ini.

How would helper plugins work properly with templates? I noticed that when
attaching an event in the js file before any of the called objects are
loaded can cause problems.
Wouldn't loading more plugins cause a performance issue as well?
What about naming? I'd be inclined to name it something weird like aaaHelper
to insure that it loads first. Or do we then need some other mechanism to
make sure that certain plugins load first?

For a helper plugin to just load a script and maybe a css file, would it
just contain a class definition inside main.php?

I'm game either way...martin

On 1/19/07, Chris Smith <chris@xxxxxxxxxxxxx> wrote:

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: