On Thu, Jul 30, 2009 at 10:51 PM, William Stein<wst...@gmail.com> wrote:
>
>
> On Thu, Jul 30, 2009 at 9:43 PM, Ondrej Certik <ond...@certik.cz> wrote:
>>
>> Hi,
>>
>> so I fixed most of the early bugs, here is my latest attempt:
>>
>> http://4.latest.pythonnb.appspot.com/
>>
>> it seems to be working reasonably well in most browsers I tried (FF,
>> IE, Safari, Opera, Chrome, ...).
>>
>>
>> Opera can't handle event.preventDefault(), which means that if you
>> press shift+enter, the enter will still get propagated and the new
>> cell will have 2 rows. I think it's a bug in Opera, but maybe there is
>> some fix for this. All other browsers seem to work for me.
>
> I don't think we support Opera in Sage either, by the way.  We used to,
> maybe, but even when we did it just felt so *SLOW* to render javascript that
> it wasn't really worth using so much.  I actually used Opera as my main
> browser for years, but Firefox is definitely ahead now, in most ways.
>
>>
>> It's not as polished as my original javascript version:
>>
>> http://pythonnb.appspot.com/
>>
>> e.g. the evaluate button is not there, and the blue line is not there
>> yet either, neither is the blue focus rectangle around cells. I will
>> not have time for the next month or so to work on this, but I am now
>> confident that it can be done.
>
> It's really surprising to me that some of those things get messed up by
> switching to pyjamas.  When I look at your pyjamas version with firefox 3 on
> OS X, I *do* see the blue bar, but it is in the wrong place, about an "em"
> too high.

It's because in pyjamas I am using some pyjamas widget (I think
RootPanel) that adds <div> after each element, thus the spacing gets
wrong. To fix this, one just has to persuade pyjamas not to put any
<div> in the html output and then it should be ok.

But all these CSS style things always take me couple hours to fix, so
I'll just leave it as is. It convinced me that it can be done, so
that's all I wanted to know.

>
>>
>> Look at the code here, that gets translated to javascript:
>>
>>
>> http://github.com/certik/notebook/blob/ef396ef2eb3314ff787000cac7e34b1c08d9af6a/media/index.py
>>
>> It's all pure python and with pyjamas desktop it should be possible to
>> run it on the desktop, e.g. in a python interpreter. I think in the
>> long term, this is the way to go.
>>
>> Pyjamas is still developing, e.g. I contributed the initial urllib
>> package into it (the index.py file above still contains my older hack,
>> that calls javascript --- with new pyjamas, this is not needed
>> anymore), etc.
>>
>> Anyway, I am looking forward, I think in couple years it will be
>> absolutely common thing to have sophisticated web applications and we
>> could write them in Python.
>
> Nice.  I have to say honestly that the idea of using pyjamas is the only
> thing I've ever seen that made me personally have that feeling "I want to
> rewrite the javascript part of the notebook".  I'm really glad you did a
> prototype of this so we could see what some of the issues are.

I forgot how I got the idea to rewrite it, I think I just wanted to
learn AJAX, so the best thing to learn it is to write it myself from
scratch.

But if I am going to write some new webapp from scratch, I am going to
use pyjamas. For Sage notebook though, we may just continue improving
the current one, as I am not much a fan of rewriting applications from
scratch.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to