-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
174 lines (155 loc) · 7.19 KB
/
index.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
<style>
li {
float: left;
margin: 0 15px
}</style>
<meta charset="UTF-8">
<title>LaTeXer!</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<!-- Bootstrap core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/css/mdb.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-2.2.4.js" integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/file-saver@2.0.2/dist/FileSaver.min.js"></script>
<link rel="stylesheet" href="fonts.css">
<link rel="stylesheet" href="prism.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="mathquill-0.10.1/mathquill.css"/>
<script src="mathquill-0.10.1/mathquill.js"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
<script>
var MQ = MathQuill.getInterface(2);
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<!--mathjax-->
<script>
var MathJax = {
tex: {
inlineMath: [['$', '$']]
}
};
</script>
<script src="mousetrap.min.js"></script>
</head>
<body class="bg-dark text-light">
<style>
hr:not(.normal) {
position: relative;
}
</style>
<!-- Modal -->
<div class="modal fade" id="importm" tabindex="-1" role="dialog"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title text-dark">Import a file</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="importfinp" accept=".json">
<label class="custom-file-label" for="inputGroupFile01">Choose file</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary disabled" id="importfbtn">Import</button>
</div>
</div>
</div>
</div>
<!--/.Modal-->
<!--Navbar-->
<nav class="navbar navbar-dark transparent sticky-top blue-gradient text-light waves-effect waves-light">
<!-- Navbar brand -->
<!-- Collapse button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent1" aria-controls="navbarSupportedContent1" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon text-white"></span>
</button>
<a class=" px-2 " onclick="makeCourse(info)"><h1 class="" >$\LaTeX \text{-er}$</h1></a>
<div class="btn-group d-flex" role="group">
<button type="button" id="eq" class="btn rgba-indigo-strong py-2" onclick="addEquation();">Math</button>
<button type="button" id="deq" class="btn light-blue darken-2 py-2" onclick="addDisplayEquation();">Display Math</button>
<button type="button" id="txt" class="btn rgba-green-strong py-2" onclick="addText();">Text</button>
<button type="button" id="itm" class="btn blue-grey py-2" onclick="addItem();">Item</button>
<button type="button" id="lb" class="btn rgba-lime-strong py-2" onclick="addBreak();">Line break</button>
</div>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="navbarSupportedContent1">
<!-- Links -->
<div class="container ">
<ul class="navbar-nav col">
<li class="nav-item row">
<a class="nav-link" data-toggle="modal" data-modal="#importm" data-target="#importm">Import...</a>
</li>
<li class="nav-item row">
<a class="nav-link" onclick="clearAll()">Clear</a>
</li>
</ul>
<ul class="col navbar-nav ">
<li class="nav-item row">
<a class="nav-link" onclick="pack()">Save...</a>
</li>
<li class="nav-item row"><a class="nav-link" onclick="release()">Export TeX...</a></li>
</ul>
</div>
<!-- Links -->
</div>
<!-- Collapsible content -->
</nav>
<!--/.Navbar-->
<div class="container " id="" style="margin-top:30px">
<div class="row">
<div class="col-sm-12 text-dark">
<div id="root" class="py-5">
<p id="e0"></p>
</div>
<hr class="normal"><button type="button" id="final" class="btn btn-lg btn-primary" onclick="makeCourse(info);">$\LaTeX$ it!</button><hr class="normal">
</div>
</div>
<div class="btn-group d-flex pt-5" role="group">
<a type="button" id="eq" class="btn btn-outline-primary py-2" onclick="document.getElementById('code').style.display=null;document.getElementById('preview').style.display='none';this.className='btn btn-primary py-2 disabled';this.nextElementSibling.className='btn btn-outline-primary py-2 ';">Code</a>
<a type="button" id="eq" class="btn btn-primary disabled py-2" onclick="document.getElementById('preview').style.display=null;this.className='btn btn-primary py-2 disabled';this.previousElementSibling.className='btn btn-outline-primary py-2 ';document.getElementById('code').style.display='none';">Preview</a>
</div>
<div id="preview">
<div class="row pt-5" >
<div class="col" id="out"></div>
</div>
</div>
<pre id="code" style="display:none"><code class="row language-latex" id="out2"></code></pre>
</div>
<script src="prism.js"></script>
<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/js/mdb.min.js"></script>
</body>
<script src="make.js"></script>
<script src="save.js"></script>
<script src="import.js"></script>
<script src="export.js"></script>
<script>
Mousetrap.bind('enter', function(){makeCourse(info)});
Mousetrap.bind('alt+t', function(){addText()});
Mousetrap.bind('alt+d', function(){addDisplayEquation()});
Mousetrap.bind(['alt+e','mod+e'], function(){addEquation()});
Mousetrap.bind('alt+l', function(){addBreak()});
Mousetrap.bind('alt+i', function(){addItem()});
</script>
</html>