-
Notifications
You must be signed in to change notification settings - Fork 6
/
demo.html
executable file
·56 lines (47 loc) · 2.14 KB
/
demo.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
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<title>TinyMCE MathQuill Plugin Demo</title>
<script type="text/javascript" src="vendor/jquery.js"></script>
<script type="text/javascript" src="vendor/tinymce/jscripts/tiny_mce/plugins/mathquill/vendor/mathquill.js"></script>
<!-- TinyMCE -->
<script type="text/javascript" src="vendor/tinymce/jscripts/tiny_mce/tinymce.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
theme: "modern",
menubar: false,
toolbar: "undo redo | mathquill preview",
plugins: 'mathquill,table,media,preview_mathquill'
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<h3>TinyMCE Math/Graph Plugins Example</h3>
<p>
This page shows some buttons and plugins that are included in the TinyMCE core package, but is intended primarily to
demonstrate the MathQuill plugin for TinyMCE.
There are more examples on how to use TinyMCE in the <a href="http://wiki.moxiecode.com/examples/tinymce/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
<p>
Include text along with math equations like in your documents
</p>
<p>
Click on the math formula to edit the MathQuill expression used to generate it.
</p>
<p>\(x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\)</p>
</textarea>
<div>
<!-- Some integration calls: the first two seem to be having issues with asciimath plugin
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a> -->
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
</div>
<p>This is based on <a href="http://www.imathas.com/editordemo/demo.html">excellent work done on an ASCIIMath plugin by IMathAS</a>.</p>
</body>
</html>