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