[Seaside] getting the browser's screen resolution?

Joseph Blatter josephblatter62 at yahoo.com
Mon Mar 26 14:19:52 UTC 2007


Lukas, thanks for your reply. I've copied your code into a #renderContentOn: with a "self halt" to inspect the values of width and height and they are nil everytime, so that's why I've asked to you again.

>the class SURequest -- has a nice class comment

I don't know if I missing some package or something else, but you're saying this class comment in SURequest is enough for understanding how to use the class?
"Initiates and processes an AJAX request." 
(sorry, as I'm not an AJAX programmer, I didn't expected to learn first Ajax to then get back to Smalltalk)

The method comment in #callback:value you're saying it's ok for understanding what does the method, and maybe as a developer concerned with the internals of the framework is even perfect and enough, but it's difficult to me (and I guess all first-time Scriptaculous users) to see the general context for its use. I've browsed 8 senders, most of them starts with #triggerSomething. 2 of them are documented but no senders, so I can't get a general view for it's use. Going to a sender of one of the #triggers...

renderContentOn: html
    html paragraph
        script: (html inPlaceEditor
            cancelLink: false;
            triggerInPlaceEditor: [ :value | text := value ];
            callback: [ :r | r render: text ]);
        with: text

it's unclear (at least for me) what the script's argument does, and when the trigger is made.

Sorry for asking this, but I think with more and good code comments the seaside community will be benefitted a lot and no-one will complaint for helping newbies (or unexperienced AJAX programmers) to use the framework easier.
thanks

----- Mensaje original ----
De: Lukas Renggli <renggli at gmail.com>
Para: Seaside - general discussion <seaside at lists.squeakfoundation.org>
Enviado: lunes, 26 de marzo, 2007 3:49:02
Asunto: Re: [Seaside] getting the browser's screen resolution?

> Hi Lukas. Since most methods in Seaside are undocumented, and it seems
> difficult to deduce what should I do from what you wrote, can you show me
> how to get those current values (how to trigger the callback to set weight
> and height)?

I asked Google for you and transformed everything to Seaside. The only
thing remaining for you to do is to copy the code into a rendering
method and to create the instance-variables width and height.

> html script: (html request
>     callback: [ :value | width := value ] value: (SUStream on:
> 'window.innerWidth || document.documentElement.clientWidth
> ||
> document.body.clientWidth || 0');
>     callback: [ :value | height := value ] value: (SUStream on:
> 'window.innerHeight ||
> document.documentElement.clientHeight ||
> document.body.clientHeight || 0'))

The object returned by #request -- the class SURequest -- has a nice
class comment. The key method here -- #callback:value: -- is well
documented.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside






__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070326/0d5fdb23/attachment.htm


More information about the seaside mailing list