andres at lifia.info.unlp.edu.ar
Fri Apr 25 19:38:01 UTC 2008
thanks for the replies. So it
seems that there is no standard solution :(. What I am
thinking about is in modelling a scripting environment,
So far I got the following things:
- A ScriptingEnvironment. This object is rendered
inside a div, with it's own particular id and is where
really don't like the name "Scripting Environment", but
I couldn't come up with something better).
- An extension to the WARenderCanvas to support the
- The objects that will receive messages dynamically
must have an id (and maybe in the future they will have
to be subclass of a specific class -something like
So the idea is to do things like:
callback: [:renderer | | proxy |
proxy:=self map scriptingProxy.
renderer render: proxy.
value: (self map isEnabled: anItemName);
message send and the idea is that a scripting
environment uses an updater to reload a div, where the
script is coded, thus reinterpreting the script and
objects. This objects are defined as global variables
in the /window/ object, and thus are global to all
scripts. This last part is kind of a hack, but it works
ok (at least on FF).
Now, what I would really like to have is:
callback: [self map enableGoogleBar].
and that the code inside the block is reinterpreted
because it is being executed in a scripting
environment; this means that the messages should be
sent to the proxy and the proxy should be rendered
afterwards. I'm looking into BlockContext at the moment
to see if this is possible. If we could do such a thing
writing everything as we are used in Smalltalk.
Any ideas are most appreciated.
Igor Stasenko escribió:
> 2008/4/25 Ramon Leon <ramon.leon at allresnet.com>:
>>> And finally, don't forget that we need to add new script to
>> > #updateRoot:
>> > updateRoot: htmlRoot
>> > htmlRoot addScript: self foo.
>> > What i don't like in code above:
>> > - script it is added manually, it would be more convenient to
>> > add it automatically (as result of call to html callMethod:
>> > #foo of: ...)
>> > - html root having no option to inline script in html,
>> > instead it generates <script src=..>, it would be good to
>> > have an option (a method, like WAHtmlRoot>>addScriptInline:,
>> > which will generate script with source inlined on page,
>> > because browser losing much more time to load script using
>> > separate request rather than simply parse few lines of code ,
>> > and if your page contains too much scripts , a page load time
>> > can be slowed down dramatically.
>> You most certainly can render inline script directly, no need to attach to
>> renderContentOn: html
>> html script: 'alert("hello")'
> This is not an option, suppose i'm using a component which represents
> an item in list.
> Now, for each item in list it will call html script: '' and produce
> many <script> tags for each item, while i need to add it only once.
>> Ramon Leon
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
More information about the seaside