snappymail/vendors/simple-pace/simple-pace-1.0.min.js
RainLoop Team 333c063cf1 Change build system (Grunt -> Gulp)
Remove attachments on reply (Closes #195)
Do not show deleted (flag \Deleted) messages (Closes #185)
Release commit
2014-06-16 23:56:11 +04:00

2 lines
No EOL
2.2 KiB
JavaScript

/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
!function(e){function s(){var s=this;s.el=null,s.done=!1,s.progress=0,s.addInterval=0,s.addSpeed=3,s.stopProgress=100,s.interval=e.setInterval(function(){var t=s.build();t&&e.clearInterval(s.interval)},100)}if(s.prototype.startAddInterval=function(){var s=this;s.stopAddInterval(),s.addInterval=e.setInterval(function(){0<s.progress&&s.stopProgress>s.progress&&s.add(s.addSpeed)},500)},s.prototype.stopAddInterval=function(){e.clearInterval(this.addInterval),this.addInterval=0},s.prototype.build=function(){if(null===this.el){var e=document.querySelector("body");e&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='<div class="simple-pace-progress"><div class="simple-pace-progress-inner"></div></div><div class="simple-pace-activity"></div>',e.firstChild?e.insertBefore(this.el,e.firstChild):e.appendChild(this.el))}return this.el},s.prototype.reset=function(){return this.progress=0,this.render()},s.prototype.update=function(s){var t=e.parseInt(s,10);return t>this.progress&&(this.progress=t,this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress),this.render()},s.prototype.add=function(s){return this.progress+=e.parseInt(s,10),this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress,this.render()},s.prototype.setSpeed=function(e,s){this.addSpeed=e,this.stopProgress=s||100},s.prototype.render=function(){var s=this.build();s&&s.children&&s.children[0]&&s.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),s.className=s.className.replace("simple-pace-inactive",""),s.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),e.setTimeout(function(){s.className=s.className.replace("simple-pace-active",""),s.className+=" simple-pace-inactive"},500))},!e.SimplePace){var t=new s;e.SimplePace={sleep:function(){t.setSpeed(2,95)},set:function(e){t.update(e)},add:function(e){t.add(e)}}}}(window);