Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-09-03 Thread Aleksey Lim
On Sat, Aug 25, 2012 at 10:50:17PM +0200, lio...@olpc-france.org wrote:
  
 - Use POT localization for HTML5 resource

Did you already choose the way how to reuse gettext for JS code?
If I got it right, there is no standard way for that and several
implementations exist.

-- 
Aleksey
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-09-03 Thread lionel
  
 - Use POT localization for HTML5 resource

 Did you already choose the way how to reuse gettext for JS code?
 If I got it right, there is no standard way for that and several
implementations exist.

I choose the easy way :-) 
I will implement a JavaScript function gettext that will handle a dictionary
of string resources created and initialized by the Python code.
So every JavaScript/HTML5 string to be localized will have a Python
counterpart string. And of course localization of Python strings will follow
the standard POT process. It's one of the advantage to have 10-15% of Python
source code for the activity :-)

Lionel.

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-09-01 Thread Aleksey Lim
On Sat, Aug 25, 2012 at 10:50:17PM +0200, lio...@olpc-france.org wrote:
  
 
 Hi all,
 
  
 
 I've enhanced the work of Manuel Quinones to create an activity template
 using Enyo JavaScript Framework.
 
  
 
 My objective was to provide a template to write a Sugar activity using HTML5
 but without losing advantage of the Sugar integration. Plus, I didn't want
 using a HTTP Server integrated into the activity like in the Wikipedia
 activity.

Hi, I also found that JS is a good option to have cross-platform environment
for easy starting applcations on all current mainstream systems (from
desktops to phones). Even that JS doesn't look, for me, as good as
Python. But having frameworks like Enyo2, that makes coding UI lot easier
(in Enyo, it looks like coding in domain language within the JS), this
might be a really good option to write cross-platform applications.

Right now, I'm working on Sugar Network Contributor Hub application [5]
that will be a place for people who need doing oriented interface and
exactly low aged kids (in comparing thih sugar-network-webui). It is
Enyo2 based pure JS application.

 Finally, using some WebKit tips  tricks (calling a JavaScript in the
 current page and console message handling), I finally conceived a simple
 framework that allow bi-directional communication between Python code and
 JavaScript code (using Enyo Framework). You could find the resulting source
 code from this framework here [1] for Python and here [2] for JavaScript.

I'm following a bit differnt way. JS applcation is working with outer
world only using RESTful api. This api might provided by either Sugar
Network server[6] (and it is possible to run Hub applcation as-is even
on Andriod) or local sugar-network-service (and client side needs to
have it launched). In the last case, local service does extra work (providing
it as RESTful api) like access to Journal, access to Sugar Network data
in home directory and on mounted devices, caching images.

The developing process is just started, but I'm planing to present some
useful features in Sep. for Sugar Network deployment pilot in Peru.

To see how it looks right now, clone sources:

git clone git://git.sugarlabs.org/network/contributor-hub.git
cd contributor-hub
git submodule init
git submodule update

It will fetch Enyo submodules and network/client-js library created to
simplify access to Sugar Network for JS (but right now, only for Enyo2)
applications.

To launch application just open index.html from cloned root directory.


[5] http://git.sugarlabs.org/network/contributor-hub
[6] http://api-testing.network.sugarlabs.org/
[7] http://git.sugarlabs.org/network/client-js

-- 
Aleksey
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-09-01 Thread Aleksey Lim
On Sat, Sep 01, 2012 at 10:17:05AM +, Aleksey Lim wrote:
 Right now, I'm working on Sugar Network Contributor Hub application [5]
 that will be a place for people who need doing oriented interface and
 exactly low aged kids (in comparing thih sugar-network-webui).

Opps, s/exactly/who are not exactly/

-- 
Aleksey
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-09-01 Thread Aleksey Lim
On Sat, Aug 25, 2012 at 10:50:17PM +0200, lio...@olpc-france.org wrote:
  
 I think it's a good start to show what we could hope from this sort of
 integration and finally, to have more HTML5 developers writing or adapting
 activities to Sugar.

