diff options
-rw-r--r-- | app/network.apd | 3 | ||||
-rw-r--r-- | app/search.apd | 3 | ||||
-rw-r--r-- | view/js/main.js | 24 | ||||
-rw-r--r-- | view/js/mod_hq.js | 8 |
4 files changed, 23 insertions, 15 deletions
diff --git a/app/network.apd b/app/network.apd index f67b48ffe..cbce18153 100644 --- a/app/network.apd +++ b/app/network.apd @@ -1,6 +1,7 @@ -version: 2 +version: 3 url: $baseurl/network, $baseurl/settings/network requires: local_channel name: Network photo: icon:th categories: nav_featured_app, Networking +desc: Your network activity in a traditional timeline view. diff --git a/app/search.apd b/app/search.apd index 462561f33..6cf51f11f 100644 --- a/app/search.apd +++ b/app/search.apd @@ -1,4 +1,5 @@ -version: 2 +version: 3 url: $baseurl/search name: Search photo: icon:search +desc: A separate search app to look up content, channels, tags, documentation or remote content depending on the search string prefix. diff --git a/view/js/main.js b/view/js/main.js index d121913ea..f54dbf593 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -237,6 +237,13 @@ $(document).ready(function() { cache_next_page(); }); + $(document).on('hz:handleNetworkNotificationsItems', function(e, obj) { + push_notification( + obj.name, + $('<p>' + obj.message + '</p>').text(), + obj.b64mid + ); + }); }); function getConversationSettings() { @@ -899,7 +906,7 @@ function prepareLiveUpdate(b64mid, notify_id) { if (module == 'hq') { liveUpdate(notify_id); } - if (module == 'display'|| module == 'dm') { + if (module == 'display') { liveUpdate(); } } @@ -1728,16 +1735,23 @@ function push_notification_request(e) { } -function push_notification(title, body, href) { +function push_notification(title, body, b64mid) { let options = { body: body, - data: href, - icon: '/images/hz-64.png', + data: b64mid, + icon: '/images/app/hz-96.png', silent: false } let n = new Notification(title, options); n.onclick = function (e) { - window.location.href = e.target.data; + if(module === 'hq') { + prepareLiveUpdate(e.target.data); + } + else { + window.location.href = baseurl + '/hq/' + e.target.data; + } } } + + diff --git a/view/js/mod_hq.js b/view/js/mod_hq.js index ad77e0af0..5f8430b4d 100644 --- a/view/js/mod_hq.js +++ b/view/js/mod_hq.js @@ -14,12 +14,4 @@ $(document).ready(function() { $('#note-text').focus(); }); - $(document).on('hz:handleNetworkNotificationsItems', function(e, obj) { - push_notification( - obj.name, - $('<p>' + obj.message + '</p>').text(), - baseurl + '/hq/' + obj.b64mid - ); - }); - }); |