1.2.0 • Published 10 years ago
coins-notify v1.2.0
coins-notify
show notifications in the browser. attempts to use 'growl' like notifications first, but falls back on notifyjs (jQuery plugin) if the browser user has not accepted (or has denied) growl like notifications.
usage
Note: if jQuery fallback is being used, jQuery && notifyjs must be loaded onto the window. This module does not address those dependencies.
var Notify = require('coins-notify');
var notifier = new Notifier();
// show a notification
notifier.push({
body: 'test!',
className: 'info'
});default, os/growl mode
fallback mode
api
Notify(opts) constructor
opts
type: object
maxQueuenumber number of messages to internally retain history over. not persistent accross browser sessions. SeenotifyInstance.queuefor history
push(opts)
opts
type: object
body* string text shown in notification bodyclassNamestring class name applied. Supported classNames are those supported in notifyjs (alt mode only)alt/alternative/fallbackboolean force the notifier to use the notifyjs fallbackiconstring absolute url to icon (default mode only)tagstring tag!timeoutnumber ms default, 5000, duration for notification to stay upnotifyShowfunction callbacknotifyClosefunction callbacknotifyClickfunction callbacknotifyErrorfunction callback
changelog
- 1.1.5 - improve fallback mode