diff --git a/jquery.jgrowl.css b/jquery.jgrowl.css index 1638fbf..32bafff 100755 --- a/jquery.jgrowl.css +++ b/jquery.jgrowl.css @@ -3,6 +3,7 @@ div.jGrowl { padding: 10px; z-index: 9999; color: #fff; + font-size: 12px; } /** Special IE6 Style Positioning **/ @@ -78,14 +79,15 @@ div.center div.jGrowl-notification, div.center div.jGrowl-closer { div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { background-color: #000; opacity: .85; - filter: alpha(opacity = 85); + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); zoom: 1; width: 235px; padding: 10px; margin-top: 5px; margin-bottom: 5px; font-family: Tahoma, Arial, Helvetica, sans-serif; - font-size: 12px; + font-size: 1em; text-align: left; display: none; -moz-border-radius: 5px; @@ -98,23 +100,22 @@ div.jGrowl div.jGrowl-notification { div.jGrowl div.jGrowl-notification div.header { font-weight: bold; - font-size: 10px; + font-size: .85em; } div.jGrowl div.jGrowl-notification div.close { z-index: 99; float: right; font-weight: bold; - font-size: 12px; + font-size: 1em; cursor: pointer; } div.jGrowl div.jGrowl-closer { - height: 15px; padding-top: 4px; padding-bottom: 4px; cursor: pointer; - font-size: 11px; + font-size: .9em; font-weight: bold; text-align: center; } diff --git a/jquery.jgrowl.js b/jquery.jgrowl.js index 6db9f4b..97d8d05 100755 --- a/jquery.jgrowl.js +++ b/jquery.jgrowl.js @@ -1,11 +1,11 @@ /** - * jGrowl 1.2.3 + * jGrowl 1.2.4 * * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Written by Stan Lemon - * Last updated: 2009.11.13 + * Last updated: 2009.12.13 * * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These * notifications function similarly to the Growl Framework available for @@ -14,6 +14,12 @@ * To Do: * - Move library settings to containers and allow them to be changed per container * + * Changes in 1.2.4 + * - Fixed IE bug with the close-all button + * - Fixed IE bug with the filter CSS attribute (special thanks to gotwic) + * - Update IE opacity CSS + * - Changed font sizes to use "em", and only set the base style + * * Changes in 1.2.3 * - The callbacks no longer use the container as context, instead they use the actual notification * - The callbacks now receive the container as a parameter after the options parameter @@ -206,6 +212,10 @@ } $(this).animate(o.animateOpen, o.speed, 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'); + $(this).data("jGrowl").created = new Date(); }); } @@ -217,8 +227,9 @@ $(this).data('jGrowl.pause', true); $(this).animate(o.animateClose, o.speed, o.easing, function() { $(this).remove(); + var close = o.close.apply( notification , [notification,message,o,self.element] ); - if ( (close = o.close.apply( notification , [notification,message,o,self.element] )) && $.isFunction(close) ) + if ( $.isFunction(close) ) close.apply( notification , [notification,message,o,self.element] ); }); }).trigger('jGrowl.beforeOpen'); diff --git a/jquery.jgrowl_compressed.js b/jquery.jgrowl_compressed.js index 1cf30f3..579f9b1 100644 --- a/jquery.jgrowl_compressed.js +++ b/jquery.jgrowl_compressed.js @@ -11,7 +11,7 @@ var _6=arguments; return this.each(function(){ var _7=this; if($(this).data("jGrowl.instance")==undefined){ -$(this).data("jGrowl.instance",new $.fn.jGrowl()); +$(this).data("jGrowl.instance",$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null})); $(this).data("jGrowl.instance").startup(this); } if($.isFunction($(this).data("jGrowl.instance")[m])){ @@ -29,39 +29,56 @@ $.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:false },close:function(e,m,o){ },animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(_17,o){ var o=$.extend({},this.defaults,o); -this.notifications[this.notifications.length]={message:_17,options:o}; +this.notifications.push({message:_17,options:o}); o.log.apply(this.element,[this.element,_17,o]); },render:function(_19){ var _1a=this; var _1b=_19.message; var o=_19.options; -var _19=$("
"+o.closeTemplate+"
"+o.header+"
"+_1b+"
").data("jGrowl",o).addClass(o.theme).children("div.close").bind("click.jGrowl",function(){ +var _19=$("
"+"
"+o.closeTemplate+"
"+"
"+o.header+"
"+"
"+_1b+"
").data("jGrowl",o).addClass(o.theme).children("div.close").bind("click.jGrowl",function(){ $(this).parent().trigger("jGrowl.close"); }).parent(); -(o.glue=="after")?$("div.jGrowl-notification:last",this.element).after(_19):$("div.jGrowl-notification:first",this.element).before(_19); $(_19).bind("mouseover.jGrowl",function(){ -$(this).data("jGrowl").pause=true; +$("div.jGrowl-notification",_1a.element).data("jGrowl.pause",true); }).bind("mouseout.jGrowl",function(){ -$(this).data("jGrowl").pause=false; +$("div.jGrowl-notification",_1a.element).data("jGrowl.pause",false); }).bind("jGrowl.beforeOpen",function(){ -o.beforeOpen.apply(_1a.element,[_1a.element,_1b,o]); +if(o.beforeOpen.apply(_19,[_19,_1b,o,_1a.element])!=false){ +$(this).trigger("jGrowl.open"); +} }).bind("jGrowl.open",function(){ -o.open.apply(_1a.element,[_1a.element,_1b,o]); +if(o.open.apply(_19,[_19,_1b,o,_1a.element])!=false){ +if(o.glue=="after"){ +$("div.jGrowl-notification:last",_1a.element).after(_19); +}else{ +$("div.jGrowl-notification:first",_1a.element).before(_19); +} +$(this).animate(o.animateOpen,o.speed,o.easing,function(){ +if($.browser.msie&&(parseInt($(this).css("opacity"),10)===1||parseInt($(this).css("opacity"),10)===0)){ +this.style.removeAttribute("filter"); +} +$(this).data("jGrowl").created=new Date(); +}); +} }).bind("jGrowl.beforeClose",function(){ -o.beforeClose.apply(_1a.element,[_1a.element,_1b,o]); +if(o.beforeClose.apply(_19,[_19,_1b,o,_1a.element])!=false){ +$(this).trigger("jGrowl.close"); +} }).bind("jGrowl.close",function(){ -$(this).trigger("jGrowl.beforeClose").animate(o.animateClose,o.speed,o.easing,function(){ +$(this).data("jGrowl.pause",true); +$(this).animate(o.animateClose,o.speed,o.easing,function(){ $(this).remove(); -o.close.apply(_1a.element,[_1a.element,_1b,o]); +var _1d=o.close.apply(_19,[_19,_1b,o,_1a.element]); +if($.isFunction(_1d)){ +_1d.apply(_19,[_19,_1b,o,_1a.element]); +} }); -}).trigger("jGrowl.beforeOpen").animate(o.animateOpen,o.speed,o.easing,function(){ -$(this).data("jGrowl").created=new Date(); -}).trigger("jGrowl.open"); +}).trigger("jGrowl.beforeOpen"); if($.fn.corner!=undefined){ $(_19).corner(o.corners); } -if($("div.jGrowl-notification:parent",this.element).size()>1&&$("div.jGrowl-closer",this.element).size()==0&&this.defaults.closer!=false){ -$(this.defaults.closerTemplate).addClass("jGrowl-closer").addClass(this.defaults.theme).appendTo(this.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){ +if($("div.jGrowl-notification:parent",_1a.element).size()>1&&$("div.jGrowl-closer",_1a.element).size()==0&&this.defaults.closer!=false){ +$(this.defaults.closerTemplate).addClass("jGrowl-closer ui-state-highlight ui-corner-all").addClass(this.defaults.theme).appendTo(_1a.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){ $(this).siblings().children("div.close").trigger("click.jGrowl"); if($.isFunction(_1a.defaults.closer)){ _1a.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]); @@ -70,8 +87,8 @@ _1a.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]); } },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()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){ -$(this).trigger("jGrowl.close"); +if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){ +$(this).trigger("jGrowl.beforeClose"); } }); if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find("div.jGrowl-notification:parent").size()"); this.interval=setInterval(function(){ -jQuery(e).data("jGrowl.instance").update(); +$(e).data("jGrowl.instance").update(); },this.defaults.check); if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){ $(this.element).addClass("ie6"); @@ -93,6 +110,10 @@ $(this.element).addClass("ie6"); },shutdown:function(){ $(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"); +}); }}); $.jGrowl.defaults=$.fn.jGrowl.prototype.defaults; })(jQuery); diff --git a/jquery.jgrowl_minimized.js b/jquery.jgrowl_minimized.js index 09ddc88..02503a0 100644 --- a/jquery.jgrowl_minimized.js +++ b/jquery.jgrowl_minimized.js @@ -1,4 +1,9 @@ - -(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)$('
').addClass($.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',new $.fn.jGrowl());$(this).data('jGrowl.instance').startup(this);} -if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'
[ close all ]
',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);this.notifications[this.notifications.length]={message:message,options:o};o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('
'+o.closeTemplate+'
'+o.header+'
'+message+'
').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();(o.glue=='after')?$('div.jGrowl-notification:last',this.element).after(notification):$('div.jGrowl-notification:first',this.element).before(notification);$(notification).bind("mouseover.jGrowl",function(){$(this).data("jGrowl").pause=true;}).bind("mouseout.jGrowl",function(){$(this).data("jGrowl").pause=false;}).bind('jGrowl.beforeOpen',function(){o.beforeOpen.apply(self.element,[self.element,message,o]);}).bind('jGrowl.open',function(){o.open.apply(self.element,[self.element,message,o]);}).bind('jGrowl.beforeClose',function(){o.beforeClose.apply(self.element,[self.element,message,o]);}).bind('jGrowl.close',function(){$(this).trigger('jGrowl.beforeClose').animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();o.close.apply(self.element,[self.element,message,o]);});}).trigger('jGrowl.beforeOpen').animate(o.animateOpen,o.speed,o.easing,function(){$(this).data("jGrowl").created=new Date();}).trigger('jGrowl.open');if($.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',this.element).size()>1&&$('div.jGrowl-closer',this.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer').addClass(this.defaults.theme).appendTo(this.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer))self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);});};},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()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){$(this).trigger('jGrowl.close');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()');this.interval=setInterval(function(){jQuery(e).data('jGrowl.instance').update();},this.defaults.check);if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"])$(this.element).addClass('ie6');},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file +(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0) +$('
').addClass($.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);} +if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'
[ close all ]
',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);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;var o=notification.options;var notification=$('
'+'
'+o.closeTemplate+'
'+'
'+o.header+'
'+'
'+message+'
').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);} +$(this).animate(o.animateOpen,o.speed,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0)) +this.style.removeAttribute('filter');$(this).data("jGrowl").created=new Date();});}}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false) +$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();var close=o.close.apply(notification,[notification,message,o,self.element]);if($.isFunction(close)) +close.apply(notification,[notification,message,o,self.element]);});}).trigger('jGrowl.beforeOpen');if($.fn.corner!=undefined)$(notification).corner(o.corners);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 ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},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()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},this.defaults.check);if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(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');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file