On Wed, Jun 17, 2009 at 4:49 PM, <jason-s...@creativetrax.com> wrote:
> William Stein wrote:
>>
>> Jason,
>>
>> Unfortunately, I find it highly highly frustrating in tinyMCE that I
>> can't enter a newline (i.e., what shift enter did before you rebound
>> it) without directly editing the html.  In my personal copy of Sage,
>> I've disabled the shift-enter submits tinymce cells.  I would be ok
>> with a button to enter a newline, but I couldn't figure out how to add
>> such a button to tinyMCE.  Any ideas?
>>
>
> I think basically you have to write a new plugin or something.  There's an
> example plugin skeleton, though, so presumably it wouldn't be too extremely
> hard (see http://wiki.moxiecode.com/index.php/TinyMCE:Create_plugin/3.x)  A
> very similar plugin is here:
> http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak.
> In fact, you could probably just use the pagebreak plugin with a special
> "pagebreak" option.  Just add the following to the tinymce.init:
>
>        plugins : "pagebreak",
>        pagebreak_separator : "<br/>"
>
>
> Does that work?  It's a little hackish, but it's probably the fastest way to
> do something like what you suggest.  A better way would be to modify the
> pagebreak plugin to be a "linebreak" plugin.

I may try that.

>
> Of course, other options are:
>
> * you can revert your feature request to have shift-enter submit the cell :)
> (apparently you've personally done that...)

Yep, and it sucks and drives me crazy not having shift-enter submit...
 Why can't TinyMCE just read my mind?

> * is there another shortcut key that you'd like?

What about control-enter?   Can you make it so

  control-enter = linebreak
  shift-enter = submit
?

>
> Also, I've been thinking about how to add Rado's graph editor, an equation
> editor, and other nice input methods to the code cells.  Basically, I'm
> looking at how to replace a small section of Sage code with a "widget" that
> represents the code nicely, all inside of the code cell. Requirements that
> make sense to me include:
>
> 1. When the cell is recreated (on page creation, for example), the user
> should see the widget, not the generated Sage code
> 2. The user should be able to highlight some Sage code and convert it to the
> widget (replacing the highlighted part with the graphical div).  If the sage
> code is not understood by the widget, then some sort of error should be
> signaled (maybe an alert box?) and the code should remain in the cell.
> 3. The user should be able to toggle between seeing the Sage code text and
> the widget representation, on a widget-by-widget basis.
>
> Point (1) requires that the cell understand that some sort of widget
> represents the code between character positions x and y.  What's the easiest
> way to store/send that sort of metadata along with the cell?
>
> We probably don't want to use tinymce---it's way too heavyweight for this
> and has *lots* of unneeded functionality.
>
> This will probably necessitate subtle changes in the existing javascript for
> code cells, as we can't use textareas anymore, but instead will use some
> sort of contentEditable divs for code cells.  This also exposes us to lots
> of cross-browser support issues, I believe.  It seems that a major issue for
> the html wysiwyg editors is how well they support different browsers.
>
> What do you think?

Ouch. Oh the pain.    I would have to see a demo.  I have never tried
any sort of contentEditable div before.  I'm amazed how far we've gone
using textareas, to be honest.

 -- William

--~--~---------~--~----~------------~-------~--~----~
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