service worker more sleek, all JS working

This commit is contained in:
Felix Schulze 2019-11-04 22:37:26 +01:00
parent 055dbfaaaf
commit a453091369
3 changed files with 26 additions and 6 deletions

10
html/assets/js/material.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -134,15 +134,14 @@ När jag började informera mig om Universiteter, antagningspoäng och meritvär
</div> </div>
</header> </header>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.1/material.min.js"></script> <script src="assets/js/material.min.js"></script>
<script src="assets/js/loader.min.js"></script> <script src="assets/js/loader.min.js"></script>
<script src="assets/js/softscrollscript.js"></script> <script src="assets/js/softscrollscript.js"></script>
<script> <script>
if('serviceWorker' in navigator) { if('serviceWorker' in navigator) {
navigator.serviceWorker navigator.serviceWorker
.register('/sw.js') .register('/sw.js');
.then(function() { console.log("Service Worker Registered"); });
} }
</script> </script>
</body> </body>

View File

@ -14,7 +14,6 @@ self.addEventListener('install', function(e) {
'/Teknik', '/Teknik',
'/Kontakt', '/Kontakt',
'/assets/css/main.min.css', '/assets/css/main.min.css',
'/assets/css/main.min.css?v=201',
'/assets/img/tips.jpg ', '/assets/img/tips.jpg ',
'/assets/img/background.jpg ', '/assets/img/background.jpg ',
'/assets/img/favicon/manifest.json', '/assets/img/favicon/manifest.json',
@ -23,9 +22,21 @@ self.addEventListener('install', function(e) {
'/assets/img/favicon/favicon-16x16.png', '/assets/img/favicon/favicon-16x16.png',
'/assets/img/favicon/favicon.ico', '/assets/img/favicon/favicon.ico',
'/assets/js/softscrollscript.js', '/assets/js/softscrollscript.js',
'/assets/js/loader.min.js',
'/assets/js/material.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css',
'https://fonts.googleapis.com/icon?family=Material+Icons', 'https://fonts.googleapis.com/icon?family=Material+Icons',
'https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2',
'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Regular.woff2',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Regular.woff',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Medium.woff2',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Medium.woff',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Light.woff2',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Light.woff',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Thin.woff2',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Thin.woff',
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css',
]); ]);
}) })
@ -33,7 +44,7 @@ self.addEventListener('install', function(e) {
}); });
self.addEventListener('fetch', function(event) { self.addEventListener('fetch', function(event) {
console.log(event.request.url); //console.log(event.request.url);
event.respondWith( event.respondWith(
caches.match(event.request).then(function(response) { caches.match(event.request).then(function(response) {
return response || fetch(event.request); return response || fetch(event.request);