Messages and Alerts
Create Message | stat.message.create(args, location);
args object
* type: message (default), loading, progress (TODO)
* style: default, error, success, alert, money, print, download
* title: 'string'
* body: ['lorem ipsum', 'second paragraph']
* buttons: [{title: 'foo', style: 'submit', callback: 'success()'},...]
* dismissable: bool (default: true)
* timeout: milliseconds, none (default)
location: object | optional
Arguments for Message:
var args = {
type: "message",
title: "This is the Title",
style: "alert",
body: ["Hello World", "Line two text"],
buttons: [{title: 'bar', style: 'back'},{title: 'foo', style: 'submit', callback: callbackTest}],
dismissable: true
}
Example Callback Function:
var callbackTest = function() {
alert('callback: you clicked ' + e.target.id);
}
Create Message:
stat.message.create(args);
Loading Message
Arguments for Loading:
var args_loading = {
type: "loading",
title: "Loading, Please Wait",
dismissable: true
}
Create Message:
stat.message.create(args_loading);