aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/notification.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/notification.php')
-rw-r--r--templates/notification.php11
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