/*! * SunHater Circle Loader v0.2 (2013-12-28) * jQuery plugin * Copyright (c) 2014 Pavel Tzonkov * Dual licensed under the MIT and GPL licenses. * http://opensource.org/licenses/MIT * http://www.gnu.org/licenses/gpl.html */ (function(a){a.fn.shCircleLoader=function(i,e){var m="shcl",c=1,d=a(this);if(i==="destroy"){d.find("."+m).detach();return}else{if((i==="progress")&&(typeof e!=="undefined")){d.each(function(){var s=a(this),q=s.find("."+m);if(!q.get(0)){return}if(!s.find("span").get(0)){q.append("")}var r=q.find("span").last();r.html(e).css({position:"absolute",display:"block",left:Math.round((q.width()-r.width())/2)+"px",top:Math.round((q.height()-r.height())/2)+"px"})});return}}o={namespace:m,radius:"auto",dotsRadius:"auto",color:"auto",dots:12,duration:1,clockwise:true,externalCss:false,keyframes:"0%{{prefix}transform:scale(1)}80%{{prefix}transform:scale(.3)}100%{{prefix}transform:scale(1)}",uaPrefixes:["o","ms","webkit","moz",""]};a.extend(o,i);var n=o.color,l=o.namespace,k=o.dots,f=o.externalCss,b=o.uaPrefixes,p=function(q){return q.replace(/(.*)px$/i,"$1")},j=function(t){var r,s,q="";for(r=0;r'+j("@{prefix}keyframes "+l+c+"_bounce{"+g+"}")+"")}d.each(function(){var q,u,z,s,D,F,E,A,w,C,B={},t=a(this),v=t.find("."+m);if(v.get(0)){v.shCircleLoader("destroy")}t.html('
');if(f){t=t.find("div")}F=t.innerWidth()-p(t.css("padding-left"))-p(t.css("padding-right"));E=t.innerHeight()-p(t.css("padding-top"))-p(t.css("padding-bottom"));q=(o.radius=="auto")?((F");if(f&&(typeof u==="undefined")){u=(p(t.find("div").css("width"))/2)}s=t.find("div").last();A=(o.duration/k)*z;D=(2*Math.PI*z)/k;w=q-u;F=w*Math.sin(D);E=w*Math.cos(D);if(o.clockwise){E=-E}C={left:Math.round(F+w)+"px",top:Math.round(E+w)+"px"};if(A){a.extend(C,h("animation-delay",A+"s"))}a.extend(C,B);s.css(C)}})}})(jQuery);