[Sugar-devel] Preview

Daniel Narvaez dwnarvaez at gmail.com
Fri Sep 20 18:12:19 EDT 2013


On 20 September 2013 23:53, Gonzalo Odiard <gonzalo at laptop.org> wrote:

> In 90% of the cases, javascript should not ask the preview, and be saved
> in automatic way by the python code,
> just like the actual code. In the rare cases where the web activity want
> custom the preview, can get it from the url.
>

I can't think of a sane way to let the python code handle this in the
normal case. It doesn't know enough about what is going on in the js side.

I agree the (javascript) code should save automatically unless differently
configured, like the python code does. Not sure what's the best way to
expose that in the js API, though. Maybe a cancellable custom event? I tend
to think as a first implementation we could just always save the screenshot.

So I guess what I'm suggesting is:

1 In webactivity.py return a screenshot when
activity://..../api/screenshot.jpg is requested.
2 In activity.js make an xhr to that url and
getDatastoreObject().setMetadata() it on relevant session events.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130921/a3ca729a/attachment.html>


More information about the Sugar-devel mailing list