MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / showNotification

Function showNotification

notifications/app.js:76–97  ·  view source on GitHub ↗
(icon, title, body)

Source from the content-addressed store, hash-verified

74
75// NW.JS Notification
76var 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
100var showNativeNotification = function (icon, title, message, sound, image) {

Callers 1

app.jsFile · 0.85

Calls 1

writeLogFunction · 0.70

Tested by

no test coverage detected