]> git.mxchange.org Git - friendica.git/commitdiff
Feature for desktop-notifications
authorFlxAlbroscheit <felix@artplantation.de>
Tue, 31 Mar 2015 00:10:36 +0000 (02:10 +0200)
committerFlxAlbroscheit <felix@artplantation.de>
Tue, 31 Mar 2015 00:10:36 +0000 (02:10 +0200)
js/main.js

index 5f4b56f4d856ec0793f5502fc31d6ec4cb03e6e7..53608024c966ce2e3df5dfc6b6168326b8b7f716 100644 (file)
                                        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'));
                                        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){