feat: add search user page with push notification service worker support

Add SearchUserView with HTML and JSON endpoints, create search-user.html template extending app.html with navigation link, implement push.js for service worker registration and push subscription handling, add service-worker.js for push event display and notification click handling, and fix install prompt event listener registration in app.html
This commit is contained in:
2025-02-08 16:31:03 +00:00
parent a4d56deb11
commit 74247d562c
6 changed files with 96 additions and 2 deletions
+4 -2
View File
@@ -24,6 +24,7 @@
<div class="logo">Snek</div>
<nav>
<a href="/web.html">🏠</a>
<a href="/search-user.html">🔍</a>
<a style="display:none" id="install-button" href="#">📥</a>
<a href="/web.html">👥</a>
<a href="#">⚙️</a>
@@ -52,7 +53,7 @@ let installPrompt = null
window.addEventListener("beforeinstallprompt", async(event) => {
event.preventDefault();
installPrompt = event;
//document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("DOMContentLoaded", () => {
alert("Jaaah")
const button = document.getElementById("install-button")
button.addEventListener("click", async ()=>{
@@ -61,7 +62,8 @@ let installPrompt = null
})
button.style.display = 'inline-block'
});
})
});
;
</script>
</body>