new file - close check
This commit is contained in:
20
zuss/app.js
20
zuss/app.js
@@ -4,7 +4,7 @@
|
|||||||
* - Install/Update Overlay mit beforeinstallprompt.prompt()
|
* - Install/Update Overlay mit beforeinstallprompt.prompt()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const APP_VERSION = "2025.12.24.8";
|
const APP_VERSION = "2025.12.24.9";
|
||||||
const TOKEN = "T9e7WESBXxy6rSD";
|
const TOKEN = "T9e7WESBXxy6rSD";
|
||||||
const BASE = "https://home.x-s.at";
|
const BASE = "https://home.x-s.at";
|
||||||
const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`;
|
const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`;
|
||||||
@@ -327,22 +327,8 @@ async function registerSW() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function closeAushang(){
|
function closeAushang(){
|
||||||
try { window.close(); } catch {}
|
const ret = encodeURIComponent(location.pathname + location.search);
|
||||||
// Some browsers block close() once we navigated to pdf.js and back; fallback to back/blank
|
window.location.href = `./close.html?return=${ret}`;
|
||||||
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){
|
function applyTheme(t){
|
||||||
|
|||||||
47
zuss/close.html
Normal file
47
zuss/close.html
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
||||||
|
<meta name="theme-color" content="#0b1020" />
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<title>Schließen?</title>
|
||||||
|
<style>
|
||||||
|
:root{ --bg:#0b1020; --card:#121a33; --text:#e8eeff; --muted:#9fb0ff; --line:rgba(255,255,255,.12); --btn:#2b60ff; --btn2:#1c254b; }
|
||||||
|
@media (prefers-color-scheme: light){
|
||||||
|
:root{ --bg:#f6f7fb; --card:#ffffff; --text:#0b1020; --muted:#5060a8; --line:rgba(0,0,0,.10); --btn:#2b60ff; --btn2:#eef1ff; }
|
||||||
|
}
|
||||||
|
*{ box-sizing:border-box; }
|
||||||
|
body{ margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial; background:var(--bg); color:var(--text); display:grid; place-items:center; min-height:100vh; padding:18px; }
|
||||||
|
.card{ background:var(--card); border:1px solid var(--line); border-radius:20px; padding:18px 16px; max-width:420px; width:100%; box-shadow:0 20px 70px rgba(0,0,0,.35); text-align:center; }
|
||||||
|
h1{ margin:6px 0 10px; font-size:20px; }
|
||||||
|
p{ margin:0 0 16px; color:var(--muted); line-height:1.35; font-size:14px; }
|
||||||
|
.btns{ display:flex; gap:12px; }
|
||||||
|
button{ flex:1; border:0; border-radius:16px; padding:14px 14px; font-size:16px; font-weight:800; cursor:pointer; box-shadow:0 10px 30px rgba(0,0,0,.22); }
|
||||||
|
.primary{ background:var(--btn); color:white; }
|
||||||
|
.secondary{ background:var(--btn2); color:var(--text); border:1px solid var(--line); box-shadow:none; }
|
||||||
|
button:active{ transform:scale(0.99); }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="card">
|
||||||
|
<h1>Wirklich schließen?</h1>
|
||||||
|
<p>Bestätige, ob der Aushang beendet werden soll.</p>
|
||||||
|
<div class="btns">
|
||||||
|
<button class="primary" id="yes">Ja, schließen</button>
|
||||||
|
<button class="secondary" id="no">Zurück</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
const params = new URLSearchParams(location.search);
|
||||||
|
const backTarget = params.get("return") || "/zuss/";
|
||||||
|
document.getElementById("no").onclick = () => { location.href = backTarget; };
|
||||||
|
document.getElementById("yes").onclick = () => {
|
||||||
|
try { window.close(); } catch {}
|
||||||
|
setTimeout(() => { location.href = "about:blank"; }, 120);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
<meta name="theme-color" content="#0b1020" />
|
<meta name="theme-color" content="#0b1020" />
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
|
||||||
<link rel="manifest" href="./manifest.webmanifest">
|
<link rel="manifest" href="./manifest.webmanifest">
|
||||||
<link rel="icon" href="./icons/icon-192.png">
|
<link rel="icon" href="./icons/icon-192.png">
|
||||||
@@ -168,6 +169,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./app.js?v=2025.12.24.8"></script>
|
<script src="./app.js?v=2025.12.24.9"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
const CACHE = "wfw-aushang-2025.12.24.8";
|
const CACHE = "wfw-aushang-2025.12.24.9";
|
||||||
|
|
||||||
const ASSETS = [
|
const ASSETS = [
|
||||||
"/zuss/",
|
"/zuss/",
|
||||||
"/zuss/index.html",
|
"/zuss/index.html",
|
||||||
|
"/zuss/close.html",
|
||||||
"/zuss/app.js",
|
"/zuss/app.js",
|
||||||
"/zuss/manifest.webmanifest",
|
"/zuss/manifest.webmanifest",
|
||||||
"/zuss/version.json",
|
"/zuss/version.json",
|
||||||
@@ -40,7 +41,7 @@ self.addEventListener("fetch", (event) => {
|
|||||||
return fresh;
|
return fresh;
|
||||||
} catch {
|
} catch {
|
||||||
const cached = await caches.match(req);
|
const cached = await caches.match(req);
|
||||||
return cached || new Response('{"version":"2025.12.24.8"}', { headers: { "Content-Type": "application/json" } });
|
return cached || new Response('{"version":"2025.12.24.9"}', { headers: { "Content-Type": "application/json" } });
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ "version": "2025.12.24.8" }
|
{ "version": "2025.12.24.9" }
|
||||||
|
|||||||
Reference in New Issue
Block a user