Bintang Fajar Julio commited on
Commit
a309d98
1 Parent(s): 7d3573c
static/manifest.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Skripsi JTIK",
3
+ "short_name": "SkripsiJTIK",
4
+ "start_url": "/",
5
+ "display": "standalone",
6
+ "background_color": "#ffffff",
7
+ "theme_color": "#0f8a9a",
8
+ "icons": [
9
+ {
10
+ "src": "/static/images/favicon.png",
11
+ "type": "image/png",
12
+ "sizes": "192x192"
13
+ }
14
+ ]
15
+ }
static/service-worker.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ self.addEventListener("install", (event) => {
2
+ event.waitUntil(
3
+ caches.open("my-cache").then((cache) => {
4
+ return cache.addAll([
5
+ "/",
6
+ "/static/css/portal.css",
7
+ "/static/js/app.js",
8
+ "/static/images/favicon.png",
9
+ ]);
10
+ })
11
+ );
12
+ });
13
+
14
+ self.addEventListener("fetch", (event) => {
15
+ event.respondWith(
16
+ caches.match(event.request).then((response) => {
17
+ return response || fetch(event.request);
18
+ })
19
+ );
20
+ });
templates/auth/base.html CHANGED
@@ -23,6 +23,11 @@
23
  href="{{ url_for('static', filename='css/portal.css') }}"
24
  />
25
 
 
 
 
 
 
26
  {% block style %} {% endblock style %}
27
  </head>
28
 
@@ -90,6 +95,22 @@
90
  {% endwith %}
91
  </script>
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  {% block script %}{% endblock script %}
94
  </body>
95
  </html>
 
23
  href="{{ url_for('static', filename='css/portal.css') }}"
24
  />
25
 
26
+ <link
27
+ rel="manifest"
28
+ href="{{ url_for('static', filename='manifest.json') }}"
29
+ />
30
+
31
  {% block style %} {% endblock style %}
32
  </head>
33
 
 
95
  {% endwith %}
96
  </script>
97
 
98
+ <script>
99
+ if ("serviceWorker" in navigator) {
100
+ navigator.serviceWorker
101
+ .register("{{ url_for('static', filename='service-worker.js') }}")
102
+ .then((registration) => {
103
+ console.log(
104
+ "Service Worker registered with scope:",
105
+ registration.scope
106
+ );
107
+ })
108
+ .catch((error) => {
109
+ console.error("Service Worker registration failed:", error);
110
+ });
111
+ }
112
+ </script>
113
+
114
  {% block script %}{% endblock script %}
115
  </body>
116
  </html>
templates/dashboard/base.html CHANGED
@@ -23,6 +23,11 @@
23
  href="{{ url_for('static', filename='css/portal.css') }}"
24
  />
25
 
 
 
 
 
 
26
  {% block style %} {% endblock style %}
27
  </head>
28
 
@@ -321,6 +326,22 @@
321
  </script>
322
 
323
  <script src="{{ url_for('static', filename='js/app.js') }}"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  {% block script %}{% endblock script %}
325
  </body>
326
  </html>
 
23
  href="{{ url_for('static', filename='css/portal.css') }}"
24
  />
25
 
26
+ <link
27
+ rel="manifest"
28
+ href="{{ url_for('static', filename='manifest.json') }}"
29
+ />
30
+
31
  {% block style %} {% endblock style %}
32
  </head>
33
 
 
326
  </script>
327
 
328
  <script src="{{ url_for('static', filename='js/app.js') }}"></script>
329
+
330
+ <script>
331
+ if ("serviceWorker" in navigator) {
332
+ navigator.serviceWorker
333
+ .register("{{ url_for('static', filename='service-worker.js') }}")
334
+ .then((registration) => {
335
+ console.log(
336
+ "Service Worker registered with scope:",
337
+ registration.scope
338
+ );
339
+ })
340
+ .catch((error) => {
341
+ console.error("Service Worker registration failed:", error);
342
+ });
343
+ }
344
+ </script>
345
  {% block script %}{% endblock script %}
346
  </body>
347
  </html>
templates/error.html CHANGED
@@ -22,6 +22,11 @@
22
  rel="stylesheet"
23
  href="{{ url_for('static', filename='css/portal.css') }}"
24
  />
 
 
 
 
 
25
  </head>
26
 
27
  <body class="app app-404-page">
@@ -57,4 +62,19 @@
57
  </div>
58
  <!--//container-->
59
  </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  </html>
 
22
  rel="stylesheet"
23
  href="{{ url_for('static', filename='css/portal.css') }}"
24
  />
25
+
26
+ <link
27
+ rel="manifest"
28
+ href="{{ url_for('static', filename='manifest.json') }}"
29
+ />
30
  </head>
31
 
32
  <body class="app app-404-page">
 
62
  </div>
63
  <!--//container-->
64
  </body>
65
+ <script>
66
+ if ("serviceWorker" in navigator) {
67
+ navigator.serviceWorker
68
+ .register("{{ url_for('static', filename='service-worker.js') }}")
69
+ .then((registration) => {
70
+ console.log(
71
+ "Service Worker registered with scope:",
72
+ registration.scope
73
+ );
74
+ })
75
+ .catch((error) => {
76
+ console.error("Service Worker registration failed:", error);
77
+ });
78
+ }
79
+ </script>
80
  </html>