<div dir="ltr"><div><br>Sir,</div>
<div>&nbsp;</div>
<div>&nbsp; There are some toolbar updates from my side, but I have not finalised them yet, as it requires some changes in the socialcalc.js file. So, it cannot&nbsp;be included in the testing this time. Sorry for the delay.</div>

<div>&nbsp;</div>
<div>Regards</div>
<div>Preeti<br></div>
<div class="gmail_quote">On Mon, Sep 8, 2008 at 5:42 AM, Samuel Klein <span dir="ltr">&lt;<a href="mailto:sj@laptop.org">sj@laptop.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">we&#39;re testing activities this week, and should include socialcalc in<br>the tests -- pretti, any updates from your end we should know about?<br>
and is socialcalc a real olpc list? &nbsp;&lt;looks&gt; &nbsp;hmm, we do have a lot of<br>them :-)<br><br>SJ<br>
<div>
<div></div>
<div class="Wj3C7c"><br>On Fri, Aug 22, 2008 at 5:12 AM, Preeti KS &lt;<a href="mailto:kspreeti.13@gmail.com">kspreeti.13@gmail.com</a>&gt; wrote:<br>&gt; Luke<br>&gt;<br>&gt; Thanks for the reply..I&#39;ll definitely go through all the codes of the<br>
&gt; OnePageWiki Activity. Infact, when I first started studying xocom, I used<br>&gt; the code of OnePageWiki Activity, because of its simple, yet innovative<br>&gt; effort.<br>&gt; I have uploaded the code on the wiki page, but the code repository idea<br>
&gt; sounds better. I will definitely look into that, after monday..In the<br>&gt; meantime, I will check out the codes suggested by you.<br>&gt;<br>&gt; Thanks again!<br>&gt; Cheers<br>&gt; Preeti<br>&gt;<br>&gt; On Fri, Aug 22, 2008 at 1:40 PM, Luke Closs &lt;<a href="mailto:luke.closs@socialtext.com">luke.closs@socialtext.com</a>&gt;<br>
&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Preeti,<br>&gt;&gt;<br>&gt;&gt; Thank you for this informative email. &nbsp;I&#39;m glad to see you made some<br>&gt;&gt; progress.<br>&gt;&gt;<br>&gt;&gt; I&#39;ve got several ideas about how to further extend xocom so that it is<br>
&gt;&gt; easy for the python toolbar to call javascript hooks by applications like<br>&gt;&gt; this. &nbsp;As you can see in this file:<br>&gt;&gt;<br>&gt;&gt; &nbsp;<a href="http://github.com/lukec/onepagewiki/tree/master/OnePageWikiActivity.py" target="_blank">http://github.com/lukec/onepagewiki/tree/master/OnePageWikiActivity.py</a><br>
&gt;&gt;<br>&gt;&gt; Once you have xocom set up, you can call javascript methods from python<br>&gt;&gt; like this:<br>&gt;&gt;<br>&gt;&gt; &nbsp;self.xocom.send_to_browser( &#39;command&#39; )<br>&gt;&gt;<br>&gt;&gt; The OnePageWiki Activity[1] and the socialcalc activity use the &#39;read&#39; and<br>
&gt;&gt; &#39;write&#39; commands to cause the Socialcalc javascript to load or save a sheet.<br>&gt;&gt; &nbsp;We should be able to hook up other commands, by providing javascript hooks<br>&gt;&gt; to call.<br>&gt;&gt;<br>&gt;&gt; If you look at this example xocom HTML page, you can see how you&#39;d provide<br>
&gt;&gt; new hooks:<br>&gt;&gt;<br>&gt;&gt; &nbsp;<a href="http://github.com/lukec/xocom/tree/master/web/index.html" target="_blank">http://github.com/lukec/xocom/tree/master/web/index.html</a><br>&gt;&gt;<br>&gt;&gt; This is how Socialcalc&#39;s index.html provides the read and write commands:<br>
&gt;&gt;<br>&gt;&gt; &nbsp;<a href="http://github.com/lukec/socialcalc-xocom/tree/master/web/index.html#L110" target="_blank">http://github.com/lukec/socialcalc-xocom/tree/master/web/index.html#L110</a><br>&gt;&gt;<br>&gt;&gt; Preeti, I would love to see you submitting code somewhere. &nbsp;Are we using a<br>
&gt;&gt; public git repo? &nbsp;Feel free to fork my socialcalc-xocom[2] project (you can<br>&gt;&gt; sign up for github for free code hosting, it&#39;s great). &nbsp;Once you fork that<br>&gt;&gt; project, you can add your new toolbar code into your repo, and then we can<br>
&gt;&gt; share the code easier. &nbsp;I&#39;ll be happy to review your commits to hook this<br>&gt;&gt; stuff together. &nbsp;You&#39;re really close, I think.<br>&gt;&gt;<br>&gt;&gt; Cheers,<br>&gt;&gt; Luke<br>&gt;&gt;<br>&gt;&gt; P.S. - I&#39;m usually in #socialtext or #vhs on <a href="http://irc.freenode.net/" target="_blank">irc.freenode.net</a> if you&#39;d<br>
&gt;&gt; like to chat.<br>&gt;&gt;<br>&gt;&gt; [1] <a href="http://github.com/lukec/onepagewiki/tree/master" target="_blank">http://github.com/lukec/onepagewiki/tree/master</a><br>&gt;&gt; [2] <a href="http://github.com/lukec/socialcalc-xocom/tree/master" target="_blank">http://github.com/lukec/socialcalc-xocom/tree/master</a><br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; On 22-Aug-08, at 12:03 AM, Preeti KS wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; &nbsp; &nbsp;Long time since there&#39;s been activity on this group. I thought I will<br>&gt;&gt;&gt; initiate something. I have been a wee bit busy with other things, and was<br>
&gt;&gt;&gt; not in Delhi for a while. But, I did manage to do some testing for<br>&gt;&gt;&gt; SocialCalc.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; The good news is that xocom is working perfectly. Infact, I have been<br>&gt;&gt;&gt; working on making the toolbar.py file for the release of this activity.<br>
&gt;&gt;&gt; While on it, I have made extensive use of xocom. I made the toolbar in<br>&gt;&gt;&gt; Python, and used xocom to create the webview,etc. I also managed to<br>&gt;&gt;&gt; interface the toolbar.py file with the socialcalc.py file. I have attached<br>
&gt;&gt;&gt; the relevent files with this email and also at<br>&gt;&gt;&gt; <a href="http://wiki.laptop.org/go/Image:SocialCalc-toolbar.zip" target="_blank">http://wiki.laptop.org/go/Image:SocialCalc-toolbar.zip</a> .<br>
&gt;&gt;&gt; I had mailed earlier with some doubts, some of which actually got cleared<br>&gt;&gt;&gt; when I studied the toolbars of other activities. I thought you might be<br>&gt;&gt;&gt; interested to know exactly how xocom is used in the toolbar. In activities<br>
&gt;&gt;&gt; like &quot;Abiword&quot; I noticed that the web view, etc are created using hulahop<br>&gt;&gt;&gt; and webview. As xocom has defined webviews, I have created a class<br>&gt;&gt;&gt; SpredSheetActivityToolbar that uses xocom to create webviews. My toolbar.py<br>
&gt;&gt;&gt; file is as follows, these are some code snippets:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; This is the main spreadsheet activity toolbar, It has used xocom to<br>&gt;&gt;&gt; create the webview..<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; class SpreadSheetActivityToolbar:<br>
&gt;&gt;&gt; &nbsp; &nbsp;def __init__(self, activity, toolbox, self_canvas):<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self._activity = activity<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self.set_canvas( xocom.create_webview() )<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self._activity_toolbar = toolbox.get_activity_toolbar()<br>
&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self._keep_palette = self._activity_toolbar.keep.get_palette()<br>&gt;&gt;&gt; .........................<br>&gt;&gt;&gt; Then, I have created another class, for the edit toolbar. Its definition<br>&gt;&gt;&gt; is as follows:<br>
&gt;&gt;&gt; class SpreadsheetEditToolbar(EditToolbar):<br>&gt;&gt;&gt; &nbsp; &nbsp;def __init__(self, toolbox, self_canvas):<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;EditToolbar.__init__(self)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self.set_canvas( xocom.create_webview() )<br>
&gt;&gt;&gt; .........<br>&gt;&gt;&gt; This is followed by the general definition of edit toolbar,<br>&gt;&gt;&gt; copy,paste,undo,redo, etc. There is also a viewtoolbar class, for viewing it<br>&gt;&gt;&gt; on hulahoop.<br>
&gt;&gt;&gt; Then of course, I had to make changes in the SOcialCalc.py file in order<br>&gt;&gt;&gt; to call this toolbar interface. Here are the details of the SocialCalc.py<br>&gt;&gt;&gt; file:<br>&gt;&gt;&gt; To interface it with toolbar.py, I have imported the classes from this<br>
&gt;&gt;&gt; file as:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; import toolbar<br>&gt;&gt;&gt; from toolbar import SpreadSheetActivityToolbar, SpreadsheetEditToolbar,<br>&gt;&gt;&gt; ViewToolbar<br>&gt;&gt;&gt; Then, while creating the toolbar, I have called these functions as:<br>
&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;toolbox = activity.ActivityToolbox(self)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self.set_toolbox(toolbox)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;toolbox.show()<br>&gt;&gt;&gt; Separately calling edit toolbar:<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;self._edit_toolbar = SpreadsheetEditToolbar(self,<br>
&gt;&gt;&gt; self._edit_toolbar, set_canvas)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;toolbox.add_toolbar(_(&#39;Edit&#39;),self._edit_toolbar)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self._edit_toolbar.show()<br>&gt;&gt;&gt; And similarly calling the Viewtoolbar class:<br>
&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;view_toolbar = ViewToolbar (self.set_canvas)<br>&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;self.set_canvas.show()<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I had a lot of fun doing this integration work. I am facing a few<br>&gt;&gt;&gt; problems dealing with the Javascript aspect of this whole activity, but to<br>
&gt;&gt;&gt; deal with that I am studying JS in detail. So still an advantage. I hope you<br>&gt;&gt;&gt; all will be helping me out with the queries!<br>&gt;&gt;&gt; Apart from that, I also tested the new build for various simulated<br>
&gt;&gt;&gt; situations. I have taken snapshots of the same. But due to problems in my<br>&gt;&gt;&gt; net connection, they are not getting attached. I will definitely mail them<br>&gt;&gt;&gt; by Monday.<br>&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks and warm regards,<br>&gt;&gt;&gt; Preeti<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br></div></div></blockquote></div><br></div>