From e1bda360f431bd0a31f11340a593084f0ae67085 Mon Sep 17 00:00:00 2001 From: thrhymes Date: Wed, 24 Dec 2025 21:38:27 +0100 Subject: [PATCH] up to 7 --- zuss/app.js | 28 +++++++++++++++++++++------- zuss/index.html | 2 +- zuss/manifest.webmanifest | 3 +-- zuss/sw.js | 4 ++-- zuss/version.json | 2 +- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/zuss/app.js b/zuss/app.js index 2cec45f..965dc2f 100644 --- a/zuss/app.js +++ b/zuss/app.js @@ -4,7 +4,7 @@ * - Install/Update Overlay mit beforeinstallprompt.prompt() */ -const APP_VERSION = "2025.12.24.6"; +const APP_VERSION = "2025.12.24.8"; const TOKEN = "T9e7WESBXxy6rSD"; const BASE = "https://home.x-s.at"; const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`; @@ -326,6 +326,25 @@ async function registerSW() { } } +function closeAushang(){ + try { window.close(); } catch {} + // Some browsers block close() once we navigated to pdf.js and back; fallback to back/blank + setTimeout(() => { + if (document.visibilityState === "hidden") return; // tab closed or navigating + const ref = document.referrer || ""; + const cameFromPdf = ref.includes("/pdfjs/"); + if (ref && !cameFromPdf) { + history.back(); + setTimeout(() => { + if (document.visibilityState === "hidden") return; + location.href = "about:blank"; + }, 180); + } else { + location.href = "about:blank"; + } + }, 140); +} + function applyTheme(t){ document.documentElement.setAttribute("data-theme", t); localStorage.setItem("wfw_theme", t); @@ -377,12 +396,7 @@ document.addEventListener("click", (e) => { document.addEventListener("DOMContentLoaded", async () => { $("refreshBtn").addEventListener("click", (e) => { e.preventDefault(); loadList(); }); - $("closeBtn").addEventListener("click", (e) => { - e.preventDefault(); - // Kiosk-ish: close tab if possible, else just go back - window.close(); - setTimeout(() => { history.back(); }, 150); - }); + $("closeBtn").addEventListener("click", (e) => { e.preventDefault(); closeAushang(); }); initTheme(); $("themeBtn").addEventListener("click", () => { const current = document.documentElement.getAttribute("data-theme") || "dark"; diff --git a/zuss/index.html b/zuss/index.html index 2cd8969..1c896b7 100644 --- a/zuss/index.html +++ b/zuss/index.html @@ -168,6 +168,6 @@ - + diff --git a/zuss/manifest.webmanifest b/zuss/manifest.webmanifest index 41b80e0..de426a1 100644 --- a/zuss/manifest.webmanifest +++ b/zuss/manifest.webmanifest @@ -3,7 +3,7 @@ "short_name": "WFW-Aushang", "start_url": "/zuss/?source=pwa", "scope": "/zuss/", - "display": "standalone", + "display": "fullscreen", "orientation": "portrait", "background_color": "#0b1020", "theme_color": "#0b1020", @@ -12,4 +12,3 @@ { "src": "/zuss/icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ] } - diff --git a/zuss/sw.js b/zuss/sw.js index 574b7aa..d859588 100644 --- a/zuss/sw.js +++ b/zuss/sw.js @@ -1,4 +1,4 @@ -const CACHE = "wfw-aushang-2025.12.24.6"; +const CACHE = "wfw-aushang-2025.12.24.8"; const ASSETS = [ "/zuss/", @@ -40,7 +40,7 @@ self.addEventListener("fetch", (event) => { return fresh; } catch { const cached = await caches.match(req); - return cached || new Response('{"version":"2025.12.24.6"}', { headers: { "Content-Type": "application/json" } }); + return cached || new Response('{"version":"2025.12.24.8"}', { headers: { "Content-Type": "application/json" } }); } })()); return; diff --git a/zuss/version.json b/zuss/version.json index ae178e3..ae47802 100644 --- a/zuss/version.json +++ b/zuss/version.json @@ -1 +1 @@ -{ "version": "2025.12.24.6" } +{ "version": "2025.12.24.8" }