mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-03 05:22:26 +08:00
4cc2207513
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
2 lines
No EOL
2.2 KiB
JavaScript
2 lines
No EOL
2.2 KiB
JavaScript
/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
|
|
!function(a){function b(){var b=this;b.el=null,b.done=!1,b.progress=0,b.addInterval=0,b.addSpeed=3,b.stopProgress=100,b.interval=a.setInterval(function(){var c=b.build();c&&a.clearInterval(b.interval)},100)}if(b.prototype.startAddInterval=function(){var b=this;b.stopAddInterval(),b.addInterval=a.setInterval(function(){0<b.progress&&b.stopProgress>b.progress&&b.add(b.addSpeed)},500)},b.prototype.stopAddInterval=function(){a.clearInterval(this.addInterval),this.addInterval=0},b.prototype.build=function(){if(null===this.el){var a=document.querySelector("body");a&&(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>',a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el))}return this.el},b.prototype.reset=function(){return this.progress=0,this.render()},b.prototype.update=function(b){var c=a.parseInt(b,10);return c>this.progress&&(this.progress=c,this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress),this.render()},b.prototype.add=function(b){return this.progress+=a.parseInt(b,10),this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress,this.render()},b.prototype.setSpeed=function(a,b){this.addSpeed=a,this.stopProgress=b||100},b.prototype.render=function(){var b=this.build();b&&b.children&&b.children[0]&&b.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),b.className=b.className.replace("simple-pace-inactive",""),b.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),a.setTimeout(function(){b.className=b.className.replace("simple-pace-active",""),b.className+=" simple-pace-inactive"},500))},!a.SimplePace){var c=new b;a.SimplePace={sleep:function(){c.setSpeed(2,95)},set:function(a){c.update(a)},add:function(a){c.add(a)}}}}(window); |