Feature for desktop-notifications

This commit is contained in:
FlxAlbroscheit 2015-03-31 02:10:36 +02:00
parent 001e940c6c
commit d2261397d9

View File

@ -182,6 +182,18 @@
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>"); text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen')); html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html); nnm.append(html);
if(e.text().search('&rarr;') == 0) {
var notification = new Notification(document.title, {
body: e.text().replace('&rarr; ',''),
icon: e.attr('photo')
});
// TODO (yet unsupported by most browsers):
// Implement notification.onclick()
notifyMarkAll();
}
}); });
$("img[data-src]", nnm).each(function(i, el){ $("img[data-src]", nnm).each(function(i, el){