diff options
| author | winter | 2025-01-26 19:47:22 +0000 |
|---|---|---|
| committer | winter | 2025-01-26 19:47:22 +0000 |
| commit | 7d3f35b1895dd3fe08af0f5fe403ff339acd2456 (patch) | |
| tree | 26c59b9b18793f9678cc115420762aa7695c2071 /templates/notification.php | |
| parent | df5ead7bd4adac405811b91fed1e5f0b3775206b (diff) | |
send desktop notifications
Diffstat (limited to 'templates/notification.php')
| -rw-r--r-- | templates/notification.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/templates/notification.php b/templates/notification.php index a010ff9..a23a3a6 100644 --- a/templates/notification.php +++ b/templates/notification.php @@ -20,4 +20,15 @@ <?php endif; ?> <span class="body"><?= htmlspecialchars($body) ?></span> </div> + <div hidden class="notifier" <?php if ($unread): ?> _=" + on load + set title to innerText of previous .title + set body to innerText of previous .body + set icon to @src of previous <img/> + set titleLink to previous <a/> + js(title, body, icon, titleLink) + let n = new Notification(title, { body: body, icon: icon }) + n.addEventListener('click', () => titleLink.click()) + end + " <?php endif; ?>></div> </div>
\ No newline at end of file |
