There was another request on sage-edu for a nice way to edit text cells
in the notebook. Patches which enable a very nice in-place wysiwyg
editor for text cells are sitting on trac waiting to be reviewed. Some
people have reviewed them and found them to work well. I'm not sure how
much review is needed before they pass the test and are merged (the
patches touch a lot of notebook and javascript code). If anyone can
test them, I'm pleading for more reviews (at least, I think that's the
stage they are stuck at now). I believe the main concerns are making
sure that the patches work on a variety of platforms/browsers. Another
concern that has been expressed is a review of the javascript code (for
example, the notebook AJAX communication code was replaced with jquery
function calls).
Instructions for applying the patches are below and at the bottom of the
ticket at http://trac.sagemath.org/sage_trac/ticket/4705. Note that
some of these tickets have cleaned-up spkgs from mabshoff (listed at the
bottom of the relevant ticket) that should be tested instead of the
spkgs listed in the email below.
Thanks,
Jason
Forwarded message from sage-edu:
Luiz Felipe Martins wrote:
> > Here is a basic question: how to enter the HTML text between cells? Is
> > there a handy way to do it? The only thing I could figure out is to
> > jump back and forth from "Worksheet" to "Edit".
> >
> > (I also saw the LaTeX-Sage converter, but still have to experiment
with it.)
> >
There is a patch under review that enables you to shift-click on the
new-cell bar and it will create an in-place wysiwyg editor (TinyMCE, see
http://tinymce.moxiecode.com/examples/full.php). You can edit the html
text in-place and it feels just like a normal word processor (i.e., you
don't see the html code). After saving changes, you are then able to
edit the text in-place by double-clicking on the text.
If you would like to apply the patch and help review it, the
instructions are at the bottom of
http://trac.sagemath.org/sage_trac/ticket/4705. For your convenience,
I've copied them below.
I think the main holdup of the patches is someone reviewing them. We
need to make sure that these changes work on a wide variety of platforms
well.
Thanks,
Jason
Apply the following patches from 4674, 3767, 4704, and 4705, in order:
jsmath-spkg.patch
jquery-and-friends-spkg.2.patch
jquery-javascript-cleanup.patch
tinymce-editable.patch
safari-fix.patch
Install the following packages from the above tickets. You may have to
do ./sage -f <spkg URL> to force an installation if you've already
installed an spkg.
http://sage.math.washington.edu/home/jason/notebook/jquery-1.2.6.spkg
http://sage.math.washington.edu/home/jason/notebook/jqueryui-1.6r807svn.spkg
http://sage.math.washington.edu/home/jason/notebook/jsmath-3.6a.spkg
http://sage.math.washington.edu/home/jason/notebook/tinyMCE-3.2.0.2.spkg
Optionally, you can also install the jsmath image fonts by installing:
http://sage.math.washington.edu/home/jason/notebook/jsmath-image-fonts-1.3p0.spkg
Now rebuild sage by starting sage with "sage -br"
Now you should be able to shift-click on a new cell bar to create a text
cell using tinyMCE. You should also be able to double-click on an
existing text cell to edit it in-place.
You just sent the worksheet to a public mailinglist with 752 members.
Furthermore, your attachment is available for download here:
http://groups.google.com/group/sage-devel/browse_thread/thread/a4ba0ed228e220c5
i.e. your work is already distributed considerably :)
Martin
--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de
>
> I think that the editor is just as important as the @interact in the
> notebook. So if we could find some more people to test the patches we
> can get them into the next release. As long as they don't break any
> existing functionality I would think that even if the editor support
> is slightly broken on some platforms it should still go in. The patch
> has been around for a while and resolving this would make life easier
> for everyone.
Can someone official make a list of requirements on this ticket to get
into Sage (i.e., a list of platforms people need to try it on, so many
people per platform, whatever). I would, but I'm afraid it'd be a bit
biased :).
Thanks,
Jason
Here are the things that still need to be done to get this in (I believe
I've covered everything). If anyone can do part or all of this, that
would be great!
* testing with IE 6 on Windows
* testing with FF 2.0.x on Windows, OSX and Linux
* testing with Safari on 10.4
* testing with Opera 9.5 on OSX, Linux
* review of the patches themselves
* review of mabshoff's changes to the spkgs
* trivial one-line patch to fix the "ghostly text" issue (just make
the placeholder string the empty string in cell.py (search for
"placeholder" in cell.py).
* (maybe can wait for another patch): figure out what is going on
with divs with the same id. My guess is that it is an issue with setting
the innerHTMl of an object, rather than replacing the object itself.
When the page is "Edit"ed and then reloaded, the duplicate nested IDs go
away. This points to the javascript code that inserts text cells as the
problem.
> In the end having your assurance that you will available to fix
> some of the inevitable issues would also be assuring.
You have my assurance.
Jason
I just opened #5025, which quotes the relevant email.
Thanks,
Jason