Discussion:
[Erp5-dev] css and js list - refactoring?
bartek
2008-04-01 13:45:17 UTC
Permalink
Hello,

Would there be any objections agains factoring css list and js list out
of global_definitions, into scripts like:
ERP5Site_getCSSList
ERP5Site_getJSList
?

RATIONALE: When doing experimental stuff there is often a need to add
something there - at the moment one has to either overwrite
global_definitions or do weird hacks to put two dtml docs of the same
name together. Such small refactoring make it much, much easier.

Bartek
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Jean-Paul Smets
2008-04-01 17:22:41 UTC
Permalink
Hi,

I understand the requirement and I think it is already possible to do
with existing xhtml_style because the global variables which contain the
list of CSS or JS can be updated by any component which is used in the
HTML renderer (ex. a listbox renderer).

I do not agree with the ERP5Site_getCSSList approach. We used to have
some time ago a kind of script like this in erp5_web and it was not a
really good solution because it lead to a central definition of CSS or
JS list rather than a distributed one (at the level of each component
which participates in the rendering).

I would prefer
a- either keeping the current approach if it is possible (because it
does not require accessing yet another object in the rendering process)
b- or implement a tool in charge of registering CSS and JSS required
for rendering a page and then return either a list of registered CSS /
JS or a minimised version of the concatenation of all CSS. Some CMS
systems use this approach to accelerate the rendering of pages by the
Web Browser.

Regards,

JPS.
Post by bartek
Hello,
Would there be any objections agains factoring css list and js list out
ERP5Site_getCSSList
ERP5Site_getJSList
?
RATIONALE: When doing experimental stuff there is often a need to add
something there - at the moment one has to either overwrite
global_definitions or do weird hacks to put two dtml docs of the same
name together. Such small refactoring make it much, much easier.
Bartek
--
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
ERP5 Enterprise: Free / Open Source ERP for Critical Applications
http://www.erp5.com
ERP5 Express: Hosted Open Source ERP for small companies
http://www.myerp5.com
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
bartek
2008-04-02 07:37:46 UTC
Permalink
Post by Jean-Paul Smets
Hi,
I understand the requirement and I think it is already possible to do
with existing xhtml_style because the global variables which contain the
list of CSS or JS can be updated by any component which is used in the
HTML renderer (ex. a listbox renderer).
True - I forgot about this aspect.
Post by Jean-Paul Smets
b- or implement a tool in charge of registering CSS and JSS required
for rendering a page and then return either a list of registered CSS /
JS or a minimised version of the concatenation of all CSS. Some CMS
systems use this approach to accelerate the rendering of pages by the
Web Browser.
Something like CSS Registry in Plone? ThaT could be a way to go. If I
have your "blessing", then I'll give it a try.

Bartek
Post by Jean-Paul Smets
Regards,
JPS.
Post by bartek
Hello,
Would there be any objections agains factoring css list and js list out
ERP5Site_getCSSList
ERP5Site_getJSList
?
RATIONALE: When doing experimental stuff there is often a need to add
something there - at the moment one has to either overwrite
global_definitions or do weird hacks to put two dtml docs of the same
name together. Such small refactoring make it much, much easier.
Bartek
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Loading...