[TYPO3-core] RFC: #10144: enable JS-Libs in BE
Benjamin Mack
benni at typo3.org
Wed Feb 11 13:55:46 CET 2009
Hey Steffen,
just tried out your patch. As it is a very nice function set for use in
the BE. Some issues arise though.
- We currently have the "loadJavascriptLib()" function. When I start
using your functions in existing modules where e.g. prototype.js is
already included through the loadJavascriptLib() (for the clickmenu for
instance), and I also use your function template::loadPrototype(), the
prototype.js is included twice! Somehow the removeLibFromArray() doesn't
work as expected. btw. I also don't like the naming of the function
"removeLibFromArray" (nobody knows that you're talking about JS libs).
"removeJavascriptLib" (or the one that is the opposite of the existing
name) should do the trick.
- The comments <!-- include prototype -->
are nice, but let's just add one single generic
<!-- include javascript libraries -->
and then list every inclusion should suffice. Let's also do a tab in
front of every line so we keep it consistent with the rest of the HTML
(minor styling, but I thought I'd sill mention it).
- Additionally, I would move the existing
implode("\n", $this->JScodeLibArray)
in the function call
renderJSlibraries()
as well, so we have everything concerning rendering JS libraries in that
method.
- One more thing about naming: It's somehow confusing, how we use JSlib,
JavascriptLibrary, JavascriptLib etc. in our function calls. I'd love to
have more consistency here (at least with newly added functions). Same
goes with the naming of the newly added attributes (everything is
"addScript.." but then there is "scriptaculousModules", which should be
"addScriptaculousModules").
And (in general), I wish we'd had more documentation for developers how
they can work in the BE. This concerns including libraries like
prototype, extJS, the toolbar items on the top, BE modules... etc.
All the best,
Benni.
More information about the TYPO3-team-core
mailing list