up to 7
This commit is contained in:
28
zuss/app.js
28
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";
|
||||
|
||||
@@ -168,6 +168,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="./app.js?v=2025.12.24.6"></script>
|
||||
<script src="./app.js?v=2025.12.24.8"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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" }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "version": "2025.12.24.6" }
|
||||
{ "version": "2025.12.24.8" }
|
||||
|
||||
Reference in New Issue
Block a user