yay took not long
This commit is contained in:
31
zuss/app.js
31
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.11";
|
const APP_VERSION = "2025.12.24.12";
|
||||||
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}`;
|
||||||
@@ -255,24 +255,17 @@ function renderList(items, currentDir) {
|
|||||||
for (const it of pdfs) {
|
for (const it of pdfs) {
|
||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
a.className = "row";
|
a.className = "row";
|
||||||
a.href = "#";
|
|
||||||
a.addEventListener("click", (e) => {
|
// Build relative path within share for viewer URL
|
||||||
e.preventDefault();
|
const marker = `/public.php/dav/files/${TOKEN}`;
|
||||||
// Build relative path within share
|
const idx = it.href.indexOf(marker);
|
||||||
// href includes /public.php/dav/files/<token>/...; we want path after that
|
let rel = "/";
|
||||||
const marker = `/public.php/dav/files/${TOKEN}`;
|
if (idx >= 0) rel = it.href.slice(idx + marker.length);
|
||||||
const idx = it.href.indexOf(marker);
|
if (!rel.startsWith("/")) rel = "/" + rel;
|
||||||
let rel = "/";
|
const targetUrl = toPdfJsUrl(rel);
|
||||||
if (idx >= 0) rel = it.href.slice(idx + marker.length);
|
a.href = targetUrl;
|
||||||
if (!rel.startsWith("/")) rel = "/" + rel;
|
a.target = "_blank";
|
||||||
const targetUrl = toPdfJsUrl(rel);
|
a.rel = "noopener noreferrer";
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const ico = document.createElement("div");
|
const ico = document.createElement("div");
|
||||||
ico.className = "ico";
|
ico.className = "ico";
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -169,6 +169,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./app.js?v=2025.12.24.11"></script>
|
<script src="./app.js?v=2025.12.24.12"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const CACHE = "wfw-aushang-2025.12.24.11";
|
const CACHE = "wfw-aushang-2025.12.24.12";
|
||||||
|
|
||||||
const ASSETS = [
|
const ASSETS = [
|
||||||
"/zuss/",
|
"/zuss/",
|
||||||
@@ -40,7 +40,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.11"}', { headers: { "Content-Type": "application/json" } });
|
return cached || new Response('{"version":"2025.12.24.12"}', { headers: { "Content-Type": "application/json" } });
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ "version": "2025.12.24.11" }
|
{ "version": "2025.12.24.12" }
|
||||||
|
|||||||
Reference in New Issue
Block a user