/** * Freeow! * Stylish, Growl-like message boxes * * Copyright (c) 2012 PJ Dietz * Version: 1.0.2 * Modified: 2012-05-03 * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * * http://pjdietz.com/jquery-plugins/freeow/ */ (function($){"use strict";var Freeow;Freeow=function(title,message,options){var startStyle,i,u;this.options=$.extend({},$.fn.freeow.defaults,options);this.element=$(this.options.template(title,message));if(this.options.startStyle){startStyle=this.options.startStyle;} else{startStyle=this.options.hideStyle;} this.element.css(startStyle);this.element.data("freeow",this);for(i=0,u=this.options.classes.length;i0){this.autoHide=true;self=this;delay=this.options.autoHideDelay;fn=function(){if(self.autoHide){self.hide();}};opts.complete=function(){setTimeout(fn,delay);};} this.element.animate(this.options.showStyle,opts);},hide:function(){var self=this;this.element.animate(this.options.hideStyle,{duration:this.options.hideDuration,complete:function(){self.destroy();}});},destroy:function(){this.element.data("freeow",undefined);this.element.remove();}};if(typeof $.fn.freeow==="undefined"){$.fn.extend({freeow:function(title,message,options){return this.each(function(){var f;f=new Freeow(title,message,options);f.attach(this);});}});$.fn.freeow.defaults={autoHide:true,autoHideDelay:3000,classes:[],prepend:true,startStyle:null,showStyle:{opacity:1.0},showDuration:250,hideStyle:{opacity:0.0},hideDuration:500,onClick:function(event){$(this).data("freeow").hide();},onHover:function(event){$(this).data("freeow").autoHide=false;},template:function(title,message){var e;e=['
','
','
','

'+title+'

','

'+message+'

','
','
','','','
'].join("");return e;}};}}(jQuery));