[TYPO3-core] RFC: Load javascript libraries

Benjamin Mack mack at xnos.org
Tue Sep 18 23:22:02 CEST 2007


Hey Thomas,

Thomas Hempel wrote:
> What about a more general approach?
> If we use the complete path as $lib parameter we don't have hardcoded 
> paths and the lib scripts can have diferent names than the library 
> itself. Mootools is an example, where the file is called mootools.v1xxx.js.
Yeah, but I think we need to rename it to "contrib/mootools/mootools.js" 
in our contrib directory, because what happens if we decide to ship 
mootols.v1.0.1 and in 4.3 we'd go with mootools.v1.1.1 we'd need to 
still keep both versions because extension might have this (hardcoded) 
in their files

loadJavascriptLib("contrib/mootools/mootools.v1.0.1.js");

and then we'd have endless legacy trouble shipping tons of different 
versions.

I could agree with a

loadJavascriptLib("contrib/mootools/mootools.js");

then the extensions would automatically get the latest versions.

So, I think your function is fine as well, it does not solve 
"dependencies". But I think that somebody who includes scriptacoulus 
would include prototype as well anyway ("he who knows JS knows what he's 
doing"), so I don't see it as a big problem. So yeah, fine with me, but 
also the disadvantage with the ?effects stuff shouldn't be a problem either.

I just want this function included so I can work with it.

Attached is a full patch for your version. Haven't it tested yet but it 
looks like it's working ;-).

Also, I attached a the same patch again with a first "use case" where 
this function is handy (so people can try it out and give the +1s...)

So, let's get this thing going.

greetings,
benni.
-SDG-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20070918_loadjavascriptlib.patch
Type: text/x-patch
Size: 2390 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070918/c096ef22/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20070918_loadjavascriptlib_with_usecase.patch
Type: text/x-patch
Size: 3162 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070918/c096ef22/attachment-0001.bin 


More information about the TYPO3-team-core mailing list