MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / showNotification

Function showNotification

samples/notification/notification.js:20–35  ·  view source on GitHub ↗
(title, text, onActiviation, onDismissal)

Source from the content-addressed store, hash-verified

18
19// A Helper function for showing notifications
20function showNotification(title, text, onActiviation, onDismissal) {
21
22 var toastXml = new xml.XmlDocument();
23 toastXml.loadXml(util.format(msgTemplate, title, text));
24 var toast = new notifications.ToastNotification(toastXml);
25
26 toast.on("activated", function (sender, eventArgs) {
27 onActiviation();
28 });
29
30 toast.on("dismissed", function () {
31 onDismissal();
32 });
33
34 notifications.ToastNotificationManager.createToastNotifier(appId).show(toast);
35}
36
37showNotification('Hello NodeRT!', 'Please click here', function() {
38 console.info('got event: toast activated!');

Callers 1

notification.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected