[TYPO3-core] RFC: #10144: enable JS-Libs in BE

Steffen Kamper info at sk-typo3.de
Fri Feb 20 00:33:34 CET 2009


Hi,

after testing some more i encountered one problem that i wasn't aware of.
Stylesheets applied with template::addStyleSheet allows to use a title 
tag. This is very dangerous as the stylesheet will be loaded, but not 
applied, see [1]
Because of that i removed the title for extJs-stylesheets.

Another one that should be known is, that BE-modules _always_ include 
prototype (when using docheader). This is done in 
template::setModuleTemplate, and only reason is the IE compatibility.
This is bad for some reasons:
1) why including such big library for resizing IE document
2) using this patch could cause JS error because ext-base and prototype 
doesn't work together. This can be changed simple by using same method 
in setModuleTemplate, which i did in the new patch attached to this post

3) not a problem, but unnecessary is the inclusion of tabs.js which is 
done always with setting if 
(!$GLOBALS['BE_USER']->uc['disableTabInTextarea'])
but this is not part of this patch.

vg Steffen


[1] 
https://developer.mozilla.org/En/Correctly_Using_Titles_With_External_Stylesheets


Steffen Kamper schrieb:
> Hi,
> 
> This is SVN patch request.
> 
> Type: Feature
> 
> Branches: trunk
> 
> BT reference: http://bugs.typo3.org/view.php?id=10144
> 
> Problem:
> after i made a patch for extJS only some problems has been debunked.
> 
> * there are 3 libs in contrib that are used: prototype, scriptaculous 
> and extJS
> * load order is important
> * there must be an easy way to load or make additions
> 
> Solution:
> provide flags/function to include JSlibs.
> 
> Attached patch gives you all to do it with very easy calls. The order of 
> calls are not important as the load order is given.
> Ext-adapter is choosen automatic dependend of prototype loaded
> 
> Scriptaculous Modules can easy be added by call. There is also a 
> dependency-check to load module 'effects' if it's necessary.
> 
> No double inclusion is possible, even with equal calls.
> 
> Here are samples how to call it:
> 
> $this->doc->loadExtJS();
> $this->doc->loadPrototype();
> $this->doc->loadScriptaculous();
> $this->doc->loadScriptaculous('all');
> $this->doc->loadScriptaculousModules('dragdrop');
> 
> There is an additional flag if you want to use debug-version of extJS, 
> just set the flag:
> 
> $this->doc->setExtJSDebug();
> 
> Additional:
> this patch depends on
> #10121: New template-function to add extJS inline code
> which is in this list too, and it adds the space.gif to the inline 
> section of extJS. If you want to test it without this patch just comment 
> out the call.
> 
> This patch is also a replace for RFC #10069 (not needed anymore)
> Also RFC #10122 is not important anymore.
> 
> vg Steffen
> vg Steffen
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 10144_v3.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090220/1d9df800/attachment-0001.txt 


More information about the TYPO3-team-core mailing list