mathquill/mathquill — pull request #308 by laughinghan (2014-05-14 00:04:31+00:00)
Title: API change: Don't auto-mathquill-ify on document ready

So many benefits:
- multiple versions/builds of MathQuill can be included on the same page
without them fighting each other to the death
- API consumer doesn't have to worry about waiting for MathQuill's `ready`
event handler to do its thing or whether it already has
- simpler to describe in docs, just "do this" rather than "at this
ill-specified point in time this will happen"
- no magic `mathquill-` CSS class names
- less code

Somewhat relatedly:
- rewrite much of Usage in README to be more readable overall (in
addition to/along with updating it to require the API consumer to call
the MathQuill constructors), and to match the wording of the comments
in the `publicapi.js`
+ and while we're at it, add tests for the public API for all the README
examples, some of which didn't work and had to be fixed
- get rid of the weird `.mathquill-embedded-latex`, `.mathquill-editable`, `.mathquill-textbox` business, which were sort-of-publicly-exposed CSS classes that MathQuill sets, but also expects to be set on spans to be MathQuill-ified
+ it's much simpler now, MathQuill only does anything special with `.mq-` classes, MathQuill-ification happens on document ready, only based on CSS classes if you choose so; MathQuill root HTML elements will have those CSS classes only if you set them, MathQuill never sets them
+ in test pages,
- `.mathquill-embedded-latex` is now `.mathquill-static-math` (matching `MathQuill.StaticMath()`),
- `.mathquill-editable` is now `.mathquill-math-field` (matching `MathQuill.MathField()`),
- `.mathquill-textbox` is now `.mathquill-text-field` (matching `MathQuill.TextField()`),
+ internally to MathQuill,
- `.mathquill-rendered-math`, set by `MathQuill.StaticMath()` and `MathQuill.MathField()`, is now `.mq-math-mode`
- `.mathquill-textbox`, set by `MathQuill.TextField()`, and `.mq-text`, set by `TextBlock()`, are now unified as `.mq-text-mode`
- `.mathquill-editable`, set by `MathQuill.MathField()` and `MathQuill.TextField()` (which was inconsistent with how it was used externally/in test pages), is now `.mq-editable-field`
- in other words,
+ the root of `MathQuill.StaticMath()` is just `.mq-math-mode`, read "just a math mode span"
+ the root of `MathQuill.MathField()` is `.mq-editable-field.mq-math-mode`, read "an editable field in math mode"
+ the root of `MathQuill.TextField()` is `.mq-editable-field.mq-text-mode`, read "an editable field in text mode"