| 12345678910111213 |
- /**
- * Growl Notification system in CSS3
- *
- * @namespace LUNGO.Sugar
- * @class Growl
- * @version 1.1
- *
- * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
- */
- LUNGO.Sugar.Growl=function(c,j){var m=[],f={BODY:"body",GROWL:".growl",MODAL:".growl .modal",NOTIFY:".growl .notify",MODAL_HREF:".growl .modal a"},e={VISIBLE:"visible",SHOW:"show",WORKING:"working",INPUT:"input"},o=function(){n(f.MODAL);n(f.NOTIFY);setTimeout(function(){c.dom(f.GROWL).style("display","none")},300)},k=function(a){var b=c.dom(f.GROWL);b.style("display")==="none"&&b.show();a&&b.addClass("modal")},q=function(a){for(var b="",d=0,g=a.length;d<g;d++){b=b;var i="growl_option_"+d;i=i!==j?
- 'id="'+i+'"':"";b=b+('<a href="#" '+i+' class="button '+a[d].color+'"><span class="icon '+a[d].icon+'"></span>'+a[d].name+"</a>")}return b},p=function(a,b){if(a!=j&&a!=0){if(b===j)b="LUNGO.Sugar.Growl.hide()";setTimeout(b,a*1E3)}},n=function(a){a=c.dom(a);a.hasClass(e.SHOW)&&a.removeClass(e.SHOW)};c.dom(f.BODY).append('<div class="growl"><div class="modal"></div><div class="notify"></div></div>');(function(){c.dom(f.NOTIFY).bind("click",function(){c.dom(f.NOTIFY).removeClass(e.SHOW)});c.dom(".growl .modal a").tap(function(a){if(c.dom(this).attr("id")!==
- ""){id=c.dom(this).attr("id").replace(/growl_option_/g,"");setTimeout(m[id].callback,100)}else{a.preventDefault();o();return false}})})();return{show:function(a,b,d,g,i,l){k(true);var h=c.dom(f.MODAL);h.removeClass(e.SHOW);h.removeClass(e.INPUT);h.html('<span class="big icon '+d+'"></span><strong>'+a+"</strong><small>"+b+"</small>");g?h.addClass(e.WORKING):h.removeClass(e.WORKING);h.show().addClass(e.SHOW);p(i,l)},hide:o,notify:function(a,b,d,g,i,l){k(false);var h=c.dom(f.NOTIFY);g&&h.addClass(g);
- h.html('<span class="icon '+d+'"></span><strong>'+a+"</strong><br/><small>"+b+"</small>");setTimeout(function(){h.addClass(e.SHOW)},300);p(i,l)},option:function(a,b){k(true);m=b;var d=q(b),g=c.dom(f.MODAL);g.removeClass(e.WORKING).removeClass(e.SHOW);g.addClass("input").html("<strong>"+a+"</strong>"+d).show();setTimeout(function(){g.addClass("show")},300)},loading:function(){}}}(LUNGO);
|