btw, are you thinking about creating something like sugar-toolkit.js
library to create cross-platform applications/sugar-activities?
If yes, whats the teargeting workflow, HTML5/JS/Web integration to sugar
shell itself (and activities) or writing pure JS activities.

For example, if I would be an activity developer, I will prefer
launching my application in many environments as possible (including
Android/WebIS/iOS/etc), e.g., from Sugar Shell and on Android after
downloading it from particular AppStore.

If you are thinking about the second option, Sugar Network might be a
direct analogy of AppStore to run real cross-platform activities. In
comparing with pure Python activities on Sugar Network (synchronized
from ASLO), the only thing that is required is a recent Web browser, ie,
it will work as-is on many platforms.

-- 
Aleksey
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-09-01 Thread lionel

Hi Aleksey,

 Right now, I'm working on Sugar Network Contributor Hub application [5]
that will be a place for people who need doing oriented interface and not
exactly
  low aged kids (in comparing thih sugar-network-webui). It is Enyo2 based
pure JS application.

Hmmm, very impressive. A really ambitious project.
My project is lot of easier comparatively.


 I'm following a bit differnt way. JS applcation is working with outer
world only using RESTful api. This api might provided by either Sugar
Network server[6]
 (and it is possible to run Hub applcation as-is even on Andriod) or local
sugar-network-service (and client side needs to have it launched). In the
last case, 
local service does extra work (providing it as RESTful api) like access to
Journal, access to Sugar Network data in home directory and on mounted
devices,
 caching images.

Wow, your diagram on the Sugar API Network Objects is very complete. And
accessing Sugar from REST commands is a very cool idea.
But of course, the service should have to be hosted and started before the
first app.


 The developing process is just started, but I'm planing to present some
useful features in Sep. for Sugar Network deployment pilot in Peru.

Great.


 btw, are you thinking about creating something like sugar-toolkit.js
library to create cross-platform applications/sugar-activities?
 If yes, whats the teargeting workflow, HTML5/JS/Web integration to sugar
shell itself (and activities) or writing pure JS activities.

No, having a cross platform library is not an objective for me (see below).



For example, if I would be an activity developer, I will prefer launching
my application in many environments as possible (including
Android/WebIS/iOS/etc), e.g.,
 from Sugar Shell and on Android after downloading it from particular
AppStore.

Yes, you're right. I'm a big fan of PhoneGap that allow easily writing cross
platform apps in this way.
BTW I'm convinced that we can't have a good level of integration in Sugar
with a cross platform framework. Lot of Sugar features are very specific
(Journal, Sharing, ...) and I don't think that a developer could fully adapt
its application to Sugar without a small amount of Python coding (10 to 15%
I guess). So, my idea is more to facilitate the conversion from HTML5/JS
than allowing development of a full Sugar application into JavaScript. It's
why I think more to an activity template as deliverable.


  Sugar Network might be a direct analogy of AppStore to run real
cross-platform activities. In comparing with pure Python activities on Sugar
Network
 (synchronized from ASLO), the only thing that is required is a recent Web
browser, ie, it will work as-is on many platforms.

It make me think to the future Windows 8 Windows Store (I'm also a Windows 8
developer). In the Windows Store you can find Metro Apps but you can find
also some Desktop (old-fashioned Windows) apps. Your Sugar Network apps are
like Metro apps. My templated-apps are like Desktop apps :-)

Lionel.

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-28 Thread lionel
 

Check the book cover.  It is the Read Activity showing the EPUB of the book
E-Book Enlightenment being read.  Note that the page layout is quite nice 

and includes fancy dropcaps and art that a Kindle or a Nook would make a
mess of or just ignore.  So maybe, just maybe, the Read Activity could
handle

 JavaScript in an EPUB as well.

 If you do Look inside the book you'll see that I had to reformat the
book to leave out the art and to use a large first letter instead of the
much nicer 

 dropcap.  The EPUB from archive.org has the original formatting.

Okay, it make sense.



So maybe instead of making custom wrappers for Activities that use HTML 5
and JS we could make non-standard EPUBs and accomplish much the same 

 thing.

