laughinghan/mathquill — pull request #104 by laughinghan (2012-07-17 02:13:30+00:00)
Title: attempt at new API with global MathQuill function

Usage:

To create a MathQuill thing, must call MathQuill.StaticMath, .MathField
or .TextField and pass in something that jQuery resolves to a single
element.
```html

```
```js
var editableMath = MathQuill.MathField('#editable-math');
assert(editableMath instanceof MathQuill.MathField);
assert(editableMath instanceof MathQuill);
```
All of the old .mathquill('methodName', ...) methods are available on
this MathQuill object.
```js
editableMath.latex('x^2 + y^2 = 1');
$('#editable-math').detach().insertAfter(somewhereElse);
editableMath.redraw();
```
The global MathQuill API object is also a function that you can use to
get the MathQuill object of an HTML element.
```js
MathQuill('#editable-math').latex('y = \\pm \\sqrt{ 1 - x^2 }');
assert(MathQuill('#editable-math') === editableMath);
```
---

I made minimal changes to `test/{demo,visual}.html` for all the tests to
still pass. This meant only deprecating rather than removing the old,
tired `mathquill-embedded-latex`, `mathquill-editable`,
`mathquill-textbox` CSS class names. Should those go next, or should
we keep those for backwards compatibility?