This repository has been archived by the owner on Dec 31, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
99 lines (77 loc) · 2.33 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Matterhorn</title>
<!--Stylesheet-->
<!--Bootstrap-->
<link rel="stylesheet"
href="./node_modules/bootstrap/dist/css/bootstrap.css">
<!--Eriosys Stylesheet-->
<link rel="stylesheet"
href="css/stylesheet.css">
<!--Loading Spinner-->
<link rel="stylesheet"
href="css/white_spinner.css">
<!--IziToast-->
<link rel="stylesheet"
href="node_modules/izitoast/dist/css/iziToast.min.css">
</head>
<body>
<div id="window-handle-bar"></div>
<div id="root"></div>
<script>
// App requirements
require("./renderer.js");
require("./dist/js/index");
const settings = require("./dist/js/settings").default;
//iziToast
const iziToast = require("izitoast");
iziToast.settings({
progressBar : false,
});
// Offline.js
require("offline-js");
Offline.options = {
checks : { xhr : { url : settings.serverURL } },
requests : false,
reconnect : false,
};
const { makeErrorToast } = require("./dist/js/dismissable_toast_maker");
localStorage.isOnline = true;
function bindOfflineHandlers() {
Offline.on("down", () => {
localStorage.isOnline = false;
const dismissError = makeErrorToast({
title : "Offline",
message : "You are not connected to the server",
});
Offline.on("up", () => {
iziToast.success({
title : "Connected",
message : "Established connection with the server",
});
localStorage.isOnline = true;
dismissError();
// Unbind everything to avoid duplicates
Offline.off("down");
Offline.off("up");
//Rebind everything
bindOfflineHandlers();
});
});
}
bindOfflineHandlers();
// Initial check when app launches
Offline.check();
//Upload care
UPLOADCARE_PUBLIC_KEY = settings.uploadcarePublicKey;
UPLOADCARE_SYSTEM_DIALOG = true;
const uploadcare = require("uploadcare-widget");
//Bootstrap
let $ = require("jquery");
let Popper = require("popper.js");
require("bootstrap");
</script>
</body>
</html>