Ok I see. I’m going to try to integrate Enyo in an EPUB.

Lionel.

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-27 Thread James Simmons
What it sounds like you could do is incorporate the ENYO framework into the
Read Activity, then make EPUB format books that include JavaScript.  Since
Read uses WebKit it already renders EPUB books created from web pages (like
those from Project Gutenberg) better than Nooks and Kindles do, and having
some JavaScript on the pages would be a natural thing to experiment with.

James Simmons

On Sun, Aug 26, 2012 at 3:34 PM, lio...@olpc-france.org wrote:


 Hi Edward,

 Thanks.

 Using my template in existing activity is easy. It just need a WebView
 Widget which encapsulate the WebKit browser.
 But, of course, it require Sugar 0.96 - Gtk3.
 Creating interactive tutorial could be a good idea because, with this
 framework, the HTML5 page could be notified when a Widget has changed or
 could launch an action on a Widget. So, it's basic for an interactive
 tutorial.
 I don't know for Scratch but AFAK, EToys is built with a very different
 approach than Sugar Python so I'm afraid it could not use in the same way.

 Best regards from France.

 Lionel.



 --

 Message: 3
 Date: Sat, 25 Aug 2012 18:11:54 -0400
 From: Edward Mokurai Cherlin moku...@sugarlabs.org
 To: Sugar Devel sugar-devel@lists.sugarlabs.org
 Subject: [Sugar-devel]  Sugar Activity template for HTML5/Enyo
 Message-ID:
 
 cadmpiaaokhd-4skfbmnvm7wba1bqqonax9xrfdqfoylzzcp...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Excellent. I have been wanting a way to use HTML5 with various Sugar
 activities in the Replacing Textbooks program, both to write
 interactive tutorials on the activities, and to write subject-matter
 materials incorporating Sugar. Can you see how to do this? Can we
 adapt existing activities in Python and other languages to work with
 your template? What would it take to link to Etoys and Scratch, as the
 next language extension?


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-27 Thread Gonzalo Odiard
I don't understand the relation.
We already use webkit, then, we can use play javascript if needed.
I think epub2 standard does not allow javascript, I don't know epub3

Gonzalo

On Mon, Aug 27, 2012 at 1:39 PM, James Simmons nices...@gmail.com wrote:

 What it sounds like you could do is incorporate the ENYO framework into
 the Read Activity, then make EPUB format books that include JavaScript.
 Since Read uses WebKit it already renders EPUB books created from web pages
 (like those from Project Gutenberg) better than Nooks and Kindles do, and
 having some JavaScript on the pages would be a natural thing to experiment
 with.

 James Simmons
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-27 Thread James Simmons
Gonzalo,

WebKit can do things that EPUB would not normally allow.  Project Gutenberg
makes EPUBs by taking the hand crafted web page and putting it in a Zip
file with some XML files.  On Read it looks just like the original web
page.  On a Kindle it might look just awful.

I don't know if the ENYO framework is entirely JavaScript (in which case it
could be included in the EPUB) or if it has some non-JS portions.  It
sounded to me like it did.  Those portions would need to be added to Read.

James Simmons


On Mon, Aug 27, 2012 at 12:27 PM, Gonzalo Odiard gonz...@laptop.org wrote:

 I don't understand the relation.
 We already use webkit, then, we can use play javascript if needed.
 I think epub2 standard does not allow javascript, I don't know epub3

 Gonzalo


 On Mon, Aug 27, 2012 at 1:39 PM, James Simmons nices...@gmail.com wrote:

 What it sounds like you could do is incorporate the ENYO framework into
 the Read Activity, then make EPUB format books that include JavaScript.
 Since Read uses WebKit it already renders EPUB books created from web pages
 (like those from Project Gutenberg) better than Nooks and Kindles do, and
 having some JavaScript on the pages would be a natural thing to experiment
 with.

 James Simmons


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-27 Thread lionel
 

Hi James,

 

I didn’t know that EPUB format could include JavaScript.

Enyo is fully in JavaScript/CSS. So it should be include in an EPUB.

