[Sugar-devel] Preview

Manuel Quiñones manuq at laptop.org
Sun Sep 22 12:43:55 EDT 2013


2013/9/20 Daniel Narvaez <dwnarvaez at gmail.com>:
> 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.

Yes, that's good enough for a first implementtion.

> 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.

Agreed.

-- 
.. manuq ..


More information about the Sugar-devel mailing list