Permalink
Browse files

Re-adds accidentally deleted file

  • Loading branch information...
1 parent dc4fa81 commit 779c84d689a8587fb868b93709642af1a1a2f3a3 @michaelhart michaelhart committed Apr 16, 2012
Showing with 26 additions and 26 deletions.
  1. +26 −26 jquery.jgrowl.js
View
52 jquery.jgrowl.js
@@ -7,7 +7,7 @@
* Written by Stan Lemon <stosh1985@gmail.com>
* Last updated: 2011.03.27
*
- * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These
+ * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These
* notifications function similarly to the Growl Framework available for
* Mac OS X (http://growl.info).
*
@@ -16,14 +16,14 @@
*
* Changes in 1.2.6
* - Fixed js error when a notification is opening and closing at the same time
- *
+ *
* Changes in 1.2.5
* - Changed wrapper jGrowl's options usage to "o" instead of $.jGrowl.defaults
* - Added themeState option to control 'highlight' or 'error' for jQuery UI
* - Ammended some CSS to provide default positioning for nested usage.
* - Changed some CSS to be prefixed with jGrowl- to prevent namespacing issues
- * - Added two new options - openDuration and closeDuration to allow
- * better control of notification open and close speeds, respectively
+ * - Added two new options - openDuration and closeDuration to allow
+ * better control of notification open and close speeds, respectively
* Patch contributed by Jesse Vincet.
* - Added afterOpen callback. Patch contributed by Russel Branca.
*
@@ -110,7 +110,7 @@
/** jGrowl Wrapper - Establish a base jGrowl Container for compatibility with older releases. **/
$.jGrowl = function( m , o ) {
// To maintain compatibility with older version that only supported one instance we'll create the base container.
- if ( $('#jGrowl').size() == 0 )
+ if ( $('#jGrowl').size() == 0 )
$('<div id="jGrowl"></div>').addClass( (o && o.position) ? o.position : $.jGrowl.defaults.position ).appendTo('body');
// Create a notification on the container.
@@ -156,7 +156,7 @@
themeState: 'highlight',
corners: '10px',
check: 250,
- life: 3000,
+ life: 5000,
closeDuration: 'normal',
openDuration: 'normal',
easing: 'swing',
@@ -176,15 +176,15 @@
opacity: 'hide'
}
},
-
+
notifications: [],
-
+
/** jGrowl Container Node **/
element: null,
-
+
/** Interval Function **/
interval: null,
-
+
/** Create a Notification **/
create: function( message , o ) {
var o = $.extend({}, this.defaults, o);
@@ -196,10 +196,10 @@
}
this.notifications.push({ message: message , options: o });
-
+
o.log.apply( this.element , [this.element,message,o] );
},
-
+
render: function( notification ) {
var self = this;
var message = notification.message;
@@ -209,7 +209,7 @@
o.themeState = (o.themeState == '') ? '' : 'ui-state-' + o.themeState;
var notification = $(
- '<div class="jGrowl-notification ' + o.themeState + ' ui-corner-all' +
+ '<div class="jGrowl-notification ' + o.themeState + ' ui-corner-all' +
((o.group != undefined && o.group != '') ? ' ' + o.group : '') + '">' +
'<div class="jGrowl-close">' + o.closeTemplate + '</div>' +
'<div class="jGrowl-header">' + o.header + '</div>' +
@@ -235,15 +235,15 @@
} else {
$('div.jGrowl-notification:first', self.element).before(notification);
}
-
+
$(this).animate(o.animateOpen, o.openDuration, o.easing, function() {
// Fixes some anti-aliasing issues with IE filters.
if ($.browser.msie && (parseInt($(this).css('opacity'), 10) === 1 || parseInt($(this).css('opacity'), 10) === 0))
this.style.removeAttribute('filter');
if ( $(this).data("jGrowl") != null ) // Happens when a notification is closing before it's open.
$(this).data("jGrowl").created = new Date();
-
+
$(this).trigger('jGrowl.afterOpen');
});
}
@@ -264,12 +264,12 @@
}
});
}).trigger('jGrowl.beforeOpen');
-
+
/** Optional Corners Plugin **/
if ( o.corners != '' && $.fn.corner != undefined ) $(notification).corner( o.corners );
/** Add a Global Closer if more than one notification exists **/
- if ( $('div.jGrowl-notification:parent', self.element).size() > 1 &&
+ if ( $('div.jGrowl-notification:parent', self.element).size() > 1 &&
$('div.jGrowl-closer', self.element).size() == 0 && this.defaults.closer != false ) {
$(this.defaults.closerTemplate).addClass('jGrowl-closer ' + this.defaults.themeState + ' ui-corner-all').addClass(this.defaults.theme)
.appendTo(self.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing)
@@ -286,17 +286,17 @@
/** Update the jGrowl Container, removing old jGrowl notifications **/
update: function() {
$(this.element).find('div.jGrowl-notification:parent').each( function() {
- if ( $(this).data("jGrowl") != undefined && $(this).data("jGrowl").created != undefined &&
- ($(this).data("jGrowl").created.getTime() + parseInt($(this).data("jGrowl").life)) < (new Date()).getTime() &&
- $(this).data("jGrowl").sticky != true &&
+ if ( $(this).data("jGrowl") != undefined && $(this).data("jGrowl").created != undefined &&
+ ($(this).data("jGrowl").created.getTime() + parseInt($(this).data("jGrowl").life)) < (new Date()).getTime() &&
+ $(this).data("jGrowl").sticky != true &&
($(this).data("jGrowl.pause") == undefined || $(this).data("jGrowl.pause") != true) ) {
// Pause the notification, lest during the course of animation another close event gets called.
$(this).trigger('jGrowl.beforeClose');
}
});
- if ( this.notifications.length > 0 &&
+ if ( this.notifications.length > 0 &&
(this.defaults.pool == 0 || $(this.element).find('div.jGrowl-notification:parent').size() < this.defaults.pool) )
this.render( this.notifications.shift() );
@@ -310,10 +310,10 @@
/** Setup the jGrowl Notification Container **/
startup: function(e) {
this.element = $(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');
- this.interval = setInterval( function() {
- $(e).data('jGrowl.instance').update();
+ this.interval = setInterval( function() {
+ $(e).data('jGrowl.instance').update();
}, parseInt(this.defaults.check));
-
+
if ($.browser.msie && parseInt($.browser.version) < 7 && !window["XMLHttpRequest"]) {
$(this.element).addClass('ie6');
}
@@ -324,14 +324,14 @@
$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();
clearInterval( this.interval );
},
-
+
close: function() {
$(this.element).find('div.jGrowl-notification').each(function(){
$(this).trigger('jGrowl.beforeClose');
});
}
});
-
+
/** Reference the Defaults Object for compatibility with older versions of jGrowl **/
$.jGrowl.defaults = $.fn.jGrowl.prototype.defaults;

0 comments on commit 779c84d

Please sign in to comment.