From d83698336cb39d9898b262c23dffc65bdf55158d Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 4 Feb 2021 13:41:34 +0100 Subject: [PATCH] erster primitiver Test ohne DB Anbindung --- test/config.php | 7 +++++++ test/onsen_ui/favicon.ico | Bin 1406 -> 0 bytes test/onsen_ui/index.html | 20 ++++++++++++++++++- test/onsen_ui/manifest.json | 17 +++++++++++++++++ test/onsen_ui/sw.js | 37 ++++++++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 test/config.php delete mode 100644 test/onsen_ui/favicon.ico create mode 100644 test/onsen_ui/manifest.json create mode 100644 test/onsen_ui/sw.js 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 3bf118981d4a105f895ec8b556c53e1effb02a4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmb7^Sx{4F0EG_^o#~@beeRREMK&Yu;=X_yKqxN7EhfM)HY9{p>gY(6l$%>Zazjjj zvPNVl0*w(eAs`@Rs6<3sD5aD-ZKqE6b!unm!MBc2{qLOr{L8)Pd`}mM;Im@I5|)SZ zHQ){UDryDwCKZ9#IRgn1FYT2nGV&l+txCk|)k#>h<|x*#Rbbt^6v$-9v3`9Tm5!*W z3`9qtL`=+S#Kyi&Wm0FcVZ*Y{LoQch%L&U*GWu*;2o`>s<(*uTFB2M*k%igEB@G5vjd2@W4F!J$I} zT|i>u2S`dP#gQXrICe~;>^OSV0fnNRav(X`iIfxYO0rA_xO&7?|5+LOc&QZTzi@4W8Qt{^)j!IclUYcr!OmjvuC@hdpLjIi*x6E zbRYM9xNxBtN@X9{exCX10eU~r{J3~A0F|nr`yls0sMX6p$g@GNhme&uKs`Wq_7HM% zmNkOh+!0*5GzyI-1f6ai`T650D44+I%V882KE{VP+MDzy1F{l*Vm(=p#g5U8@F%YMq^_m?%cV9 zrluw|H#eiDr3J06t!Qg&LwkEWIyySw@p#bH)rFp(9(cW8__ahJp;QIBa zFdCmJBMn^{x3WYE}K8{C^9${i)0^x8NlarH}nwrA&^fYE> zW-vQDi@CWu%+JqbVBiIFUNGk$Jbbu>v9Tp)Eb;p#EG#TwadGkGf57_RVG(RL(IVMI zqp`?n;$+epP5L5(-Y7_VeUV9Uxg=GVV6rEc{>GUQ+Gz$j3miK~Qo1<1Lv-Kv6MU + + + 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