[Seaside] getting the browser's screen resolution?
josephblatter62 at yahoo.com
Mon Mar 26 03:59:11 UTC 2007
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)?
----- Mensaje original ----
De: Lukas Renggli <renggli at gmail.com>
Para: Seaside - general discussion <seaside at lists.squeakfoundation.org>
Enviado: domingo, 25 de marzo, 2007 5:26:22
Asunto: Re: [Seaside] getting the browser's screen resolution?
> I know there's a discussion some time ago, but I haven't found a clear
> solution to get the browser's screen resolution. Is there a way to do this
> with Seaside?
There is no difference to PHP, JSP, RoR, ... whatever. You can
basically take any solution from there and take it over to Seaside.
If you use Scriptaculous something like that might work for you:
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'))
This generates a new request posting the current values into your
web-applications. Maybe nicer would be to override #initialRequest:
and do a redirect posting the size, but that wouldn't be that simple
Seaside mailing list
Seaside at lists.squeakfoundation.org
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside