-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.html
52 lines (45 loc) · 1.28 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Plurimath demo</title>
<style>
form>* { width: 45%; float: left; }
textarea { height: 90vh; }
button { width: 90%; }
</style>
</head>
<body>
<form>
<textarea id="from"></textarea>
<textarea id="to"></textarea>
<select id="fromfmt">
<option>asciimath</option>
<option>omml</option>
<option>html</option>
<option>mathml</option>
<option>latex</option>
</select>
<select id="tofmt">
<option>Asciimath</option>
<option>Omml</option>
<option>Html</option>
<option>Mathml</option>
<option>Latex</option>
</select>
<button>Convert</button>
</form>
<script type="module">
import Plurimath from "./dist/index.js";
document.querySelector("form").addEventListener("submit", function(e) {
e.preventDefault();
var from = document.getElementById("from").value;
var fromfmt = document.getElementById("fromfmt").value;
var tofmt = document.getElementById("tofmt").value;
var to = document.getElementById("to");
var pm = new Plurimath(from, fromfmt);
to.value = pm["to"+tofmt]();
});
</script>
</body>
</html>