This repository was archived by the owner on Nov 17, 2022. It is now read-only.
forked from mathquill/mathquill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic.html
48 lines (37 loc) · 1.41 KB
/
basic.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=624">
<title>MathQuill-basic Demo</title>
<link rel="stylesheet" type="text/css" href="support/home.css">
<link rel="stylesheet" type="text/css" href="../build/mathquill.css">
</head>
<body>
<div id="body">
<a href="http://github.com/laughinghan/mathquill"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub!"></a>
<h1><a href="http://mathquill.github.com">MathQuill</a>-basic Demo <small>local test page</small></h1>
<p>Backslash <code>\</code> and dollar <code>$</code> aren't special, <code>/</code> still works, font works:
<p><span id="basic">\sqrt{2}</span>
<p><textarea id="basic-latex"></textarea>
</div>
<script type="text/javascript" src="support/jquery-1.5.2.js"></script>
<script type="text/javascript" src="../build/mathquill-basic.js"></script>
<script type="text/javascript">
MQ = MathQuill.getInterface(MathQuill.getInterface.MAX);
var latex = $('#basic-latex').bind('keydown keypress', function() {
var prev = latex.val();
setTimeout(function() {
var now = latex.val();
if (now !== prev) mq.latex(now);
});
});
var mq = MQ.MathField($('#basic')[0], {
autoSubscriptNumerals: true,
handlers: { edit: function() {
if (!latex.is(':focus')) latex.val(mq.latex());
} }
});
latex.val(mq.latex());
</script>
</body>
</html>