diff options
author | nobody <nobody@zotlabs.com> | 2021-07-06 05:02:52 -0700 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-07-06 05:02:52 -0700 |
commit | 73b53675b1a339cfd950845279438e35b4e2dc7c (patch) | |
tree | 6b433b3f21585230bfbc71d955c8a8bcc82dd5e8 /view/js/main.js | |
parent | efda8aac1d7d90fd7eda4a449332eedf74342951 (diff) | |
parent | 9b9ac5054fcc424a556f366284501882b1e02e9e (diff) | |
download | volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.tar.gz volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.tar.bz2 volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/view/js/main.js b/view/js/main.js index 78bd790cd..f427df8ad 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1274,7 +1274,7 @@ function dopin(id) { }); } -function dropItem(url, object) { +function dropItem(url, object, b64mid) { var confirm = confirmDelete(); if(confirm) { var id = url.split('/')[2]; @@ -1284,13 +1284,20 @@ function dropItem(url, object) { $.get(url, function() { $(object + ', #pinned-wrapper-' + id).remove(); $('body').css('cursor', 'auto'); + + if (typeof b64mid !== typeof undefined) { + $('[data-b64mid=\'' + b64mid + '\']').fadeOut(function() { + this.remove(); + }); + } }); - if($('#wall-item-pinned-' + id).length) + if($('#wall-item-pinned-' + id).length) { $.post('pin/pin', { 'id' : id }); + } return true; - } + } else { return false; } @@ -1730,3 +1737,30 @@ function makeid(length) { return result; } +function push_notification_request(e) { + if (!('Notification' in window)) { + alert('This browser does not support push notifications'); + } + else if (Notification.permission !== 'granted') { + Notification.requestPermission(function(permission) { + if(permission === 'granted') { + $(e.target).closest('div').hide(); + } + }); + } +} + + +function push_notification(title, body, href) { + let options = { + body: body, + data: href, + icon: '/images/hz-64.png', + silent: false + } + + let n = new Notification(title, options); + n.onclick = function (e) { + window.location.href = e.target.data; + } +} |