| 74 | |
| 75 | // NW.JS Notification |
| 76 | var showNotification = function (icon, title, body) { |
| 77 | if (icon && icon.match(/^\./)) { |
| 78 | icon = icon.replace('.', 'file://' + process.cwd()); |
| 79 | } |
| 80 | |
| 81 | var notification = new Notification(title, {icon: icon, body: body}); |
| 82 | |
| 83 | notification.onclick = function () { |
| 84 | writeLog("Notification clicked"); |
| 85 | }; |
| 86 | |
| 87 | notification.onclose = function () { |
| 88 | writeLog("Notification closed"); |
| 89 | NW.Window.get().focus(); |
| 90 | }; |
| 91 | |
| 92 | notification.onshow = function () { |
| 93 | writeLog("-----<br>" + title); |
| 94 | }; |
| 95 | |
| 96 | return notification; |
| 97 | } |
| 98 | |
| 99 | // NODE-NOTIFIER |
| 100 | var showNativeNotification = function (icon, title, message, sound, image) { |