(function($){
/**
* Notify
*
* Create the class and pass it the settings and the parent scope
*
* @param settings object Contains the global options for the notifications container
*/
$.fn.notify = function( settings ) {
return new notify( this, settings );
}
/**
* Show
*
* Create a new notification
*
* @param message string Contains the message for the notification
* @param options object Contains the settings for the notification
*/
notify.prototype.show = function( message, options ) {
// Settings specific for the notification
// speed, delay, easing, effect and removeIcon are inherited by the global settings
var opts = $.extend({
id: 'note-' + this.notes++,
type: false,
title: false,
message: message,
sticky: false,
speed: this.sets.speed,
delay: this.sets.delay,
easing: this.sets.easing,
effect: this.sets.effect,
icon: false,
removeIcon: this.sets.removeIcon,
}, options);
// New notification is created
note = $('
')
.addClass('note')
.addClass( opts.type ? 'note-' + opts.type : opts.type )
.addClass( opts.id );
// Icon is attached to the new notification if one is specified
if ( opts.icon )
note.append( $('')
.addClass('image')
.html( $( opts.icon ) ) );
// Remove button for the notification is added
note.append( $('