<div dir="ltr">Hi Lionel,<div><br><div style>The page which you created summarizing the work plan for HTML activities was very helpful in preparing my proposal.</div><div style>I've submitted the first draft of my proposal. </div>
<div style>Kindly go through it and help me improve the same.</div><div style><br></div><div style>Please note that, I'm yet to post links to my work in my proposal. </div><div style>I'll be pushing all of it to github tomorrow and updating my proposal.</div>
<div style>Yet to setup the development environment too.</div><div style><br></div><div style>Thanks,</div><div style>Suraj</div><div style><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 22, 2013 at 1:32 AM, <span dir="ltr"><<a href="mailto:lionel@olpc-france.org" target="_blank">lionel@olpc-france.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="FR" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Suraj,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">1) I’m used to develop using VirtualBox and Windows. But you’re right, it need a powerful PC. Note that if you switch to GNU Linux, it could be better to switch to Fedora instead of Ubuntu because Sugar is built on Fedora.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">2) Nice. It’s a good start point.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">3) Yes, a good understanding of interface between Python/Sugar and JavaScript is very important. BTW do not spent lot of time on Enyo. In fact Enyo is not at all a pre-requisite. At end we could hope to be JavaScript framework agnostic. If you follow threads in this mailing list, you could have enough lucky like me to learn a new JavaScript framework each day :-) So yes, being JavaScript framework agnostic is interesting.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The issue about “console” is that the “console-message” is standardly use to get output from the “console.log()” JavaScript function. So, it’s not at all dedicated to communication between JavaScript and the embedding WebView. The hack that I’ve used it that if the console message is prefixed by “enyo://” it’s processed by the framework like a message to Sugar, else the framework just pass the message. You could see this in the “Log” activity when you run Grid paint activity. So the idea of improvement is to find a less hacky way to interface Sugar and JavaScript. It’s one of objective of the IRC meeting.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">About UI, yes the main part of the work is to do CSS files to reproduce the Sugar UI. Then for non-UI Sugar features (datastore and collaboration) the work is to write a JavaScript API to map the Sugar API.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Best regards.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> Lionel.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">De :</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> suraj ks [mailto:<a href="mailto:suraj.gillespie@gmail.com" target="_blank">suraj.gillespie@gmail.com</a>] <br>
<b>Envoyé :</b> samedi 20 avril 2013 23:26<br><b>À :</b> <a href="mailto:lionel@olpc-france.org" target="_blank">lionel@olpc-france.org</a><br><b>Cc :</b> Sugar-dev </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Devel; Manuel Quiñones; Daniel Narvaez</span></p>
<div><div class="h5"><br><b>Objet :</b> Re: [Sugar-devel] Hacking on HTML activities UI (was Re: GSoC 13)<u></u><u></u></div></div><p></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">
Hi lionel,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">1)Done with setting up of virtual box and installed sugar. Seems to be working fine.<u></u><u></u></p></div><div><p class="MsoNormal">
But, while running the Sugar in it, it slows down the pc a lot and various other issues come in while developing activities.<u></u><u></u></p></div><div><p class="MsoNormal"> I guess it is better if I switch to Ubuntu asap while hacking.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"> 2)It was a good read . Now, I have a basic understanding how activities are developed and packed right from<u></u><u></u></p></div><div>
<p class="MsoNormal"> making a standalone python program to packaging and distributing the activities.<u></u><u></u></p></div><div><p class="MsoNormal"> I did install the helloworld activity and it seems to working fine.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"> 3)I must admit, it is impressive work. <u></u><u></u></p></div><div><p class="MsoNormal"> Went through your manual and understood how the enyo framework alongwith,"connect" and "sendmessage" methods were used to interact between the user interface, javascript and python code<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I needed some clarifications,<u></u><u></u></p>
</div><div><p class="MsoNormal">Honestly, i did not grasp the "console part", which needed improvement. <u></u><u></u></p></div><div><p class="MsoNormal">Were you talking about the "connect" and "sendmessage"?<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">And, regarding the UI part, should I just create CSS files to replicate default sugar toolbars and other sugar user interfaces? <u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">
<u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Also, looking forward to the IRC meeting on html activities on Mon. :)<u></u><u></u></p></div><div><p class="MsoNormal">
<u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Regards,<u></u><u></u></p>
</div><div><p class="MsoNormal">Suraj<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><div><p class="MsoNormal">On Tue, Apr 16, 2013 at 6:51 PM, <<a href="mailto:lionel@olpc-france.org" target="_blank">lionel@olpc-france.org</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Hi Suraj,</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">To initialize your knowledge about the project, I can suggest you several steps:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">First, install Sugar on your computer. I understand that you're on Windows but it's pretty easy to install SugarOnAStick in a Windows VirtualBox. It's a good way to discover it. Have a look on [1] (in French but easy to translate or follow steps using screen capture). </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Second, learn how Sugar activity are developed and packaged today. The better introduction about that is in the great book of James, "Make your own Sugar activities" [2]. It will be very interesting for you too to install and explore the HelloWorld Activity [3] in your VirtualBox.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Third, explore the first experience of Sugar HTML5 activities I've wrote. A chapter in the book "Make your own Sugar activities" talk about that [4]. Gridpaint [5] is one of the first activity to use this framework. Install it and try to understand how it works: have specifically a look on Log (using Log activity) then to Enyo.py and Sugar.js files.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Once you've done it, there is few issue with the current way of works of this first Sugar HTML5 framework:</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:27.0pt;vertical-align:middle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">1.</span><span lang="EN-US" style="font-size:7.0pt"> </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">It depends on "console-message" to interface WebKit and JavaScript. It's a bad hack. This message could be deprecated on future version of WebKit. We should work one another interface. Exploring PhoneGap/Cordoba way of working for iOS (using a hidden Iframe) could be interesting.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:27.0pt;vertical-align:middle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">2.</span><span lang="EN-US" style="font-size:7.0pt"> </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">It depends of the standard Sugar Toolbar and HTML5 controls don't have the Sugar Look&Feel. We want integrate the full Sugar UI into the Sugar HTML5 framework. So we need CSS files and an API to match the Sugar controls and features.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:27.0pt;vertical-align:middle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">3.</span><span lang="EN-US" style="font-size:7.0pt"> </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">It don't expose the Sugar feature into JavaScript. So each time the HTML5 application want to call Sugar, it need to call Python code. The Sugar HTML5 framework should expose natively main Sugar features: specifically DataStore (read/write to Journal), telepathy (Collaboration).</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:27.0pt;vertical-align:middle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">4.</span><span lang="EN-US" style="font-size:7.0pt"> </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Finally, as you read in this thread, embedding a WebView is not necessarily the best solution to write a Web activity. BTW as a first approach to the problem, we could start with it.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Point 2 could be started very quickly. You just had to list all Sugar Controls then think how they could be designed as HTML5 controls.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal" style="margin-left:27.0pt"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Lionel.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:27.0pt"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[1] </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://olpc-france.org/blog/2013/02/decouvrez-sugar-depuis-votre-machine/" target="_blank"><span lang="EN-US">http://olpc-france.org/blog/2013/02/decouvrez-sugar-depuis-votre-machine/</span></a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[2] </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.flossmanuals.net/make-your-own-sugar-activities/" target="_blank"><span lang="EN-US">http://www.flossmanuals.net/make-your-own-sugar-activities/</span></a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[3] </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://activities.sugarlabs.org/fr/sugar/addon/4418" target="_blank"><span lang="EN-US">http://activities.sugarlabs.org/fr/sugar/addon/4418</span></a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[4] </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://en.flossmanuals.net/make-your-own-sugar-activities/developing-sugar-activities-using-html5/" target="_blank"><span lang="EN-US">http://en.flossmanuals.net/make-your-own-sugar-activities/developing-sugar-activities-using-html5/</span></a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[5] </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://activities.sugarlabs.org/fr/sugar/addon/4647" target="_blank"><span lang="EN-US">http://activities.sugarlabs.org/fr/sugar/addon/4647</span></a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> suraj ks [mailto:<a href="mailto:suraj.gillespie@gmail.com" target="_blank">suraj.gillespie@gmail.com</a>] <br>
<b>Envoyé :</b> lundi 15 avril 2013 22:27<br><b>À :</b> Daniel Narvaez; <a href="mailto:lionel@olpc-france.org" target="_blank">lionel@olpc-france.org</a><br><b>Cc :</b> Sugar-dev Devel; Manuel Quiñones<br><b>Objet :</b> Re: [Sugar-devel] Hacking on HTML activities UI (was Re: GSoC 13)</span><u></u><u></u></p>
<div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal">Ok,<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal">In a nutshell,<u></u><u></u></p><div><p class="MsoNormal">
These are the tasks for this project.<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Going by the way Lionel suggested,<u></u><u></u></p></div><div><p class="MsoNormal">
Create a sugar activity with full screen web view control.<u></u><u></u></p><div><p class="MsoNormal">Modify the current js framework and make use of "native features" to be able to write html activities in Sugar.<u></u><u></u></p>
</div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Lionel mentioned,<u></u><u></u></p></div><div><pre style="white-space:pre-wrap">"The step 1 need only to map a set of JavaScript<u></u><u></u></pre>
<pre>functions to a set of Sugar functions. Once the list of Sugar functions is<u></u><u></u></pre><pre>write, it’s not very complex to do."<u></u><u></u></pre><pre style="white-space:pre-wrap"><u></u> <u></u></pre><pre style="margin-bottom:12.0pt">
<span style="font-family:"Arial","sans-serif";color:#222222">So find those functions and tweak them to support the same.</span><u></u><u></u></pre></div><div><p class="MsoNormal">And of course, work on the UI part.<u></u><u></u></p>
</div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Please correct if I'm wrong.<u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">
Also, how are we going to get the JS and Sugar to communicate without the console?<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div></div>
</div></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div>