[TYPO3-core] RFC: #10122: loadJavascriptLib needs second param to be unique

Martin Kutschker masi-no at spam-typo3.org
Wed Jan 14 10:55:12 CET 2009


Franz Koch schrieb:
> Hi,
>>> I'd go for one official supportet JS library in BE and encourage to use
>>> that one.
>>
>> The point is that Prototype and script.aculo.us are already in the Core
>> (4.2) and extJS has recently be added to trunk (4.3). So IMHO we need to
>> make sure that these three libraries work well together in the BE.
>>
>> This should be made fool proof.
> 
> If both are official supported, then I would create special loader
> methods for them which resolve dependencies and take care of the right
> order of inclusion etc.
> 
> $this->doc->loadExtJS('moduleName');

Steffen has already suggested such a function. But it turned out that
there are some intricacies.

So to ensure correct load order I suggest three functions:

loadPrototype()
loadScriptaculous($module)
loadExtJS($theme='',$debug=false)

They may be called in any order repeatedly. The page rendering code will
make sure they are loaded in the correct order and extJS will be called
with the proper adapter.

If loadScriptaculous() may be called with different modules all of them
will be loaded.

extJS will always be loaded with the proper CSS. Actually I see no
reason to load it without.

Masi


More information about the TYPO3-team-core mailing list