snappymail/rainloop/v/1.3.2.445/static/js/boot.js
RainLoop Team 33c30ff962 v1.3.2.445
2013-10-19 02:18:40 +04:00

13 lines
No EOL
5.7 KiB
JavaScript

/*
* See http://www.JSON.org/js.html
*/
var JSON;JSON||(JSON={}),function(){function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g;return e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)d=rep[c],typeof d=="string"&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g;return e}}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function f(a){return a<10?"0"+a:a}"use strict",typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(b&&typeof b!="function"&&(typeof b!="object"||typeof b.length!="number"))throw new Error("JSON.stringify");return str("",{"":a})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver=="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")})}();
(function(b){function c(){var a=this;a.el=null;a.done=!1;a.progress=0;a.addInterval=0;a.interval=b.setInterval(function(){a.build()&&b.clearInterval(a.interval)},100)}c.prototype.startAddInterval=function(){var a=this;a.stopAddInterval();a.addInterval=b.setInterval(function(){0<a.progress&&100>a.progress&&a.add(3)},500)};c.prototype.stopAddInterval=function(){b.clearInterval(this.addInterval);this.addInterval=0};c.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};c.prototype.reset=function(){this.progress=0;return this.render()};c.prototype.update=function(a){a=b.parseInt(a,10);a>this.progress&&(this.progress=a,this.progress=100<this.progress?
100:this.progress,this.progress=0>this.progress?0:this.progress);return this.render()};c.prototype.add=function(a){this.progress+=b.parseInt(a,10);this.progress=100<this.progress?100:this.progress;this.progress=0>this.progress?0:this.progress;return this.render()};c.prototype.render=function(){var a=this.build();a&&(a.children&&a.children[0])&&a.children[0].setAttribute("style","width:"+this.progress+"%");100===this.progress&&!this.done?(this.done=!0,this.stopAddInterval(),a.className=a.className.replace("simple-pace-active",
""),a.className+=" simple-pace-inactive"):100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),a.className=a.className.replace("simple-pace-inactive",""),a.className+=" simple-pace-inactive"):100>this.progress&&(!this.done&&0===this.addInterval)&&this.startAddInterval()};if(!b.SimplePace){var d=new c;b.SimplePace={set:function(a){d.update(a)},add:function(a){d.add(a)}}}})(window);
var a=null,b=window,d=JSON;function e(){}var f="_rl"+(Math.floor(9E3*Math.random())+1E3),g="__rlah __rlah_set __rlah_clear AuthAccountHash rainloopAppData __rlA toString".split(" ");e.prototype.b=b.sessionStorage;e.prototype.a=b.top||b;e.prototype.getHash=function(){var c=a;this.b?c=this.b.getItem(g[6])||a:this.a&&(c=(c=this.a.name&&d&&"{"===this.a.name[g[7]]().substr(0,1)?d.parse(this.a.name[g[7]]()):a)?c[g[6]]||a:a);return c};
e.prototype.setHash=function(){var c=b[g[5]],h=a;this.b?this.b.setItem(g[6],c&&c[g[4]]?c[g[4]]:""):this.a&&(h={},h[g[6]]=c&&c[g[4]]?c[g[4]]:"",this.a.name=d.stringify(h))};e.prototype.clearHash=function(){this.b?this.b.setItem(g[6],""):this.a&&(this.a.name="")};b[f]=new e;b[g[0]]=function(){return b[f]?b[f].getHash():a};b[g[1]]=function(){b[f]&&b[f].setHash()};b[g[2]]=function(){b[f]&&b[f].clearHash()};
if (window.SimplePace) {
window.SimplePace.add(10);
}