Meteor-Coffee-Alerts
A pattern to display application alerts via a bootstrap alert to the user written in coffeescript.
This is based on the sample from the [Discover Meteor book] (http://www.discovermeteor.com) and built using coffeescript.
##Install
Install via atmosphere.
mrt add pfafman:coffee-alerts
##Usage
Include the following in your template:
{{> coffeeAlerts}}
To display an alert
1CoffeeAlerts.alert(message, type)
Add this into a routing filter or somewhere else to clear the alerts that a user has seen.
1CoffeeAlerts.clearSeen()
Shortcuts
1CoffeeAlerts.error(message) # A bootstrap3 "danger" alert 2 3CoffeeAlerts.warning(message) # A bootstrap3 "warning" alert 4 5CoffeeAlerts.info(message) # A bootstrap3 "info" alert 6 7CoffeeAlerts.success(message) # A bootstrap3 "success" alert
##Options
CoffeeAlerts.timeout = 5 # Change timeout in seconds. # Does not effect CSS timeout
##Notes
This is based on the example from the [Discover Meteor book] (http://www.discovermeteor.com) and there are other repos with similar code. I have added this to atmosphere in able to use it easily in a number of my other projects.