-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
462 lines (427 loc) · 23.7 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
<!DOCTYPE html>
<html lang="en" >
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-163408633-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-163408633-2');
</script>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PF58PDC');</script>
<!-- End Google Tag Manager -->
<title>Course Maker</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-title" content="SOCRATHEMATICS">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<script src="https://kit.fontawesome.com/30a0cbcf71.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/FileSaver.min.js"></script>
<link rel="stylesheet" href="/codemirror-5.56.0/lib/codemirror.css">
<link rel="stylesheet" href="/codemirror-5.56.0/theme/y-cust.css">
<script src="/codemirror-5.56.0/lib/codemirror.js"></script>
<script src="/codemirror-5.56.0/addon/selection/selection-pointer.js"></script>
<script src="/codemirror-5.56.0/addon/selection/active-line.js"></script>
<script src="/codemirror-5.56.0/addon/edit/closebrackets.js"></script>
<script src="/codemirror-5.56.0/mode/xml/xml.js"></script>
<script src="/codemirror-5.56.0/mode/javascript/javascript.js"></script>
<script src="/codemirror-5.56.0/mode/css/css.js"></script>
<script src="/codemirror-5.56.0/mode/vbscript/vbscript.js"></script>
<script src="/codemirror-5.56.0/mode/htmlmixed/htmlmixed.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@jaames/iro"></script>
<link rel="icon" href="/favicon.png">
<link rel="stylesheet" href="/fonts.css">
<link rel="stylesheet" href="/header.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="/mousetrap.min.js"></script>
<script>
var MQ = MathQuill.getInterface(2);
</script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'],['\\(','\\)']]}
});
MathJax.Hub.Queue(function () {
document.getElementById("toggle").disabled = false;
});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<script>
var isTypeset = true;
function ToggleMJ(button=null) {
//button.disabled = true;
//button.value = (isTypeset ? "Typeset Math" : "Remove Typeset Math");
MathJax.Hub.Queue(
(isTypeset ? RemoveMJ : ["Typeset",MathJax.Hub]),
function () {
isTypeset = !isTypeset;
//button.disabled = false;
}
);
}
function RemoveMJ() {
var jax = MathJax.Hub.getAllJax();
for (var i = 0, m = jax.length; i < m; i++) {
var tex = jax[i].originalText;
var isDisplay = (jax[i].root.Get("display") === "block");
if (isDisplay){ tex = "$$"+tex+"$$";} else {tex = "$"+tex+"$";}
var script = jax[i].SourceElement();
jax[i].Remove();
var preview = script.previousSibling;
if (preview && preview.className === "MathJax_Preview")
preview.parentNode.removeChild(preview);
script.parentNode.insertBefore(document.createTextNode(tex),script);
script.parentNode.removeChild(script);
}
isTypeset = false;
}
</script>
</head>
<body id="bod" onload="$(function () {
$(`[data-toggle='tooltip']`).tooltip()
}); $(function () {
$(`[data-toggle-second='tooltip']`).tooltip()
});
//$('.toast').toast({autohide:false});$('.toast').toast('show')
">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PF58PDC"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<script src="/menu.js"></script>
<script src="make.js"></script>
<div class="container" id="all" style="margin-top:30px">
<div class="row d-flex justify-content-center align-items-center">
<!--<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="mr-auto">Pro Tip</strong>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body">
Copy and paste content directly from another course or website into the editor!
</div>
</div>-->
</div>
<div class="row ml-5 mb-2">
<div class="btn-toolbar " role="toolbar" aria-label="Toolbar with button groups">
<div class="input-group mr-3">
<input class="form-control form-control-lg no-hl" type="text" value="Untitled Document" id="docnameflat" />
</div>
<div class="btn-group float-right " role="group" aria-label="First group">
<button class="btn btn-info"
onclick="ToggleMJ(this)" id="toggle"
>$x^2$</button>
<button class="btn btn-light" data-toggle="tooltip" data-placement="top" title="Edit HTML" onclick="
let editor=document.getElementById('content');editor.classList.toggle('showCodeEditor');
if( editor.classList.contains('showCodeEditor') ) {
RemoveMJ();
myCodeMirror.setValue(editor.innerHTML);
} else {
editor.innerHTML = myCodeMirror.getValue();
};
let sideeditor=document.getElementById('side');sideeditor.classList.toggle('showCodeEditor');
if( sideeditor.classList.contains('showCodeEditor') ) {
yourCodeMirror.setValue(sideeditor.innerHTML);
} else {
sideeditor.innerHTML = yourCodeMirror.getValue();
}"><></button>
<button class="btn btn-light " id="copyAll" data-trigger="manual" data-toggle="tooltip" title="Copied!">
<i class="far fa-clipboard"></i>
</button>
<button class="btn btn-light" data-toggle="tooltip" data-placement="top" title="Preview Course" onclick="preview()">
<i class="fas fa-eye"></i>
</button>
<button class="btn btn-light" data-toggle="tooltip" data-placement="top" title="Add Problem" onclick="addProb()">
?
</button>
<button class="btn btn-light" data-toggle="tooltip" data-placement="top" title="Save .html" onclick="save()">
<i class="fas fa-file-download"></i>
</button>
<button class="btn auth btn-light" id="uploadButton" data-toggle-second="tooltip" data-placement="top" title="Save to my files" onclick="
upload()">
<i class="fas fa-cloud-upload-alt"></i>
</button>
</div>
</div>
</div>
<div class="row ml-5 mb-5">
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group" aria-label="Third group">
<button class="btn btn-light" data-toggle="tooltip" data-placement="bottom" data-html="true" title="Undo (⌘Z)"
onclick="document.execCommand('undo')"
><i class="fas fa-undo"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('redo')" data-toggle="tooltip" data-placement="bottom" data-html="true" title="Redo (⌘⇧Z)"
><i class="fas fa-redo"></i></button>
</div>
<div class="btn-group mr-2" role="group">
<button class="btn btn-light dropdown-toggle" data-toggle-second="tooltip" data-placement="top" title="Styles" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<a id="headingInd">Normal Text</a>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item text-darl cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<h1>')"><h1>Heading 1</h1></a>
<a class="dropdown-item text-dark cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<h2>')"><h2>Heading 2</h2></a>
<a class="dropdown-item text-dark cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<h3>')"><h3>Heading 3</h3></a>
<a class="dropdown-item text-dark cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<h4>')"><h4>Heading 4</h4></a>
<a class="dropdown-item text-dark cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<h5>')"><h5>Heading 5</h5></a>
<a class="dropdown-item text-dark cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<h6>')"><h6>Heading 6</h6></a>
<a class="dropdown-item text-dark cursor-pointer btn" onclick="document.execCommand('formatBlock',false,'<p>')">Normal Text</a>
</div>
<button class="btn btn-light" data-toggle="tooltip" data-placement="bottom" data-html="true" title="Bold (⌘B)"
onclick="document.execCommand('bold')"
><i class="fas fa-bold"></i></button>
<script>Mousetrap.bind('mod+b', function() { document.execCommand('bold'); });</script>
<button class="btn btn-light"
onclick="document.execCommand('italic')" data-toggle="tooltip" data-placement="bottom" data-html="true" title="Italic (⌘I)"
><i class="fas fa-italic"></i></button>
<script>Mousetrap.bind('mod+i', function() { document.execCommand('italic'); });</script>
<button class="btn btn-light"
onclick="document.execCommand('underline')" data-toggle="tooltip" data-placement="bottom" title="Underline (⌘U)"
><i class="fas fa-underline"></i></button>
<script>Mousetrap.bind('mod+u', function() { document.execCommand('underline'); });</script>
<button class="btn btn-light"
onclick="document.execCommand('strikethrough')" data-toggle="tooltip" data-placement="bottom" data-html="true" title="Strikethrough (⌘⇧Z)"
><i class="fas fa-strikethrough"></i></button>
<script>Mousetrap.bind('mod+shift+z', function() { document.execCommand('strikethrough'); });</script>
<div class="btn-group" role="group" id="tcolordiv">
<button class="btn btn-light dropdown-toggle" aria-haspopup="true" aria-expanded="false" data-toggle-second="tooltip" data-placement="top" title="Text color"
><a id="colorInd" style="text-decoration: underline;
text-decoration-color: black;text-decoration-style: double;"><b>A</b></a></button>
<div class="dropdown-menu">
<div class="wheel ml-1" id="colorWheel"></div>
</div>
</div>
<div class="btn-group" role="group" id="hcolordiv">
<button class="btn btn-light dropdown-toggle" aria-haspopup="true" aria-expanded="false" data-toggle-second="tooltip" data-placement="top" title="Highlight color"
><a ><i id="hcolorInd" style="" class="fas fa-highlighter"></i></a></button>
<div class="dropdown-menu">
<div class="wheel ml-1" id="hcolorWheel"></div>
</div>
</div>
<button class="btn btn-light" data-toggle="tooltip" data-placement="bottom" title="Subscript"
onclick="document.execCommand('subscript')"
><i class="fas fa-subscript"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('superscript')" data-toggle="tooltip" data-placement="bottom" title="Superscript"
><i class="fas fa-superscript"></i></button>
</div>
<div class="btn-group mr-2" role="group" aria-label="Second group">
<button class="btn btn-light" data-toggle="tooltip" data-placement="bottom" title="Insert Link (⌘K)"
onclick="const dest = prompt('Link:', '');document.execCommand('createLink', false,dest)"
><i class="fas fa-link"></i></button>
<script>Mousetrap.bind('mod+k', function() { const dest = prompt('Link:', '');document.execCommand('createLink', false,dest); });</script>
<button class="btn btn-light " data-toggle="tooltip" data-placement="bottom" title="Unlink"
onclick="document.execCommand('unlink')"
><i class="fas fa-unlink"></i></button></div>
<div class="btn-group text-align-group mr-2" role="group" aria-label="Second group">
<button class="btn btn-light"
onclick="document.execCommand('justifyLeft');showTag()" data-toggle="tooltip" data-placement="bottom" title="Left align"
><i class="fas fa-align-left"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('justifyCenter');showTag()" data-toggle="tooltip" data-placement="bottom" title="Center align"
><i class="fas fa-align-center"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('justifyRight');showTag()" data-toggle="tooltip" data-placement="bottom" title="Right align"
><i class="fas fa-align-right "></i></button>
<button class="btn btn-light"
onclick="document.execCommand('justifyFull');showTag()" data-toggle="tooltip" data-placement="bottom" title="Justify"
><i class="fas fa-align-justify"></i></button>
</div>
<div class="btn-group mr-2" role="group" aria-label="Second group">
<button class="btn btn-light "
onclick="document.execCommand('insertUnorderedList');showTag()" data-toggle="tooltip" data-placement="bottom" title="Bulleted list"
><i class="fas fa-list-ul"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('insertOrderedList');showTag()" data-toggle="tooltip" data-placement="bottom" title="Numbered list"
><i class="fas fa-list-ol"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('indent');showTag()" data-toggle="tooltip" data-placement="bottom" title="Increase indent"
><i class="fas fa-indent"></i></button>
<button class="btn btn-light"
onclick="document.execCommand('outdent');showTag()" data-toggle="tooltip" data-placement="bottom" title="Decrease indent"
><i class="fas fa-outdent"></i></button>
</div>
<div class="btn-group mr-2" role="group">
<button class="btn btn-light mb-1" onclick="document.execCommand('removeFormat')" data-toggle="tooltip" data-placement="bottom" title="Clear formatting">
<i class="fas fa-remove-format"></i>
</button>
</div>
</div></div>
<div class="row" id="main">
<div class="col-sm-1">
<div class=" btn-group-vertical">
<button class="btn btn-light text-success" onclick="document.querySelector('#main nav:not(#bottomNav)').innerHTML += `<li class='nav-item'>
<a class='nav-link my-1 mousetrap' contentEditable href=''>Nav</a>
</li>`">
+
</button>
<button class="btn btn-light text-success" onclick="const n = window.getSelection().focusNode.parentNode.parentNode; if (document.querySelector('#main nav:not(#bottomNav)').contains(n) && document.querySelector('#main nav:not(#bottomNav)')!= n){n.remove()}">
×
</button>
<button class="btn btn-success" onclick="const listId = window.getSelection().focusNode.parentNode;
$(listId).toggleClass('active');">
A
</button>
<button class="btn btn-light text-muted" onclick="const listId = window.getSelection().focusNode.parentNode;
$(listId).toggleClass('disabled');">
D
</button>
<button class="btn btn-light" onclick="const listId = window.getSelection().focusNode.parentNode;
$(listId).toggleClass('ml-3');">
→
</button>
</div>
</div>
<div id="side" class="col-sm-3"><h3 class="mousetrap" contentEditable>Topic</h3>
<p contentEditable class="mousetrap">Topics within Topic</p>
<nav class="nav nav-pills flex-column" >
<li class="nav-item ">
<a contentEditable class="nav-link my-1" href="">Home</a>
</li>
<li class="nav-item">
<a class="nav-link my-1 mousetrap" href="" contenteditable="">Food</a>
</li><li class="nav-item">
<a class="nav-link my-1 ml-3 mousetrap active" href="" contenteditable="">Pizza</a>
</li><li class="nav-item">
<a class="nav-link my-1 ml-3 mousetrap disabled" href="" contenteditable="">Cake</a>
</li>
</nav><hr class="d-sm-none">
</div>
<div id="sideEditorC" class="mousetrap"><textarea id="sideEditor" class=" form-control"></textarea></div>
<style>
#side.showCodeEditor{
display: none;
}
#side ~ #sideEditorC{ display: none; }
#side.showCodeEditor ~ #sideEditorC{ display: block; }
</style>
<div class="col-sm-8" id="bod2" >
<div>
<div id="content"><h2 contentEditable class="mousetrap" id="ctitle">How to <strike>make</strike> <font color="#c73c55">get</font> a Pizza</h2>
<div contentEditable class="mousetrap" id="mainContent" ><p>Here's a short course on how to <strike>make</strike> <font color="#c73c55">get</font> a pizza. Enjoy!</p>
<h4>Ingredients</h4>
<ol>
<li> $2\ c$ Dough</li>
<li>$1 \frac{1}{2}\ c$ Tomato Sauce</li>
<li>Some cheese</li>
<li>Toppings (optional)</li>
<li>Diamond ring (very important)</li>
</ol>
<h4>Preparation</h4>
<ol>
<li>Go to a bank and sell all of the above items.</li>
<li>Use the money to buy a pizza from Pizza Hut.</li>
</ol>
</div>
<div style="height:7vh"></div>
<nav id="bottomNav">
<ul class="pagination justify-content-center">
<li class="page-item"><a class="page-link" contentEditable="" href="">« Food</a></li>
<li class="page-item active"><a class="page-link" href="">•</a></li>
<li class="page-item disabled"><a class="page-link " contentEditable="" href="">Cake »</a></li>
</ul>
</nav>
</div>
<div id="codeEditorC" style="padding-left:2rem !important;" class=" mb-5 ml-5 mt-3 mousetrap"><textarea id="codeEditor" class="form-control"></textarea></div>
<style>
#content.showCodeEditor{
display: none;
}
:focus {outline:none;} ::-moz-focus-inner {border:0;}
/*.showCodeEditor ~ #ctitle{
padding-left: 3rem !important;
margin-left: 3rem !important;
}*/
#content ~ #codeEditorC{ display: none; }
#content.showCodeEditor ~ #codeEditorC{ display: block; }
.disabled{
pointer-events: auto !important;
}
.disabled:focus-within,.disabled:focus,.disabled:hover{
color: var(--grey) !important;
}
:any-link{
color:var(--main);
}
:any-link:hover{
color:var(--main-dark);
}
.btn-light{
border-color: var(--grey6);
color: var(--text);
}
.toast,.toast-body,.toast-header{
background-color: var(--grey6);
}
</style>
</div>
</div>
</div>
</div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-analytics.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-firestore.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyBIo2sk5KS9CId37JmgIdsLtAQ1bsbwB_E",
authDomain: "socrathematics-cms.firebaseapp.com",
databaseURL: "https://socrathematics-cms.firebaseio.com",
projectId: "socrathematics-cms",
storageBucket: "socrathematics-cms.appspot.com",
messagingSenderId: "519917689116",
appId: "1:519917689116:web:d554fe30bf72534c1402d9",
measurementId: "G-45XWG0GJN0"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
const auth=firebase.auth();
const db = firebase.firestore();
</script>
<script src="/auth/auth.js"></script>
<script>
const cmConfig = {
lineNumbers: true,
mode: "htmlmixed",
autoCloseBrackets: true,
matchBrackets:true,
autoRefresh:true,
theme:"y-cust",
styleActiveLine:true
};
var myCodeMirror = CodeMirror.fromTextArea(document.querySelector("#codeEditor"), cmConfig);
var yourCodeMirror = CodeMirror.fromTextArea(document.querySelector("#sideEditor"), cmConfig);
yourCodeMirror.setSize(1000, 400);
myCodeMirror.setSize(1000, 600);
myCodeMirror.refresh();
yourCodeMirror.refresh();
Mousetrap.prototype.stopCallback = function () {
return false;
}</script>
<script src="benice.js"></script>
</body>
</html>