Martin Tschofen wrote:
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 whenattaching 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 aaaHelperto 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
JS can only affect those parts of the page loaded at the time the js is executed. The normal process is to include your script in the HEAD and to attach a listener to the window's onload event, so that the listener is fired after the document is complete. DokuWiki provides a simple mechanism for attaching listeners that doesn't conflict with DW's own onload listeners, details can be found at splitbrain. If you wish your javacript to execute before onload and for it to operate on certain parts of the page, you need to use script tags in the BODY located after the element you want to manipulate.
Of course if your wiki audience is using slow dial up connections your sensitivity to page/file size may be different from mine.
Cheers, Chris -- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist