This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
111 lines (99 loc) · 4.06 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<meta name="Description" content="This is a sample demo app to show furos capabilites">
<link rel="icon" href="assets/icons/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/icons/favicon-16x16.png">
<meta name="theme-color" content="#ffffff">
<link rel="manifest" href="manifest.json">
<link
href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700|Roboto:400,300,300italic,400italic,500,500italic,700,700italic&display=swap"
rel="stylesheet">
<base id="base" href="/">
<title>Todos</title>
<script>
/**
* If you need to work with sub directories, set the regex to the path of your app
* The example accepts /any/folder/dist with dist as the deepest folder where your app lies.
*
* Do not forget to add **url-space-regex="^${window.APPROOT}"** in your furo-location component
*/
/* enable this, to work with dynamic subdirs
const matches = window.location.pathname.match(/^(.*)directory_name/);
if (matches !== null) {
[window.APPROOT] = matches;
const b = document.getElementById("base");
b.setAttribute("href", `${window.APPROOT}/`);
} else {
window.APPROOT = "";
}
*/
// window.APPROOT = "/fixed/subdirectory"; // set your path directly if your subdir is fixed. Do not forget to add it in <base id="base" href="/fixed/subdirectory/"> too (somewhere in line 18)
window.APPROOT = "";
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.getRegistration().then((registration) => {
if (registration) {
registration.addEventListener('updatefound', () => {
// A wild service worker has appeared in reg.installing!
const newWorker = registration.installing;
// "installing" - the install event has fired, but not yet complete
// "installed" - install complete
// "activating" - the activate event has fired, but not yet complete
// "activated" - fully active
// "redundant" - discarded. Either failed install, or it's been
// replaced by a newer version
newWorker.addEventListener('statechange', () => {
if (newWorker.state === 'installed') {
const obj = {};
obj.labelText = "New update installed.";
obj._action = () => {
// reload page
registration.unregister();
window.location.reload();
};
obj.icon = "clear";
obj._dismiss = () => {
console.log("closed without reload...")
};
obj.actionButtonText = "restart";
const customEvent = new Event("open-furo-snackbar-requested", {composed: true, bubbles: true});
customEvent.detail = obj;
this.dispatchEvent(customEvent);
}
});
});
}
});
});
// Load and register pre-caching Service Worker
window.addEventListener('load', function (registration) {
navigator.serviceWorker.register('service-worker.js');
});
}
</script>
<!-- Load your application shell -->
<script type="module" src="src/app-shell.js"></script>
<style>
body {
margin: 0;
min-height: 100vh;
background-color: #ffffff;
font-family: "Roboto", "Noto", sans-serif;
font-size: 14px;
line-height: 1.5;
letter-spacing: 0.5px;
}
</style>
</head>
<body>
<app-shell></app-shell>
<noscript>
Please enable JavaScript to view this website.
</noscript>
</body>
</html>