-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
54 lines (50 loc) · 1.49 KB
/
index.js
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
import { RootCtrl } from "./controllers/root/root.js";
import { isRTL } from "./i18n/index.js";
import { addSentece, coqInit, getLastSentence, ppToDOM, subscribe } from "./util/coq/index.js";
import "./css/coq.notmodule.css";
import "./css/theme.notmodule.css";
import "./css/swal.notmodule.css";
import { delay } from "./util/other.js";
import swal from "sweetalert";
import { createNode } from "./util/dom.js";
import { libs } from "./coq/libs/manager.js";
if (isRTL()) {
document.body.dir = 'rtl';
}
const main = async () => {
coqInit();
subscribe('exn', async (pp) => {
const c = createNode('div');
for (const x of ppToDOM(pp)) {
c.appendChild(x);
}
const p = createNode('p');
p.innerText = `Caused by: ${getLastSentence()}`;
c.appendChild(p);
await swal({
content: c,
icon: 'error',
});
});
const root = new RootCtrl();
document.body.appendChild(root.el);
await coqInit();
await libs.Prelude.require();
await libs.Arith.require();
await libs.Classic.require();
await libs.Set.require();
await libs.Pre_lemma.require();
const hstring = window.localStorage.getItem('history');
if (hstring) {
const history = JSON.parse(hstring);
if (history.length !== 0) {
for (const x of history) {
await addSentece(x);
}
return;
}
}
await addSentece('Goal ~ Finite _ Prime');
//await addSentece('Proof. intros. classical_right.pose proof (not_and_or).pose proof (not_even).pose proof (not_odd).');
};
main();