forked from retoor/snek
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user