[Seaside] Couple a JQPlugin tighter to a WAFileLibrary

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Sun Oct 12 09:11:36 UTC 2014


my Kontolino project now ships with quite a few add-ons that are 
implemented as jQuery Plugins or other Javascript artefacts, together 
with images, css files and more.

The usual way to serving this stuff is to put the "files", meaning css 
and js resources and such in some WAFileLibrary Class and then implement 
a JQPlugin subclass that wraps the configuratoion and installation of 
the plugin onto some DOM elements.

There are several drawbacks to this, I think:

* You need to either add the FileLibrary to you Application 
configuration or add it to each "page" of your app by hand in #updateRoot:
* You always have to keep in mind that you need the plugin class as well 
as the right file library

So what I'd like to have is a mechanism that makes life a bit easier and 
load times in the browser a bit shorter

* Only include the JS files in the rendered page if the plugin is used
* The links are added to the page automatically if the respective plugin 
is used in one of the rendered components
* Keep the Smalltalk-side wrapper code in the same class as the "served 
files", so that it is easier to browse back and forth between JS and ST 

Is this feasible in Seaside (I guess deep inspecting the children 
hierarchy to find out what needs to be added to the <head> section is 
not trivial) ? Is it already possible and I just never found out?
Do others think this sounds sensible?
What are your best practices to keep things structured?

Any comments are welcome


Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1

More information about the seaside mailing list