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);

NOTE: The click event gets applied to the button Callback

Loading Message

Arguments for Loading:

var args_loading = {
	type: "loading",
	title: "Loading, Please Wait",
	dismissable: true
}

Create Message:

stat.message.create(args_loading);


Message Styles

Messages

Default Message

Second Paragraph

Error

Oh no! We can't continue until the user does the following to their form:

Alert

This isn't going to break the page, but it's probably important that the user reads it.

Success

Well done!

Money

This is an amount due!

Print this Page

Here are some instructions on how to print this page for your records.

Download Your Record

Here are some instructions on how to download whatever they just did.

Messages in a Section

Messages

Default Message

Second Paragraph

Test