BTW, I’m not sure to understand what could be done with this sort of
integration and the template.

 

Lionel.

 

 

De : James Simmons [mailto:nices...@gmail.com] 
Envoyé : lundi 27 août 2012 20:52
À : Gonzalo Odiard
Cc : lio...@olpc-france.org; sugar-devel@lists.sugarlabs.org
Objet : Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

 

Gonzalo,

WebKit can do things that EPUB would not normally allow.  Project Gutenberg
makes EPUBs by taking the hand crafted web page and putting it in a Zip file
with some XML files.  On Read it looks just like the original web page.  On
a Kindle it might look just awful.

I don't know if the ENYO framework is entirely JavaScript (in which case it
could be included in the EPUB) or if it has some non-JS portions.  It
sounded to me like it did.  Those portions would need to be added to Read.

James Simmons



On Mon, Aug 27, 2012 at 12:27 PM, Gonzalo Odiard gonz...@laptop.org wrote:

I don't understand the relation.

We already use webkit, then, we can use play javascript if needed.

I think epub2 standard does not allow javascript, I don't know epub3

 

Gonzalo 

 

On Mon, Aug 27, 2012 at 1:39 PM, James Simmons nices...@gmail.com wrote:

What it sounds like you could do is incorporate the ENYO framework into the
Read Activity, then make EPUB format books that include JavaScript.  Since
Read uses WebKit it already renders EPUB books created from web pages (like
those from Project Gutenberg) better than Nooks and Kindles do, and having
some JavaScript on the pages would be a natural thing to experiment with.

James Simmons

 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-27 Thread James Simmons
Lionel,

Your post reminded me of a VERY old post by Sayamindu Dasgupta:

http://sayamindu.randomink.org/ramblings/

He talks about doing things with EPUB format to make more interactive
books.  He doesn't specifically mention JavaScript.

What got me thinking is this:

http://www.amazon.com/E-Book-Enlightenment-ebook/dp/B005BYST5I/ref=sr_1_1?s=digital-textie=UTF8qid=1346102690sr=1-1keywords=e-book+enlightenment

Check the book cover.  It is the Read Activity showing the EPUB of the book
E-Book Enlightenment being read.  Note that the page layout is quite nice
and includes fancy dropcaps and art that a Kindle or a Nook would make a
mess of or just ignore.  So maybe, just maybe, the Read Activity could
handle JavaScript in an EPUB as well.

If you do Look inside the book you'll see that I had to reformat the book
to leave out the art and to use a large first letter instead of the much
nicer dropcap.  The EPUB from archive.org has the original formatting.

So maybe instead of making custom wrappers for Activities that use HTML 5
and JS we could make non-standard EPUBs and accomplish much the same thing.

James Simmons


On Mon, Aug 27, 2012 at 2:40 PM, lio...@olpc-france.org wrote:

 ** **

 Hi James,

 ** **

 I didn’t know that EPUB format could include JavaScript.

 Enyo is fully in JavaScript/CSS. So it should be include in an EPUB.

 BTW, I’m not sure to understand what could be done with this sort of
 integration and the template.

 ** **

 Lionel.

 ** **

 ** **

 *De :* James Simmons [mailto:nices...@gmail.com]
 *Envoyé :* lundi 27 août 2012 20:52
 *À :* Gonzalo Odiard
 *Cc :* lio...@olpc-france.org; sugar-devel@lists.sugarlabs.org
 *Objet :* Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

 ** **

 Gonzalo,

 WebKit can do things that EPUB would not normally allow.  Project
 Gutenberg makes EPUBs by taking the hand crafted web page and putting it in
 a Zip file with some XML files.  On Read it looks just like the original
 web page.  On a Kindle it might look just awful.

 I don't know if the ENYO framework is entirely JavaScript (in which case
 it could be included in the EPUB) or if it has some non-JS portions.  It
 sounded to me like it did.  Those portions would need to be added to Read.

 James Simmons

 

 On Mon, Aug 27, 2012 at 12:27 PM, Gonzalo Odiard gonz...@laptop.org
 wrote:

 I don't understand the relation.

 We already use webkit, then, we can use play javascript if needed.

 I think epub2 standard does not allow javascript, I don't know epub3

 ** **

 Gonzalo 

 ** **

 On Mon, Aug 27, 2012 at 1:39 PM, James Simmons nices...@gmail.com wrote:
 

 What it sounds like you could do is incorporate the ENYO framework into
 the Read Activity, then make EPUB format books that include JavaScript.
 Since Read uses WebKit it already renders EPUB books created from web pages
 (like those from Project Gutenberg) better than Nooks and Kindles do, and
 having some JavaScript on the pages would be a natural thing to experiment
 with.

 James Simmons

 ** **

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-26 Thread lionel

