erster primitiver Test ohne DB Anbindung

This commit is contained in:
Daniel Schick 2021-02-04 13:41:34 +01:00
parent d534b40324
commit d83698336c
5 changed files with 80 additions and 1 deletions

7
test/config.php Normal file
View File

@ -0,0 +1,7 @@
<?php
// define database connection
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,12 +1,30 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.min.css"> <link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.min.css">
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css"> <link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="#">
<script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script> <script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script>
<title>Onsen UI Test</title> <title>Onsen UI Test</title>
<script>
// das hier funktioniert nur wenn die Seite mit https:// ausgeliefert wird
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(() => console.log('Service worker registered'))
.catch(e => console.log(e));
}
</script>
</head> </head>
<body> <body>
<ons-page id="home">
<ons-toolbar id="home-toolbar">
<ons-icon icon="ion-navicon, material:md-menu"></ons-icon>
<div class="center">Home</div>
</ons-toolbar>
Hallo wach
<ons-button onclick="alert('clickerick a ding dong')">Click this</ons-button> <ons-button onclick="alert('clickerick a ding dong')">Click this</ons-button>
</ons-page>
</body> </body>
</html> </html>

View File

@ -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"
}]
}

37
test/onsen_ui/sw.js Normal file
View File

@ -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))
);
});