Initial commit
CI / test (push) Canceled after 0s

This commit is contained in:
2026-09-12 22:22:17 +02:00
commit 904d14b64c
314 changed files with 31884 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
const CACHE_NAME = "gardomatic-shell-v9";
const APP_SHELL = [
"/static/css/main.css",
"/static/css/cropper-1.6.2.min.css",
"/static/js/htmx-2.0.10.min.js",
"/static/js/main.js",
"/static/js/cropper-1.6.2.min.js",
"/static/manifest.manifest",
"/static/icons/gardomatic-192.png",
"/static/icons/gardomatic-512.png",
"/static/offline.html",
];
self.addEventListener("install", (event) => {
event.waitUntil(caches.open(CACHE_NAME).then((cache) => cache.addAll(APP_SHELL)));
});
self.addEventListener("activate", (event) => {
event.waitUntil(
caches.keys().then((names) => Promise.all(names.filter((name) => name !== CACHE_NAME).map((name) => caches.delete(name)))),
);
});
self.addEventListener("fetch", (event) => {
if (event.request.method !== "GET" || new URL(event.request.url).origin !== self.location.origin) {
return;
}
event.respondWith(fetch(event.request).catch(() => caches.match(event.request).then((response) => response || caches.match("/static/offline.html"))));
});