new version TinyMCE plugins

728 views
Skip to first unread message

David Lippman

unread,
Aug 14, 2011, 11:26:04 PM8/14/11
to ASCIIMath
I just posted up a new version of the AsciiMath / AsciiSvg TinyMCE
plugins at http://www.imathas.com/editordemo/demo.html

The changes in this release are:
1) The plugins were updated to be compatible with TinyMCE 3.4.4

2) The plugins were updated to work in IE9 without compatibility mode
activated. In previous versions, it was necessary to use
<meta http-equiv="X-UA-Compatible" content="IE=7" />
in order to get the plugins to behave. Now, I am using this
<!--[if lt IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<![endif]-->
to allow IE9 to work in native mode, but to still deal with any IE8
issues, which I have no interest in touching

3) Since IE9 is now operating in native mode, it was possible to tweak
the asciisvg script to utilize IE9's SVG rendering. In the editor
itself, it is still necessary to use images (a limitation of editable
areas), but SVG is used in the dialog view, and in rendering the
output. Be aware that wherever you use the output, it is necessary in
IE9 to include in your stylesheet
svg { overflow: hidden;}

David Lippman

unread,
Aug 15, 2011, 3:41:58 PM8/15/11
to ASCIIMath
Hmm. Looks like wrapping the X-UA-Compatible in conditional comments
didn't work. Changed the approach to use
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9" />

and that seems to be working OK. It still seems to be behaving
somewhat strangely. Gosh I hate IE8 (though not quite as much as IE6)

-David

On Aug 14, 8:26 pm, David Lippman <drlipp...@yahoo.com> wrote:
> I just posted up a new version of the AsciiMath / AsciiSvg TinyMCE
> plugins athttp://www.imathas.com/editordemo/demo.html

iva2k

unread,
Aug 29, 2011, 1:43:53 PM8/29/11
to ASCIIMath
David,
Great! I was waiting for this with interest. My Drupal module that
wraps your plugin had few unresolved issues and I noticed that TinyMCE
3.4.4 updated their media plugin that was screwing things up for
ASCIIMath and ASCIIGraph, so I hoped it would resolve two open issues
that I have in the issue queue for Drupal module. Did you have any
issues with media plugin in 3.4.4?

I did a quick port, and all seems to be working, except for a few
problems, which I also found to be exactly the same on the
http://www.imathas.com/editordemo/demo.html:

1. Can't switch into text in Google Chrome (see details in
http://drupal.org/node/1263462)

2. Matrices and curly braces that used to work produce some mutant
formulas. For example `{(1 if x>=0),(0 if x<0):}` (one in the math
menu dialog) produces
{1 if x>=0)},(0 if x<0)&(1 if x>=0 // 0 if x<0)&(0 if x<0-->.}
, where I used "//" to represent that text is arranged in two lines.
Removing the colon makes it better, but not expected two stacked lines
as it was:
`{(1 if x>=0),(0 if x<0)}` produces just that - {(1 if x>=0),(0 if
x<0)}

3. In Firefox (I tried 6.0) clicking in an existing formula or graph
creates a surrounding box (like the image selection) that stays after
plugin converts the formula into text for editing. For graph it may
detach from the graph if the editor scrolls.

4. Double-click on existing graph does not bring up the dialog
anymore. I miss that feature.

Best,
--
Ilya

David Lippman

unread,
Aug 29, 2011, 6:03:44 PM8/29/11
to ASCIIMath
Thanks for the feedback.

1) No idea what Chrome is doing. Since it worked in Safari, I didn't
bother to check Chrome, but I guess Chrome messed with something.
I'll play with it, but am not sure if I'll be able to work around the
weirdness that is Webkit.

2) It appears that when I was fixing some issue with matrices, I broke
column vectors in the fallback script. I have a version that works
elsewhere, so will get that script updated soon.

3) I'll see if I can figure out what's going on, but trying to figure
out that sort of stuff from the tinymce api documentation can be
tricky.

4) I don't recall double-click to edit being a feature, at least not
with tinymce.

On Aug 29, 10:43 am, iva2k <ilya.ivanche...@gmail.com> wrote:
> David,
> Great! I was waiting for this with interest. My Drupal module that
> wraps your plugin had few unresolved issues and I noticed that TinyMCE
> 3.4.4 updated their media plugin that was screwing things up for
> ASCIIMath and ASCIIGraph, so I hoped it would resolve two open issues
> that I have in the issue queue for Drupal module. Did you have any
> issues with media plugin in 3.4.4?
>
> I did a quick port, and all seems to be working, except for a few
> problems, which I also found to be exactly the same on thehttp://www.imathas.com/editordemo/demo.html:
>
> 1. Can't switch into text in Google Chrome (see details inhttp://drupal.org/node/1263462)

David Lippman

unread,
Aug 29, 2011, 9:27:50 PM8/29/11
to ASCIIMath
OK, got the Chrome math edit bug fixed, and the column vector issue
fixed. I can't replicate the FF issue, so don't think I'll be able to
do anything with that. Have the new version up.

-David

iva2k

unread,
Aug 30, 2011, 9:56:02 AM8/30/11
to ASCIIMath
That was quick!

On FF (#3) issue - did you try with FF6? I did not try with an earlier
versions since I recently updated mine. Here's a screenshot to the
problem (blue airbrush arrow points to the remnant selector). It
happens almost every time I click on the equation. Just an eyesore.
http://helioproject.com/FF6%20artifact.jpg

On #4 you're right - it didn't have a double-click. But it's just few
lines that I added to editor_plugin.js in my installation some years
back and forgot. Maybe you can include them into your code since the
double-click behavior is consistent with other TinyMCE features (e.g.
image):

<pre>
// Add a double-click handler, shortcut for the asciisvg button
command
ed.onDblClick.add(function(ed, e) {
el = e.target;
if (el.nodeName == 'IMG' && (ed.dom.getAttrib(el,"sscr")!='' ||
ed.dom.getAttrib(el,"src").match(/sscr=/))) {
tinyMCE.activeEditor.execCommand('mceAsciisvg');
}
});
</pre>

Regards,
Ilya

David Lippman

unread,
Aug 30, 2011, 2:23:42 PM8/30/11
to ASCIIMath
Ahh, I hadn't experienced the FF issue because I have math fonts
installed, so my FF is using MathML rendering rather than image-based
rendering.

It appears the issue is that the plugin's transformation of the image
into editable text happens after the editor's internal nodechange
event (which adds the image selector thing). I tried retriggering the
nodechange event after doing the plugin transformation, but it didn't
seem to work. Can't figure out any other way to trigger that
nodechange.

-David

On Aug 30, 6:56 am, iva2k <ilya.ivanche...@gmail.com> wrote:
> That was quick!
>
> On FF (#3) issue - did you try with FF6? I did not try with an earlier
> versions since I recently updated mine. Here's a screenshot to the
> problem (blue airbrush arrow points to the remnant selector). It
> happens almost every time I click on the equation. Just an eyesore.http://helioproject.com/FF6%20artifact.jpg

iva2k

unread,
Aug 31, 2011, 1:44:02 PM8/31/11
to ASCIIMath
I checked all other things, and it is big improvement - all
outstanding issues have been resolved. Most important is that media
plugin does not mess up math anymore. FF visual leftovers are not a
big deal. I will release new revision of Drupal module shortly.

Any chance you will include the above double-click code into your
version?

Also, I wanted to discuss few more things - regression tests, Drupal
module, and ASCII vs TeX vs LaTex compatibility and extensions. What
is the best venue - here or in private emails?

Regards,
--
Ilya

David Lippman

unread,
Aug 31, 2011, 4:31:31 PM8/31/11
to ASCIIMath
I'm leaving town in a couple hours, so don't think I'll get the double-
click code in before I leave. Will take a closer look when I get back
in a couple weeks.

Definitely post discussions about AsciiMath or the plugins here.
Other folks in the community (Mauno and Marc particularly) are much
more interested in some of that stuff than I am.
Reply all
Reply to author
Forward
0 new messages