3 var WindowNotification = window.Notification;
4 var cdn = require('gitter-web-cdn');
6 function showDesktopNotification(message, callback) {
7 var title = message.title;
8 var text = message.text;
9 var icon = message.icon || cdn('images/icon-logo-red-64.png');
11 var notification = new WindowNotification(title, { body: text, icon: icon });
13 var timeout = setTimeout(function() {
14 notification.onclick = null;
18 notification.onclick = function() {
19 clearTimeout(timeout);
20 notification.onclick = null;
27 module.exports = showDesktopNotification;