diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index fbee5778..2afe63de 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -56,12 +56,34 @@ The following properties can be configured: ## Developer notes -The `message` and the `title` parameters accept text as well as html. ### Display notification ``` -self.sendNotification("SHOW_NOTIFICATION", message); +self.sendNotification("SHOW_NOTIFICATION", {title: "Hello", message: "This is a test!"}); ``` + + + + + + + + + + + + + + + + + + +
OptionDescription
titleThe title of the notification.
+
Possible values: text or html as a string +
messageThe message of the notification.
+
Possible values: text or html as a string +
### Display alert ``` diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 8af8259d..bab3927c 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -23,6 +23,7 @@ Module.register('alert',{ return ['ns-default.css', 'sweetalert.css']; }, show_notification: function (message) { + message = "" + message.title + "
" + message.message + "" new NotificationFx({ message : message, layout : "growl", @@ -62,7 +63,7 @@ Module.register('alert',{ }, start: function() { if (this.config.welcome_message){ - this.show_notification(this.config.welcome_message) + this.show_notification({title: "Welcome", message: this.config.welcome_message}) } Log.info('Starting module: ' + this.name); }