Hi Sebastien,

Thanks.

Very interesting indeed your WebUI.

I know Flask, we use the same architecture for the Nutrino activity [1] we
develop with Danone.
BTW I'm not fully satisfy by this, I find it too complex (3 tiers in the
same activity: Python Sugar, HTML/JavaScript, Python Flask) and of course,
due to Gtk2, the support of HTML5 feature is very poor. 
But you're right, 0.94 and lower are the most deployed version of Sugar
today. Like you, we deployed 0.94 to our Malagasy deployment only this year.

Best regards from France.

Lionel.

[1]
http://www.dailymotion.com/video/xm2zmd_olpc-france-presenting-a-sugar-activ
ity-about-nutrition-at-the-2-sugarcamp-in-paris_tech 

-Message d'origine-
De : Sebastian Silva [mailto:sebast...@fuentelibre.org] De la part de
Sebastian Silva
Envoyé : dimanche 26 août 2012 00:09
À : lio...@olpc-france.org
Cc : sugar-devel@lists.sugarlabs.org
Objet : Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

Hi Lionel,
Congratulations!
This is a great idea. My own efforts in this area [0] have involved
integrating a webapp microframework (Flask). Our team is working on a more
complex ajax-webapp  with this approach [1] for the Sugar Network WebUI.
Alsroot and I have been discussing Enyo as a foundation for further
work and it does look very useful indeed.
I'm still running gtk2 version of sugar (0.94) because that is what
we will have deployed in the field thruout 2013. Therefore I couldn't try it
but I will take a look at the code for ideas.
Regards,
Sebastian

[0]
http://lists.sugarlabs.org/archive/sugar-desarrollo/2011-July/000107.html
[1] http://wiki.sugarlabs.org/go/Platform_Team/Sugar_Network/Web_UI


--
Sebastian Silva sebast...@somosazucar.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-26 Thread Manuel Quiñones
2012/8/25  lio...@olpc-france.org:


 Hi all,



 I've enhanced the work of Manuel Quinones to create an activity template
 using Enyo JavaScript Framework.



 My objective was to provide a template to write a Sugar activity using HTML5
 but without losing advantage of the Sugar integration. Plus, I didn't want
 using a HTTP Server integrated into the activity like in the Wikipedia
 activity.



 Finally, using some WebKit tips  tricks (calling a JavaScript in the
 current page and console message handling), I finally conceived a simple
 framework that allow bi-directional communication between Python code and
 JavaScript code (using Enyo Framework). You could find the resulting source
 code from this framework here [1] for Python and here [2] for JavaScript.



 To test this framework, I wrote a sample activity (downloadable here [3])
 with a part of the activity wrote in HTML5 and the other part wrote in
 Python. I've illustrated the power of this framework with few features:

 - Sending basic type or full python object to JavaScript,

 - Sending basic type or full JavaScript object to Python,

 - JavaScript Enyo controls (Checkbox and Slider) synchronized with matching
 Gtk control,

 - Passing of Sugar context (buddy nickname and color) to JavaScript,

 - Using Sugar toolbar to launch JavaScript event,

 - Handling a HTML5 canvas (a small Logo Turtle ;-) from Gtk button.

 A screen capture of the activity is visible here [4].



 I think it's a good start to show what we could hope from this sort of
 integration and finally, to have more HTML5 developers writing or adapting
 activities to Sugar.


Wow Lionel, impressive advance!

 Lot of thing could be done to enhance this basic framework. I hope to have
 time to write a real activity to work on some other interesting stuff:

 - Read/Write from Sugar Journal from JavaScript

 - Use POT localization for HTML5 resource

 - Using Sugar presence from JavaScript


- have a Enyo theme similar to the one in Sugar?

Keep the good work :)

-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar Activity template for HTML5/Enyo

2012-08-25 Thread Sebastian Silva
Hi Lionel,
Congratulations!
This is a great idea. My own efforts in this area [0] have involved 
integrating a webapp microframework (Flask). Our team is working on a more 
complex ajax-webapp  with this approach [1] for the Sugar Network WebUI.
Alsroot and I have been discussing Enyo as a foundation for further
work and it does look very useful indeed.
I'm still running gtk2 version of sugar (0.94) because that is what
we will have deployed in the field thruout 2013. Therefore I couldn't try it
but I will take a look at the code for ideas.
Regards,
Sebastian

[0] http://lists.sugarlabs.org/archive/sugar-desarrollo/2011-July/000107.html
[1] http://wiki.sugarlabs.org/go/Platform_Team/Sugar_Network/Web_UI

On Sat, 25 Aug 2012 22:50:17 +0200
lio...@olpc-france.org wrote:

  
 
 Hi all,
 
  
 
 I've enhanced the work of Manuel Quinones to create an activity template
 using Enyo JavaScript Framework.
 
  
 
 My objective was to provide a template to write a Sugar activity using HTML5
 but without losing advantage of the Sugar integration. Plus, I didn't want
 using a HTTP Server integrated into the activity like in the Wikipedia
 activity.
 
  
 
 Finally, using some WebKit tips  tricks (calling a JavaScript in the
 current page and console message handling), I finally conceived a simple
 framework that allow bi-directional communication between Python code and
 JavaScript code (using Enyo Framework). You could find the resulting source
 code from this framework here [1] for Python and here [2] for JavaScript.
 
  
 
 To test this framework, I wrote a sample activity (downloadable here [3])
 with a part of the activity wrote in HTML5 and the other part wrote in
 Python. I've illustrated the power of this framework with few features:
 
 - Sending basic type or full python object to JavaScript,
 
 - Sending basic type or full JavaScript object to Python,
 
 - JavaScript Enyo controls (Checkbox and Slider) synchronized with matching
 Gtk control,
 
 - Passing of Sugar context (buddy nickname and color) to JavaScript,
 
 - Using Sugar toolbar to launch JavaScript event,
 
 - Handling a HTML5 canvas (a small Logo Turtle ;-) from Gtk button.
 
 A screen capture of the activity is visible here [4].
 
  
 
 I think it's a good start to show what we could hope from this sort of
 integration and finally, to have more HTML5 developers writing or adapting
 activities to Sugar.
 
  
 
 Lot of thing could be done to enhance this basic framework. I hope to have
 time to write a real activity to work on some other interesting stuff:
 
 - Read/Write from Sugar Journal from JavaScript
 
 - Use POT localization for HTML5 resource
 
 - Using Sugar presence from JavaScript
 
 - ...
 
  
 
 Hope that some of you could be interested by this.
 
  
 
 Best regards from France.
 
  
 
Lionel.
 
  
 
  
 
 [1]
 http://git.sugarlabs.org/enyo-activity/enyo-activity/blobs/master/enyo.py
 http://git.sugarlabs.org/enyo-activity/enyo-activity/blobs/master/enyo.py
 
 [2]
 http://git.sugarlabs.org/enyo-activity/enyo-activity/blobs/master/html/suga
 r.js
 http://git.sugarlabs.org/enyo-activity/enyo-activity/blobs/master/html/sugar
 .js
 
 [3]  http://olpc-france.org/download/enyo-1.xo
 http://olpc-france.org/download/enyo-1.xo
 
 [4]  http://olpc-france.org/download/enyo-1_capture.png
 http://olpc-france.org/download/enyo-1_capture.png
 
  
 


-- 
Sebastian Silva sebast...@somosazucar.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel