Sindbad~EG File Manager
(function(){var AjaxMonitor,Bar,DocumentMonitor,ElementMonitor,ElementTracker,EventLagMonitor,Evented,Events,NoTargetError,Pace,RequestIntercept,SOURCE_KEYS,Scaler,SocketRequestTracker,XHRRequestTracker,addEventListener,animation,avgAmplitude,bar,cancelAnimation,cancelAnimationFrame,defaultOptions,extend,extendNative,getFromDOM,getIntercept,handlePushState,ignoreStack,init,now,options,requestAnimationFrame,result,runAnimation,scalers,shouldIgnoreURL,shouldTrack,source,sources,uniScaler,_WebSocket,_XDomainRequest,_XMLHttpRequest,_i,_intercept,_len,_pushState,_ref,_replaceState,__slice=[].slice,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);function ctor(){this.constructor=child}return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++)if(i in this&&this[i]===item)return i;return-1},__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};for(defaultOptions={className:"",catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},now=function(){var _ref;return null!=(_ref="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?_ref:+new Date},requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame,addEventListener=function(obj,event,callback){return"function"==typeof obj.addEventListener?obj.addEventListener(event,callback,!1):function(){if("function"!=typeof obj["on"+event]||"object"!=typeof obj["on"+event].eventListeners){var eventListeners=new Events;"function"==typeof obj["on"+event]&&eventListeners.on(event,obj["on"+event]),obj["on"+event]=function(evt){return eventListeners.trigger(event,evt)},obj["on"+event].eventListeners=eventListeners}else eventListeners=obj["on"+event].eventListeners;eventListeners.on(event,callback)}()},null==requestAnimationFrame&&(requestAnimationFrame=function(fn){return setTimeout(fn,50)},cancelAnimationFrame=function(id){return clearTimeout(id)}),runAnimation=function(fn){var last,tick;return last=now(),(tick=function(){var diff;return(diff=now()-last)>=33?(last=now(),fn(diff,(function(){return requestAnimationFrame(tick)}))):setTimeout(tick,33-diff)})()},result=function(){var args,key,obj;return obj=arguments[0],key=arguments[1],args=3<=arguments.length?__slice.call(arguments,2):[],"function"==typeof obj[key]?obj[key].apply(obj,args):obj[key]},extend=function(){var key,out,source,sources,val,_i,_len;for(out=arguments[0],_i=0,_len=(sources=2<=arguments.length?__slice.call(arguments,1):[]).length;_i<_len;_i++)if(source=sources[_i])for(key in source)__hasProp.call(source,key)&&(val=source[key],null!=out[key]&&"object"==typeof out[key]&&null!=val&&"object"==typeof val?extend(out[key],val):out[key]=val);return out},avgAmplitude=function(arr){var count,sum,v,_i,_len;for(sum=count=0,_i=0,_len=arr.length;_i<_len;_i++)v=arr[_i],sum+=Math.abs(v),count++;return sum/count},getFromDOM=function(key,json){var data,e,el;if(null==key&&(key="options"),null==json&&(json=!0),el=document.querySelector("[data-pace-"+key+"]")){if(data=el.getAttribute("data-pace-"+key),!json)return data;try{return JSON.parse(data)}catch(_error){return e=_error,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",e):void 0}}},Evented=function(){function Evented(){}return Evented.prototype.on=function(event,handler,ctx,once){var _base;return null==once&&(once=!1),null==this.bindings&&(this.bindings={}),null==(_base=this.bindings)[event]&&(_base[event]=[]),this.bindings[event].push({handler:handler,ctx:ctx,once:once})},Evented.prototype.once=function(event,handler,ctx){return this.on(event,handler,ctx,!0)},Evented.prototype.off=function(event,handler){var i,_ref,_results;if(null!=(null!=(_ref=this.bindings)?_ref[event]:void 0)){if(null==handler)return delete this.bindings[event];for(i=0,_results=[];i<this.bindings[event].length;)this.bindings[event][i].handler===handler?_results.push(this.bindings[event].splice(i,1)):_results.push(i++);return _results}},Evented.prototype.trigger=function(){var args,ctx,event,handler,i,once,_ref,_ref1,_results;if(event=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],null!=(_ref=this.bindings)?_ref[event]:void 0){for(i=0,_results=[];i<this.bindings[event].length;)handler=(_ref1=this.bindings[event][i]).handler,ctx=_ref1.ctx,once=_ref1.once,handler.apply(null!=ctx?ctx:this,args),once?_results.push(this.bindings[event].splice(i,1)):_results.push(i++);return _results}},Evented}(),Pace=window.Pace||{},window.Pace=Pace,extend(Pace,Evented.prototype),options=Pace.options=extend({},defaultOptions,window.paceOptions,getFromDOM()),_i=0,_len=(_ref=["ajax","document","eventLag","elements"]).length;_i<_len;_i++)!0===options[source=_ref[_i]]&&(options[source]=defaultOptions[source]);NoTargetError=function(_super){function NoTargetError(){return NoTargetError.__super__.constructor.apply(this,arguments)}return __extends(NoTargetError,_super),NoTargetError}(Error),Bar=function(){function Bar(){this.progress=0}return Bar.prototype.getElement=function(){var targetElement;if(null==this.el){if(!(targetElement=document.querySelector(options.target)))throw new NoTargetError;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/(pace-done )|/,"pace-running ");var _custom_class_name=""!==options.className?" "+options.className:"";this.el.innerHTML='<div class="pace-progress'+_custom_class_name+'">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>',null!=targetElement.firstChild?targetElement.insertBefore(this.el,targetElement.firstChild):targetElement.appendChild(this.el)}return this.el},Bar.prototype.finish=function(){var el;return(el=this.getElement()).className=el.className.replace("pace-active","pace-inactive"),document.body.className=document.body.className.replace("pace-running ","pace-done ")},Bar.prototype.update=function(prog){return this.progress=prog,Pace.trigger("progress",prog),this.render()},Bar.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(_error){NoTargetError=_error}return this.el=void 0},Bar.prototype.render=function(){var el,key,progressStr,transform,_j,_len1,_ref2;if(null==document.querySelector(options.target))return!1;for(el=this.getElement(),transform="translate3d("+this.progress+"%, 0, 0)",_j=0,_len1=(_ref2=["webkitTransform","msTransform","transform"]).length;_j<_len1;_j++)key=_ref2[_j],el.children[0].style[key]=transform;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(el.children[0].setAttribute("data-progress-text",(0|this.progress)+"%"),this.progress>=100?progressStr="99":(progressStr=this.progress<10?"0":"",progressStr+=0|this.progress),el.children[0].setAttribute("data-progress",""+progressStr)),Pace.trigger("change",this.progress),this.lastRenderedProgress=this.progress},Bar.prototype.done=function(){return this.progress>=99},Bar}(),Events=function(){function Events(){this.bindings={}}return Events.prototype.trigger=function(name,val){var binding,_j,_len1,_ref2,_results;if(null!=this.bindings[name]){for(_results=[],_j=0,_len1=(_ref2=this.bindings[name]).length;_j<_len1;_j++)binding=_ref2[_j],_results.push(binding.call(this,val));return _results}},Events.prototype.on=function(name,fn){var _base;return null==(_base=this.bindings)[name]&&(_base[name]=[]),this.bindings[name].push(fn)},Events}(),_XMLHttpRequest=window.XMLHttpRequest,_XDomainRequest=window.XDomainRequest,_WebSocket=window.WebSocket,extendNative=function(to,from){var key,_results;for(key in _results=[],from.prototype)try{null==to[key]&&"function"!=typeof from[key]?"function"==typeof Object.defineProperty?_results.push(Object.defineProperty(to,key,{get:function(key){return function(){return from.prototype[key]}}(key),configurable:!0,enumerable:!0})):_results.push(to[key]=from.prototype[key]):_results.push(void 0)}catch(_error){_error}return _results},ignoreStack=[],Pace.ignore=function(){var args,fn,ret;return fn=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ignoreStack.unshift("ignore"),ret=fn.apply(null,args),ignoreStack.shift(),ret},Pace.track=function(){var args,fn,ret;return fn=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ignoreStack.unshift("track"),ret=fn.apply(null,args),ignoreStack.shift(),ret},shouldTrack=function(method){var _ref2;if(null==method&&(method="GET"),"track"===ignoreStack[0])return"force";if(!ignoreStack.length&&options.ajax){if("socket"===method&&options.ajax.trackWebSockets)return!0;if(_ref2=method.toUpperCase(),__indexOf.call(options.ajax.trackMethods,_ref2)>=0)return!0}return!1},RequestIntercept=function(_super){function RequestIntercept(){var monitorXHR,_this=this;RequestIntercept.__super__.constructor.apply(this,arguments),monitorXHR=function(req){var _open;return _open=req.open,req.open=function(type,url,async){return shouldTrack(type)&&_this.trigger("request",{type:type,url:url,request:req}),_open.apply(req,arguments)}},window.XMLHttpRequest=function(flags){var req;return req=new _XMLHttpRequest(flags),monitorXHR(req),req};try{extendNative(window.XMLHttpRequest,_XMLHttpRequest)}catch(_error){}if(null!=_XDomainRequest){window.XDomainRequest=function(){var req;return req=new _XDomainRequest,monitorXHR(req),req};try{extendNative(window.XDomainRequest,_XDomainRequest)}catch(_error){}}if(null!=_WebSocket&&options.ajax.trackWebSockets){window.WebSocket=function(url,protocols){var req;return req=null!=protocols?new _WebSocket(url,protocols):new _WebSocket(url),shouldTrack("socket")&&_this.trigger("request",{type:"socket",url:url,protocols:protocols,request:req}),req};try{extendNative(window.WebSocket,_WebSocket)}catch(_error){}}}return __extends(RequestIntercept,_super),RequestIntercept}(Events),_intercept=null,shouldIgnoreURL=function(url){var pattern,_j,_len1,_ref2;for(_j=0,_len1=(_ref2=options.ajax.ignoreURLs).length;_j<_len1;_j++)if("string"==typeof(pattern=_ref2[_j])){if(-1!==url.indexOf(pattern))return!0}else if(pattern.test(url))return!0;return!1},(getIntercept=function(){return null==_intercept&&(_intercept=new RequestIntercept),_intercept})().on("request",(function(_arg){var after,args,request,type,url;if(type=_arg.type,request=_arg.request,url=_arg.url,!shouldIgnoreURL(url))return Pace.running||!1===options.restartOnRequestAfter&&"force"!==shouldTrack(type)?void 0:(args=arguments,"boolean"==typeof(after=options.restartOnRequestAfter||0)&&(after=0),setTimeout((function(){var _j,_len1,_ref2,_ref3,_results;if("socket"===type?request.readyState<1:0<(_ref2=request.readyState)&&_ref2<4){for(Pace.restart(),_results=[],_j=0,_len1=(_ref3=Pace.sources).length;_j<_len1;_j++){if((source=_ref3[_j])instanceof AjaxMonitor){source.watch.apply(source,args);break}_results.push(void 0)}return _results}}),after))})),AjaxMonitor=function(){function AjaxMonitor(){this.complete=__bind(this.complete,this);var _this=this;this.elements=[],getIntercept().on("request",(function(){return _this.watch.apply(_this,arguments)}))}return AjaxMonitor.prototype.watch=function(_arg){var request,tracker,type,url;if(type=_arg.type,request=_arg.request,url=_arg.url,!shouldIgnoreURL(url))return tracker="socket"===type?new SocketRequestTracker(request,this.complete):new XHRRequestTracker(request,this.complete),this.elements.push(tracker)},AjaxMonitor.prototype.complete=function(tracker){return this.elements=this.elements.filter((function(e){return e!==tracker}))},AjaxMonitor}(),XHRRequestTracker=function(request,completeCallback){var _j,_len1,_onreadystatechange,_ref2,_this=this;if(this.progress=0,null!=window.ProgressEvent)for(addEventListener(request,"progress",(function(evt){return evt.lengthComputable?_this.progress=100*evt.loaded/evt.total:_this.progress=_this.progress+(100-_this.progress)/2})),_j=0,_len1=(_ref2=["load","abort","timeout","error"]).length;_j<_len1;_j++)addEventListener(request,_ref2[_j],(function(){return completeCallback(_this),_this.progress=100}));else _onreadystatechange=request.onreadystatechange,request.onreadystatechange=function(){var _ref3;return 0===(_ref3=request.readyState)||4===_ref3?(completeCallback(_this),_this.progress=100):3===request.readyState&&(_this.progress=50),"function"==typeof _onreadystatechange?_onreadystatechange.apply(null,arguments):void 0}},SocketRequestTracker=function(request,completeCallback){var _j,_len1,_ref2,_this=this;for(this.progress=0,_j=0,_len1=(_ref2=["error","open"]).length;_j<_len1;_j++)addEventListener(request,_ref2[_j],(function(){return completeCallback(_this),_this.progress=100}))},ElementMonitor=function(){function ElementMonitor(options){var selector,_j,_len1,_ref2;for(null==options&&(options={}),this.complete=__bind(this.complete,this),this.elements=[],null==options.selectors&&(options.selectors=[]),_j=0,_len1=(_ref2=options.selectors).length;_j<_len1;_j++)selector=_ref2[_j],this.elements.push(new ElementTracker(selector,this.complete))}return ElementMonitor.prototype.complete=function(tracker){return this.elements=this.elements.filter((function(e){return e!==tracker}))},ElementMonitor}(),ElementTracker=function(){function ElementTracker(selector,completeCallback){this.selector=selector,this.completeCallback=completeCallback,this.progress=0,this.check()}return ElementTracker.prototype.check=function(){var _this=this;return document.querySelector(this.selector)?this.done():setTimeout((function(){return _this.check()}),options.elements.checkInterval)},ElementTracker.prototype.done=function(){return this.completeCallback(this),this.completeCallback=null,this.progress=100},ElementTracker}(),DocumentMonitor=function(){function DocumentMonitor(){var _onreadystatechange,_ref2,_this=this;this.progress=null!=(_ref2=this.states[document.readyState])?_ref2:100,_onreadystatechange=document.onreadystatechange,document.onreadystatechange=function(){return null!=_this.states[document.readyState]&&(_this.progress=_this.states[document.readyState]),"function"==typeof _onreadystatechange?_onreadystatechange.apply(null,arguments):void 0}}return DocumentMonitor.prototype.states={loading:0,interactive:50,complete:100},DocumentMonitor}(),EventLagMonitor=function(){var avg,interval,last,points,samples,_this=this;this.progress=0,avg=0,samples=[],points=0,last=now(),interval=setInterval((function(){var diff;return diff=now()-last-50,last=now(),samples.push(diff),samples.length>options.eventLag.sampleCount&&samples.shift(),avg=avgAmplitude(samples),++points>=options.eventLag.minSamples&&avg<options.eventLag.lagThreshold?(_this.progress=100,clearInterval(interval)):_this.progress=3/(avg+3)*100}),50)},Scaler=function(){function Scaler(source){this.source=source,this.last=this.sinceLastUpdate=0,this.rate=options.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=result(this.source,"progress"))}return Scaler.prototype.tick=function(frameTime,val){var scaling;return null==val&&(val=result(this.source,"progress")),val>=100&&(this.done=!0),val===this.last?this.sinceLastUpdate+=frameTime:(this.sinceLastUpdate&&(this.rate=(val-this.last)/this.sinceLastUpdate),this.catchup=(val-this.progress)/options.catchupTime,this.sinceLastUpdate=0,this.last=val),val>this.progress&&(this.progress+=this.catchup*frameTime),scaling=1-Math.pow(this.progress/100,options.easeFactor),this.progress+=scaling*this.rate*frameTime,this.progress=Math.min(this.lastProgress+options.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},Scaler}(),sources=null,scalers=null,bar=null,uniScaler=null,animation=null,cancelAnimation=null,Pace.running=!1,handlePushState=function(){if(options.restartOnPushState)return Pace.restart()},null!=window.history.pushState&&(_pushState=window.history.pushState,window.history.pushState=function(){return handlePushState(),_pushState.apply(window.history,arguments)}),null!=window.history.replaceState&&(_replaceState=window.history.replaceState,window.history.replaceState=function(){return handlePushState(),_replaceState.apply(window.history,arguments)}),SOURCE_KEYS={ajax:AjaxMonitor,elements:ElementMonitor,document:DocumentMonitor,eventLag:EventLagMonitor},(init=function(){var type,_j,_k,_len1,_len2,_ref2,_ref3,_ref4;for(Pace.sources=sources=[],_j=0,_len1=(_ref2=["ajax","elements","document","eventLag"]).length;_j<_len1;_j++)!1!==options[type=_ref2[_j]]&&sources.push(new SOURCE_KEYS[type](options[type]));for(_k=0,_len2=(_ref4=null!=(_ref3=options.extraSources)?_ref3:[]).length;_k<_len2;_k++)source=_ref4[_k],sources.push(new source(options));return Pace.bar=bar=new Bar,scalers=[],uniScaler=new Scaler})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,bar.destroy(),cancelAnimation=!0,null!=animation&&("function"==typeof cancelAnimationFrame&&cancelAnimationFrame(animation),animation=null),init()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){var start;return Pace.running=!0,bar.render(),start=now(),cancelAnimation=!1,animation=runAnimation((function(frameTime,enqueueNextFrame){var avg,count,done,element,elements,i,j,scaler,scalerList,sum,_j,_k,_len1,_len2,_ref2;for(100-bar.progress,count=sum=0,done=!0,i=_j=0,_len1=sources.length;_j<_len1;i=++_j)for(source=sources[i],scalerList=null!=scalers[i]?scalers[i]:scalers[i]=[],j=_k=0,_len2=(elements=null!=(_ref2=source.elements)?_ref2:[source]).length;_k<_len2;j=++_k)element=elements[j],done&=(scaler=null!=scalerList[j]?scalerList[j]:scalerList[j]=new Scaler(element)).done,scaler.done||(count++,sum+=scaler.tick(frameTime));return avg=sum/count,bar.update(uniScaler.tick(frameTime,avg)),bar.done()||done||cancelAnimation?(bar.update(100),Pace.trigger("done"),setTimeout((function(){return bar.finish(),Pace.running=!1,Pace.trigger("hide")}),Math.max(options.ghostTime,Math.max(options.minTime-(now()-start),0)))):enqueueNextFrame()}))},Pace.start=function(_options){extend(options,_options),Pace.running=!0;try{bar.render()}catch(_error){NoTargetError=_error}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},"function"==typeof define&&define.amd?define("theme_adaptable/pace",(function(){return Pace})):"object"==typeof exports?module.exports=Pace:options.startOnPageLoad&&Pace.start()}).call(window);
//# sourceMappingURL=pace.min.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists