Giter Club home page Giter Club logo

tinymce_mathquill_plugin's People

Contributors

dylandhall avatar ianconsolata avatar laughinghan avatar piacentini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tinymce_mathquill_plugin's Issues

files missing

Hi, ive just downloaded the code to try it and it seems (according to my Chrome browser) that two files are missing:

/vendor/tinymce/jscripts/tiny_mce/plugins/mathquill/vendor/mathquill.js
/vendor/tinymce/jscripts/tiny_mce/plugins/mathquill/vendor/mathquill.css

regards

Martin

TinyMCE v4

Hi, I was wondering if there are any plans into adapting the plugin to make it work in the new version of TinyMCE v4 released recently? Im struggling to make it work in it.

TIA

Martin

On Node Change needs to be fixed

Currently, the duplication problem we were having with asciimath can still be triggered. I can be triggered for certain by left (or right) mousing over Multiple rendered-latex images in a row. If you hit enter, it duplicates the latex, and then opens a new window. If you hit X, it only duplicates the latex once.

Part of the problem is that instead of replacing what's in the node that triggered the onNodeChange, we only replace what is currently selected, which means if we have a rendered-latex node that triggers on node change without being selected, the dialog will be populated with it's latex, but won't replace anything since nothing is selected.

We also need to better handle on node change so that we actually know the user wants to edit the math, instead of just texting if our node is the 'changing' node.

Transform mathquill-rendered-math spans back to images when loading into editor

When you get the tinymce.html() contents the plugin transforms the image (used for preview) into mathquill-rendered-math spans. However, the opposite does not happen. So when you store the text in a database or another place and then reload the equation in the plugin, you will not see the preview images and will not be able to edit the equations (they will be loaded as mathquill-rendered-math spans in tinymce).
ASCIIMath plugin apparently toggles between AM and AMEdit spans in the preProcess method of the plugin, for reference.

Use mathquill-rendered latex in the preview plugin

"I just committed a change to enable the standard TinyMCE preview plugin button, next to MathQuill's one. Notice that in the preview we see the LaTeX image rendered. It would be very nice to be able to see the MathQuill rendered version of the math equation there instead.

I realize that this probably requires a new plugin (matquill_preview?). Internally it will probably just use the same functions we had already talked about previously (the ones that transform to/from MathQuill spans into img ones). Are these already coded somewhere? If they are, I can maybe give it a shot at duplicating/forking the preview plugin. This could be cool so editors would be able to immediately preview the whole exercise with MathQuill rendered math, as the mathtex version will probably not be accurate in all cases (alignment and size issues)."

Consider putting 'untransformed' mathquill span in the getHtml function, instead of the image

"One thing I noticed, related to this. If you click the View Source button in the demo page (to see the HTML) notice that you get something like:

<p>Include text along with math equations like <span class="AM">`x=(-b+-sqrt(b^2-4ac))/(2a)`</span> in your documents</p>
<p>Click on the math formula to edit the AsciiMath expression used to generate it. <img class="rendered-latex" style="vertical-align: middle;" src="http://www.tabuleiro.com/cgi-bin/mathtex.cgi ?\frac{22}{2}" alt="" /></p>
<p>To edit the graph, click on the graph, then click the Graph button in the toolbar to open the control panel.</p>
<p><embed type="image/svg+xml" src="http://www.imathas.com/editordemo/jscripts/tiny_mce/plugins/asciisvg/js/d.svg " style="width: 300px; height: 200px; vertical-align: middle; float: none;" sscr="-7.5,7.5,-5,5,1,1,1,1,1,300,200,func,x^2,null,0,0,,,black,1,none"" /></p>

Compare the ASCII math area to the MathQuill one. In other words: even if the editor is rendering the IMAGES in both cases, the html returned here is the "untransformed" one for ASCIIMath span, while the MathQuill span returns the one with the image. The same is true for the preview button."

Mathquill.js needs to be included in page hosting the TinyMCE instance

For the plugin to work, one needs to include the bundled copy of mathquill.js in the page that hosts the TinyMCE editor. Not sure if it is better/possible to include it in mathField.html if not defined (watching out for possible conflicts if one is using MathQuill in other areas of the app, perhaps?)

Left-arrow into MathQuill when leftmost will duplicate it

Repro. steps:

  1. Put cursor at the very top left corner of TinyMCE rich text area
  2. Enter some math with MathQuill plugin
  3. Hit the Left arrow key
  4. Exit MathQuill editor that pops up (should it be popping up in the first place?)
  5. The math you entered should have doubled

I assume we're being too aggressive about popping up the MathQuill editor onNodeChange or something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.