mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Added new option and licenses
This commit is contained in:
parent
e14010da35
commit
9c78af65e1
@ -9,14 +9,15 @@ modules: [
|
|||||||
{
|
{
|
||||||
module: 'alert',
|
module: 'alert',
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// style type: growl|attached|bar
|
||||||
// layout type: growl|attached|bar|other
|
style: "growl",
|
||||||
layout: "growl",
|
// effects for the specified style:
|
||||||
// effects for the specified layout:
|
// for growl style: scale|slide|genie|jelly
|
||||||
// for growl layout: scale|slide|genie|jelly
|
// for attached style: flip|bouncyflip
|
||||||
// for attached layout: flip|bouncyflip
|
// for bar style: slidetop|exploader
|
||||||
// for bar layout: slidetop|exploader
|
|
||||||
effect: "slide",
|
effect: "slide",
|
||||||
|
//time a notification is displayed
|
||||||
|
display_time: 3500,
|
||||||
//shown at startup
|
//shown at startup
|
||||||
welcome_message: "Welcome, start was successfull!"
|
welcome_message: "Welcome, start was successfull!"
|
||||||
}
|
}
|
||||||
@ -36,3 +37,30 @@ self.sendNotification("SHOW_NOTIFICATION", message);
|
|||||||
self.sendNotification("SHOW_ALERT", {title: "Hello", message: "This is a test!", type: "success", imageUrl:"url", imageSize: "50x50", timer:1000});
|
self.sendNotification("SHOW_ALERT", {title: "Hello", message: "This is a test!", type: "success", imageUrl:"url", imageSize: "50x50", timer:1000});
|
||||||
```
|
```
|
||||||
All parameters exept for `title` and `message` are optional. Possible types are `error`, `warning`, `info` and `success`. If you do not use the `timer` parameter, it is your responsibility to manually hide the alert by using `self.sendNotification("HIDE_ALERT");`!
|
All parameters exept for `title` and `message` are optional. Possible types are `error`, `warning`, `info` and `success`. If you do not use the `timer` parameter, it is your responsibility to manually hide the alert by using `self.sendNotification("HIDE_ALERT");`!
|
||||||
|
|
||||||
|
##Open Source Licenses
|
||||||
|
###[SweetAlert](http://t4t5.github.io/sweetalert/)
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014 Tristan Edwards
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
###[NotificationStyles](https://github.com/codrops/NotificationStyles)
|
||||||
|
See [ympanus.net](http://tympanus.net/codrops/licensing/) for license.
|
@ -9,13 +9,15 @@
|
|||||||
|
|
||||||
Module.register('alert',{
|
Module.register('alert',{
|
||||||
defaults: {
|
defaults: {
|
||||||
// layout type: growl|attached|bar
|
// style type: growl|attached|bar
|
||||||
layout: "growl",
|
style: "growl",
|
||||||
// effects for the specified layout:
|
// effects for the specified style:
|
||||||
// for growl layout: scale|slide|genie|jelly
|
// for growl style: scale|slide|genie|jelly
|
||||||
// for attached layout: flip|bouncyflip
|
// for attached style: flip|bouncyflip
|
||||||
// for bar layout: slidetop|exploader
|
// for bar style: slidetop|exploader
|
||||||
effect: "slide",
|
effect: "slide",
|
||||||
|
//time a notification is displayed
|
||||||
|
display_time: 3500,
|
||||||
//shown at startup
|
//shown at startup
|
||||||
welcome_message: "Welcome, start was successfull!"
|
welcome_message: "Welcome, start was successfull!"
|
||||||
},
|
},
|
||||||
@ -32,10 +34,9 @@ Module.register('alert',{
|
|||||||
}
|
}
|
||||||
this.alert = new NotificationFx({
|
this.alert = new NotificationFx({
|
||||||
message : message,
|
message : message,
|
||||||
layout : this.config.layout,
|
layout : this.config.style,
|
||||||
effect : this.config.effect,
|
effect : this.config.effect,
|
||||||
type : 'notice',
|
ttl: this.config.display_time
|
||||||
ttl: 6000
|
|
||||||
});
|
});
|
||||||
this.alert.show()
|
this.alert.show()
|
||||||
},
|
},
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
effect : 'slide',
|
effect : 'slide',
|
||||||
// notice, warning, error, success
|
// notice, warning, error, success
|
||||||
// will add class ns-type-warning, ns-type-error or ns-type-success
|
// will add class ns-type-warning, ns-type-error or ns-type-success
|
||||||
type : 'error',
|
type : 'notice',
|
||||||
// if the user doesn´t close the notification then we remove it
|
// if the user doesn´t close the notification then we remove it
|
||||||
// after the following time
|
// after the following time
|
||||||
ttl : 6000,
|
ttl : 6000,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user