diff --git a/test/config.php b/test/config.php new file mode 100644 index 0000000..087aeb0 --- /dev/null +++ b/test/config.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/test/onsen_ui/favicon.ico b/test/onsen_ui/favicon.ico deleted file mode 100644 index 3bf1189..0000000 Binary files a/test/onsen_ui/favicon.ico and /dev/null differ diff --git a/test/onsen_ui/index.html b/test/onsen_ui/index.html index ddbcdcd..665247a 100644 --- a/test/onsen_ui/index.html +++ b/test/onsen_ui/index.html @@ -1,12 +1,30 @@ + + + Onsen UI Test + - Click this + + + +
Home
+
+ Hallo wach + Click this +
\ No newline at end of file diff --git a/test/onsen_ui/manifest.json b/test/onsen_ui/manifest.json new file mode 100644 index 0000000..dc85d50 --- /dev/null +++ b/test/onsen_ui/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "AST Kanister App", + "short_name": "AST App", + "start_url": "/", + "display": "standalone", + "theme_color": "#ef4e2a", + "background_color": "#fff", + "icons": [{ + "src": "https://via.placeholder.com/192x192", + "sizes": "192x192", + "type": "image/png" + },{ + "src": "https://via.placeholder.com/512x512", + "sizes": "512x512", + "type": "image/png" + }] + } \ No newline at end of file diff --git a/test/onsen_ui/sw.js b/test/onsen_ui/sw.js new file mode 100644 index 0000000..a11a40b --- /dev/null +++ b/test/onsen_ui/sw.js @@ -0,0 +1,37 @@ +// Service Worker +// hier wird alles lokal gespeichert +// der "install" event wird beim ServiceWorker Startup aufgerufen + +self.addEventListener('install', function(e) { + console.log('install'); + + // waitUntil tells the browser that the install event is not finished until we have + // cached all of our files + e.waitUntil( + // Here we call our cache "myonsenuipwa", but you can name it anything unique + caches.open('myonsenuipwa').then(cache => { + // If the request for any of these resources fails, _none_ of the resources will be + // added to the cache. + return cache.addAll([ + '/', + '/index.html', + '/manifest.json', + 'https://unpkg.com/onsenui/css/onsenui.min.css', + 'https://unpkg.com/onsenui/css/onsen-css-components.min.css', + 'https://unpkg.com/onsenui/js/onsenui.min.js' + ]); + }) + ); + +}); + + +// der fetch event wird abgefangen und stattdessen die lokale Datei geliefert + +self.addEventListener('fetch', function(e) { + console.log('fetch'); + e.respondWith( + caches.match(e.request) + .then(response => response || fetch(e.request)) + ); +}); \ No newline at end of file