aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-24 11:27:51 +0000
committerMario <mario@mariovavti.com>2021-06-24 11:27:51 +0000
commit108777251e4d5f61c9fa344f7a19c31a1b12fb44 (patch)
treea377100f8ccf585a5a43500e26a00e218ec8ff53 /view/tpl
parent088713a5557d86957870625a7fdc0d236c833374 (diff)
downloadvolse-hubzilla-108777251e4d5f61c9fa344f7a19c31a1b12fb44.tar.gz
volse-hubzilla-108777251e4d5f61c9fa344f7a19c31a1b12fb44.tar.bz2
volse-hubzilla-108777251e4d5f61c9fa344f7a19c31a1b12fb44.zip
some preperatory work on desktop notifications
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/notifications_widget.tpl17
1 files changed, 17 insertions, 0 deletions
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 9a6118ef1..263318aad 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -354,6 +354,10 @@
if($('#nav-' + notifyType + '-menu .notification[data-b64mid=\'' + this.b64mid + '\']').length)
return true;
+ if(!replace && !followup && this.thread_top && notifyType == 'network') {
+ sse_dektop_notification($('<p>' + this.message + '</p>').text(), this.name);
+ }
+
html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.addr,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum, encodeURIComponent(this.mids), this.body);
notify_menu.append(html);
});
@@ -467,6 +471,19 @@
sse_handleNotifications(obj, false, false);
});
}
+
+ function sse_dektop_notification(body, title) {
+ let options = {
+ body: body,
+ icon: '/images/hz-64.png',
+ silent: false
+ }
+ let n = new Notification(title, options);
+ n.onclick = function (event) {
+ setTimeout(n.close.bind(n), 300);
+ }
+ }
+
</script>
<div id="notifications_wrapper" class="mb-4">