yay took not long

This commit is contained in:
thrhymes
2025-12-24 22:07:14 +01:00
parent e3c69b6188
commit b7cb257d05
5 changed files with 16 additions and 70 deletions

View File

@@ -4,7 +4,7 @@
* - Install/Update Overlay mit beforeinstallprompt.prompt()
*/
const APP_VERSION = "2025.12.24.11";
const APP_VERSION = "2025.12.24.12";
const TOKEN = "T9e7WESBXxy6rSD";
const BASE = "https://home.x-s.at";
const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`;
@@ -255,24 +255,17 @@ function renderList(items, currentDir) {
for (const it of pdfs) {
const a = document.createElement("a");
a.className = "row";
a.href = "#";
a.addEventListener("click", (e) => {
e.preventDefault();
// Build relative path within share
// href includes /public.php/dav/files/<token>/...; we want path after that
const marker = `/public.php/dav/files/${TOKEN}`;
const idx = it.href.indexOf(marker);
let rel = "/";
if (idx >= 0) rel = it.href.slice(idx + marker.length);
if (!rel.startsWith("/")) rel = "/" + rel;
const targetUrl = toPdfJsUrl(rel);
// Open in new tab so closing the PDF returns to the list, not back navigation
const win = window.open(targetUrl, "_blank", "noopener,noreferrer");
if (!win) {
// fallback if blocked
window.location.href = targetUrl;
}
});
// Build relative path within share for viewer URL
const marker = `/public.php/dav/files/${TOKEN}`;
const idx = it.href.indexOf(marker);
let rel = "/";
if (idx >= 0) rel = it.href.slice(idx + marker.length);
if (!rel.startsWith("/")) rel = "/" + rel;
const targetUrl = toPdfJsUrl(rel);
a.href = targetUrl;
a.target = "_blank";
a.rel = "noopener noreferrer";
const ico = document.createElement("div");
ico.className = "ico";

View File

@@ -1,47 +0,0 @@
<!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>

View File

@@ -169,6 +169,6 @@
</div>
</div>
<script src="./app.js?v=2025.12.24.11"></script>
<script src="./app.js?v=2025.12.24.12"></script>
</body>
</html>

View File

@@ -1,4 +1,4 @@
const CACHE = "wfw-aushang-2025.12.24.11";
const CACHE = "wfw-aushang-2025.12.24.12";
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.11"}', { headers: { "Content-Type": "application/json" } });
return cached || new Response('{"version":"2025.12.24.12"}', { headers: { "Content-Type": "application/json" } });
}
})());
return;

View File

@@ -1 +1 @@
{ "version": "2025.12.24.11" }
{ "version": "2025.12.24.12" }