From 981c56ed24f92f5a2f60d713507c7c4bcb440246 Mon Sep 17 00:00:00 2001 From: hbrain Date: Sat, 20 Jun 2026 20:16:16 +0200 Subject: [PATCH] Map lighbox on permalink fixed --- _footer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_footer.php b/_footer.php index b1a430c..f99b3e3 100644 --- a/_footer.php +++ b/_footer.php @@ -6,7 +6,7 @@ function b64uToUint8Array(s){ const pad='='.repeat((4-s.length%4)%4); const b64=(s+pad).replace(/-/g,'+').replace(/_/g,'/'); const raw=atob(b64); return Uint8Array.from([...raw].map(c=>c.charCodeAt(0))); } async function state(reg){ const sub=await reg.pushManager.getSubscription(); btn.classList.toggle('active', !!sub); btn.title=sub?'Notifications on':'Notifications'; btn.hidden=false; return sub; } navigator.serviceWorker.register('/sw.js').then(async reg=>{ - const cfg=await fetch('push_config.php',{cache:'no-store'}).then(r=>r.json()).catch(()=>({enabled:false})); + const cfg=await fetch('/push_config.php',{cache:'no-store'}).then(r=>r.json()).catch(()=>({enabled:false})); if(!cfg.enabled || !cfg.publicKey) return; await state(reg); btn.addEventListener('click', async ()=>{ @@ -19,7 +19,7 @@ const perm=await Notification.requestPermission(); if(perm!=='granted') return; sub=await reg.pushManager.subscribe({userVisibleOnly:true,applicationServerKey:b64uToUint8Array(cfg.publicKey)}); - await fetch('push_subscribe.php',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(sub)}); + await fetch('/push_subscribe.php',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(sub)}); } await state(reg); }catch(e){ alert(e.message || 'Could not update notifications'); } @@ -28,4 +28,4 @@ }); })(); - +