mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Added title to notification
This commit is contained in:
parent
21a0063756
commit
98e333cef9
@ -56,12 +56,34 @@ The following properties can be configured:
|
|||||||
|
|
||||||
|
|
||||||
## Developer notes
|
## Developer notes
|
||||||
The `message` and the `title` parameters accept text as well as html.
|
|
||||||
|
|
||||||
### Display notification
|
### Display notification
|
||||||
```
|
```
|
||||||
self.sendNotification("SHOW_NOTIFICATION", message);
|
self.sendNotification("SHOW_NOTIFICATION", {title: "Hello", message: "This is a test!"});
|
||||||
```
|
```
|
||||||
|
<table width="100%">
|
||||||
|
<!-- why, markdown... -->
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Option</th>
|
||||||
|
<th width="100%">Description</th>
|
||||||
|
</tr>
|
||||||
|
<thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><code>title</code></td>
|
||||||
|
<td>The title of the notification.<br>
|
||||||
|
<br><b>Possible values:</b> <code>text</code> or <code>html</code> as a <code>string</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>message</code></td>
|
||||||
|
<td>The message of the notification.<br>
|
||||||
|
<br><b>Possible values:</b> <code>text</code> or <code>html</code> as a <code>string</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
### Display alert
|
### Display alert
|
||||||
```
|
```
|
||||||
|
@ -23,6 +23,7 @@ Module.register('alert',{
|
|||||||
return ['ns-default.css', 'sweetalert.css'];
|
return ['ns-default.css', 'sweetalert.css'];
|
||||||
},
|
},
|
||||||
show_notification: function (message) {
|
show_notification: function (message) {
|
||||||
|
message = "<font size='4px' color='#4A4A4A'>" + message.title + "</font><br /><font size='5px'>" + message.message + "</font>"
|
||||||
new NotificationFx({
|
new NotificationFx({
|
||||||
message : message,
|
message : message,
|
||||||
layout : "growl",
|
layout : "growl",
|
||||||
@ -62,7 +63,7 @@ Module.register('alert',{
|
|||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
if (this.config.welcome_message){
|
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);
|
Log.info('Starting module: ' + this.name);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user