File tree Expand file tree Collapse file tree 3 files changed +38
-21
lines changed Expand file tree Collapse file tree 3 files changed +38
-21
lines changed Original file line number Diff line number Diff line change 38
38
39
39
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css ">
40
40
41
- < link href ="https://fonts.googleapis.com/icon?family=Material+Icons " rel =" stylesheet ">
41
+ < link rel =" stylesheet " href ="https://fonts.googleapis.com/icon?family=Material+Icons ">
42
42
43
43
< script src ="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js ">
44
44
Original file line number Diff line number Diff line change @@ -1339,9 +1339,15 @@ var app = new Vue({
1339
1339
1340
1340
} else {
1341
1341
1342
- alert ( "Lost internet connection!" )
1342
+ if ( confirm ( "No internet connection. Continue?" ) == true ) {
1343
1343
1344
- return false
1344
+ this . loadingHide ( )
1345
+
1346
+ } else {
1347
+
1348
+ return false
1349
+
1350
+ }
1345
1351
1346
1352
}
1347
1353
Original file line number Diff line number Diff line change 1
1
const cacheName = 'TODO' ;
2
+
2
3
const assets = [
4
+
3
5
'./' ,
4
6
'./index.html' ,
5
7
'./index.js' ,
@@ -12,28 +14,37 @@ const assets = [
12
14
'https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js' ,
13
15
'https://code.jquery.com/jquery-3.2.1.min.js' ,
14
16
'https://cdn.jsdelivr.net/npm/vue@2.7.0'
17
+
15
18
]
16
19
17
- // Cache all the files to make a PWA
18
20
self . addEventListener ( 'install' , e => {
19
- e . waitUntil (
20
- caches . open ( cacheName ) . then ( cache => {
21
- // Our application only has two files here index.html and manifest.json
22
- // but you can add more such as style.css as your app grows
23
- return cache . addAll ( assets ) ;
24
- } )
25
- ) ;
21
+
22
+ e . waitUntil (
23
+
24
+ caches . open ( cacheName ) . then ( cache => {
25
+
26
+ return cache . addAll ( assets ) ;
27
+
28
+ } )
29
+
30
+ ) ;
31
+
26
32
} ) ;
27
33
28
- // Our service worker will intercept all fetch requests
29
- // and check if we have cached the file
30
- // if so it will serve the cached file
31
34
self . addEventListener ( 'fetch' , event => {
32
- event . respondWith (
33
- caches . open ( cacheName )
34
- . then ( cache => cache . match ( event . request , { ignoreSearch : true } ) )
35
- . then ( response => {
36
- return response || fetch ( event . request ) ;
37
- } )
38
- ) ;
35
+
36
+ event . respondWith (
37
+
38
+ caches . open ( cacheName )
39
+
40
+ . then ( cache => cache . match ( event . request , { ignoreSearch : true } ) )
41
+
42
+ . then ( response => {
43
+
44
+ return response || fetch ( event . request ) ;
45
+
46
+ } )
47
+
48
+ ) ;
49
+
39
50
} ) ;
You can’t perform that action at this time.
0 commit comments