-
Notifications
You must be signed in to change notification settings - Fork 8
/
loader.js
36 lines (36 loc) · 16.6 KB
/
loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var Ext=Ext||{};Ext.manifest=Ext.manifest||"fm/build/production/FM/app.json";Ext=Ext||{};
Ext.Boot=Ext.Boot||function(l){function m(a){if(a.$isRequest)return a;a=a.url?a:{url:a};var b=a.url;s(a,{urls:b.charAt?[b]:b,charset:a.charset||d.config.charset});s(this,a)}function r(a){if(a.$isEntry)return a;var b=a.charset||d.config.charset,c=Ext.manifest,c=c&&c.loader,g=void 0!==a.cache?a.cache:c&&c.cache,e;d.config.disableCaching&&(void 0===g&&(g=!d.config.disableCaching),!1===g?e=+new Date:!0!==g&&(e=g),e&&(c=c&&c.cacheParam||d.config.disableCachingParam,e=c+"\x3d"+e));s(a,{charset:b,buster:e,
requests:[]});s(this,a)}var k=document,f=[],v={disableCaching:/[?&](?:cache|disableCacheBuster)\b/i.test(location.search)||!/http[s]?\:/i.test(location.href)||/(^|[ ;])ext-cache=1/.test(k.cookie)?!1:!0,disableCachingParam:"_dc",loadDelay:!1,preserveScripts:!0,charset:"UTF-8"},y=/\.css(?:\?|$)/i,w=k.createElement("a"),t="undefined"!==typeof window,u={browser:t,node:!t&&"function"===typeof require,phantom:window&&(window._phantom||window.callPhantom)||/PhantomJS/.test(window.navigator.userAgent)},j=
Ext.platformTags={},s=function(a,b,c){c&&s(a,c);if(a&&b&&"object"===typeof b)for(var g in b)a[g]=b[g];return a},x=function(){var a=!1,b=Array.prototype.shift.call(arguments),c,g,e,d;"boolean"===typeof arguments[arguments.length-1]&&(a=Array.prototype.pop.call(arguments));e=arguments.length;for(c=0;c<e;c++)if(d=arguments[c],"object"===typeof d)for(g in d)b[a?g.toLowerCase():g]=d[g];return b},z="function"==typeof Object.keys?function(a){return!a?[]:Object.keys(a)}:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&
b.push(c);return b},d={loading:0,loaded:0,apply:s,env:u,config:v,assetConfig:{},scripts:{},currentFile:null,suspendedQueue:[],currentRequest:null,syncMode:!1,useElements:!0,listeners:[],Request:m,Entry:r,allowMultipleBrowsers:!1,browserNames:{ie:"IE",firefox:"Firefox",safari:"Safari",chrome:"Chrome",opera:"Opera",dolfin:"Dolfin",edge:"Edge",webosbrowser:"webOSBrowser",chromeMobile:"ChromeMobile",chromeiOS:"ChromeiOS",silk:"Silk",other:"Other"},osNames:{ios:"iOS",android:"Android",windowsPhone:"WindowsPhone",
webos:"webOS",blackberry:"BlackBerry",rimTablet:"RIMTablet",mac:"MacOS",win:"Windows",tizen:"Tizen",linux:"Linux",bada:"Bada",chromeOS:"ChromeOS",other:"Other"},browserPrefixes:{ie:"MSIE ",edge:"Edge/",firefox:"Firefox/",chrome:"Chrome/",safari:"Version/",opera:"OPR/",dolfin:"Dolfin/",webosbrowser:"wOSBrowser/",chromeMobile:"CrMo/",chromeiOS:"CriOS/",silk:"Silk/"},browserPriority:"edge opera dolfin webosbrowser silk chromeiOS chromeMobile ie firefox safari chrome".split(" "),osPrefixes:{tizen:"(Tizen )",
ios:"i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ",android:"(Android |HTC_|Silk/)",windowsPhone:"Windows Phone ",blackberry:"(?:BlackBerry|BB)(?:.*)Version/",rimTablet:"RIM Tablet OS ",webos:"(?:webOS|hpwOS)/",bada:"Bada/",chromeOS:"CrOS "},fallbackOSPrefixes:{windows:"win",mac:"mac",linux:"linux"},devicePrefixes:{iPhone:"iPhone",iPod:"iPod",iPad:"iPad"},maxIEVersion:12,detectPlatformTags:function(){var a=navigator.userAgent,b=/Mobile(\/|\s)/.test(a),c=document.createElement("div"),g={},e,n,h,p,f;
n=this.browserPriority.length;for(p=0;p<n;p++)e=this.browserPriority[p],f?h=0:(h=this.browserPrefixes[e],(h=(h=a.match(RegExp("("+h+")([\\w\\._]+)")))&&1<h.length?parseInt(h[2]):0)&&(f=!0)),g[e]=h;g.ie&&(p=document.documentMode,8<=p&&(g.ie=p));h=g.ie||!1;e=Math.max(h,this.maxIEVersion);for(p=8;p<=e;++p)n="ie"+p,g[n+"m"]=h?h<=p:0,g[n]=h?h===p:0,g[n+"p"]=h?h>=p:0;p={};var q,k,l;n=z(this.osPrefixes);f=n.length;for(l=h=0;h<f;h++)e=n[h],q=this.osPrefixes[e],(q=(k=(q=a.match(RegExp("("+q+")([^\\s;]+)")))?
q[1]:null)&&("HTC_"===k||"Silk/"===k)?2.3:q&&1<q.length?parseFloat(q[q.length-1]):0)&&l++,p[e]=q;n=z(this.fallbackOSPrefixes);f=n.length;for(h=0;h<f;h++)e=n[h],0===l?(q=this.fallbackOSPrefixes[e],q=a.toLowerCase().match(RegExp(q)),p[e]=q?!0:0):p[e]=0;e={};h=z(this.devicePrefixes);l=h.length;for(f=0;f<l;f++)n=h[f],q=this.devicePrefixes[n],q=a.match(RegExp(q)),e[n]=q?!0:0;n=d.loadPlatformsParam();x(j,g,p,e,n,!0);j.phone=!(!j.iphone&&!j.ipod&&!(!j.silk&&j.android&&(3>j.android||b)||j.blackberry&&b||
j.windowsphone));j.tablet=!(j.phone||!j.ipad&&!j.android&&!j.silk&&!(j.rimtablet||j.ie10&&/; Touch/.test(a)));b="ontouchend"in c;!b&&(c.setAttribute&&c.removeAttribute)&&(c.setAttribute("ontouchend",""),b="function"===typeof c.ontouchend,"undefined"!==typeof c.ontouchend&&(c.ontouchend=void 0),c.removeAttribute("ontouchend"));j.touch=b||navigator.maxTouchPoints||navigator.msMaxTouchPoints;j.desktop=!j.phone&&!j.tablet;j.cordova=j.phonegap=!(!window.PhoneGap&&!window.Cordova&&!window.cordova);j.webview=
/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(a);j.androidstock=4.3>=j.android&&(j.safari||j.silk);x(j,n,!0)},loadPlatformsParam:function(){var a=window.location.search.substr(1).split("\x26"),b={},c,g={},e,d,h;for(c=0;c<a.length;c++)e=a[c].split("\x3d"),b[e[0]]=e[1];if(b.platformTags){e=b.platformTags.split(",");a=e.length;for(c=0;c<a;c++){b=e[c].split(":");d=b[0];h=!0;if(1<b.length&&(h=b[1],"false"===h||"0"===h))h=!1;g[d]=h}}return g},filterPlatform:function(a,b){a=f.concat(a||f);
b=f.concat(b||f);var c=a.length,g=b.length,e=!c&&g,d;for(d=0;d<c&&!e;d++)e=a[d],e=!!j[e];for(d=0;d<g&&e;d++)e=b[d],e=!j[e];return e},init:function(){var a=k.getElementsByTagName("script"),b=a.length,c=/\/ext(\-[a-z\-]+)?\.js$/,g,e,n,h,f,j;for(j=0;j<b;j++)if(e=(g=a[j]).src)n=g.readyState||null,!h&&c.test(e)&&(d.hasReadyState="readyState"in g,d.hasAsync="async"in g||!d.hasReadyState,h=e),d.scripts[f=d.canonicalUrl(e)]||new r({key:f,url:e,done:null===n||"loaded"===n||"complete"===n,el:g,prop:"src"});
h||(g=a[a.length-1],h=g.src,d.hasReadyState="readyState"in g,d.hasAsync="async"in g||!d.hasReadyState);d.baseUrl=h.substring(0,h.lastIndexOf("/")+1);d.origin=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");d.detectPlatformTags();Ext.filterPlatform=d.filterPlatform},canonicalUrl:function(a){w.href=a;a=w.href;var b=v.disableCachingParam,b=b?a.indexOf(b+"\x3d"):-1,c,g;if(0<b&&("?"===(c=a.charAt(b-1))||"\x26"===c)){g=a.indexOf("\x26",
b);if((g=0>g?"":a.substring(g))&&"?"===c)++b,g=g.substring(1);a=a.substring(0,b-1)+g}return a},getConfig:function(a){return a?d.config[a]:d.config},setConfig:function(a,b){if("string"===typeof a)d.config[a]=b;else for(var c in a)d.setConfig(c,a[c]);return d},getHead:function(){return d.docHead||(d.docHead=k.head||k.getElementsByTagName("head")[0])},create:function(a,b,c){c=c||{};c.url=a;c.key=b;return d.scripts[b]=new r(c)},getEntry:function(a,b){var c=d.canonicalUrl(a),g=d.scripts[c];g||(g=d.create(a,
c,b));return g},registerContent:function(a,b,c){return d.getEntry(a,{content:c,loaded:!0,css:"css"===b})},processRequest:function(a,b){a.loadEntries(b)},load:function(a){a=new m(a);if(a.sync||d.syncMode)return d.loadSync(a);d.currentRequest?(a.getEntries(),d.suspendedQueue.push(a)):(d.currentRequest=a,d.processRequest(a,!1));return d},loadSync:function(a){a=new m(a);d.syncMode++;d.processRequest(a,!0);d.syncMode--;return d},loadBasePrefix:function(a){a=new m(a);a.prependBaseUrl=!0;return d.load(a)},
loadSyncBasePrefix:function(a){a=new m(a);a.prependBaseUrl=!0;return d.loadSync(a)},requestComplete:function(a){if(d.currentRequest===a)for(d.currentRequest=null;0<d.suspendedQueue.length;)if(a=d.suspendedQueue.shift(),!a.done){d.load(a);break}!d.currentRequest&&0==d.suspendedQueue.length&&d.fireListeners()},isLoading:function(){return!d.currentRequest&&0==d.suspendedQueue.length},fireListeners:function(){for(var a;d.isLoading()&&(a=d.listeners.shift());)a()},onBootReady:function(a){d.isLoading()?
d.listeners.push(a):a()},getPathsFromIndexes:function(a,b){return m.prototype.getPathsFromIndexes(a,b)},createLoadOrderMap:function(a){return m.prototype.createLoadOrderMap(a)},fetch:function(a,b,c,g){g=void 0===g?!!b:g;var e=new XMLHttpRequest,d,h,f,j=!1,k=function(){e&&4==e.readyState&&(h=1223===e.status?204:0===e.status&&("file:"===(self.location||{}).protocol||"ionp:"===(self.location||{}).protocol)?200:e.status,f=e.responseText,d={content:f,status:h,exception:j},b&&b.call(c,d),e=null)};g&&(e.onreadystatechange=
k);try{e.open("GET",a,g),e.send(null)}catch(l){return j=l,k(),d}g||k();return d},notifyAll:function(a){a.notifyRequests()}};m.prototype={$isRequest:!0,createLoadOrderMap:function(a){var b=a.length,c={},g,d;for(g=0;g<b;g++)d=a[g],c[d.path]=d;return c},getLoadIndexes:function(a,b,c,g,e){var f=c[a],h,j,k,l,m;if(b[a])return b;b[a]=!0;for(a=!1;!a;){k=!1;for(l in b)if(b.hasOwnProperty(l)&&(f=c[l]))if(j=this.prepareUrl(f.path),j=d.getEntry(j),!e||!j||!j.done){j=f.requires;g&&f.uses&&(j=j.concat(f.uses));
f=j.length;for(h=0;h<f;h++)m=j[h],b[m]||(k=b[m]=!0)}k||(a=!0)}return b},getPathsFromIndexes:function(a,b){var c=[],d=[],e,f;for(e in a)a.hasOwnProperty(e)&&a[e]&&c.push(e);c.sort(function(a,b){return a-b});e=c.length;for(f=0;f<e;f++)d.push(b[c[f]].path);return d},expandUrl:function(a,b,c,d){"string"==typeof a&&(a=[a]);var e=this.loadOrder,f=this.loadOrderMap;if(e){this.loadOrderMap=f=f||this.createLoadOrderMap(e);b=b||{};var h=a.length,j=[],k,l;for(k=0;k<h;k++)(l=f[a[k]])?this.getLoadIndexes(l.idx,
b,e,c,d):j.push(a[k]);return this.getPathsFromIndexes(b,e).concat(j)}return a},expandUrls:function(a,b){"string"==typeof a&&(a=[a]);var c=[],d={},e,f=a.length,h,j,k,l;for(h=0;h<f;h++){e=this.expandUrl(a[h],{},b,!0);j=0;for(k=e.length;j<k;j++)l=e[j],d[l]||(d[l]=!0,c.push(l))}0==c.length&&(c=a);return c},expandLoadOrder:function(){var a=this.urls,b;this.expanded?b=a:(b=this.expandUrls(a,!0),this.expanded=!0);this.urls=b;a.length!=b.length&&(this.sequential=!0);return this},getUrls:function(){this.expandLoadOrder();
return this.urls},prepareUrl:function(a){return this.prependBaseUrl?d.baseUrl+a:a},getEntries:function(){var a=this.entries,b,c,g;if(!a){a=[];g=this.getUrls();for(b=0;b<g.length;b++)c=this.prepareUrl(g[b]),c=d.getEntry(c,{buster:this.buster,charset:this.charset}),c.requests.push(this),a.push(c);this.entries=a}return a},loadEntries:function(a){var b=this,c=b.getEntries(),d=c.length,e=b.loadStart||0,f,h;void 0!==a&&(b.sync=a);b.loaded=b.loaded||0;b.loading=b.loading||d;for(h=e;h<d;h++)if(f=c[h],e=f.loaded?
!0:c[h].load(b.sync),!e){b.loadStart=h;f.onDone(function(){b.loadEntries(a)});break}b.processLoadedEntries()},processLoadedEntries:function(){var a=this.getEntries(),b=a.length,c=this.startIndex||0,d;if(!this.done){for(;c<b;c++){d=a[c];if(!d.loaded){this.startIndex=c;return}d.evaluated||d.evaluate();d.error&&(this.error=!0)}this.notify()}},notify:function(){var a=this;if(!a.done){var b=a.error,c=a[b?"failure":"success"],b="delay"in a?a.delay:b?1:d.config.chainDelay,g=a.scope||a;a.done=!0;c&&(0===
b||0<b?setTimeout(function(){c.call(g,a)},b):c.call(g,a));a.fireListeners();d.requestComplete(a)}},onDone:function(a){var b=this.listeners||(this.listeners=[]);this.done?a(this):b.push(a)},fireListeners:function(){var a=this.listeners,b;if(a)for(;b=a.shift();)b(this)}};r.prototype={$isEntry:!0,done:!1,evaluated:!1,loaded:!1,isCrossDomain:function(){void 0===this.crossDomain&&(this.crossDomain=0!==this.getLoadUrl().indexOf(d.origin));return this.crossDomain},isCss:function(){if(void 0===this.css)if(this.url){var a=
d.assetConfig[this.url];this.css=a?"css"===a.type:y.test(this.url)}else this.css=!1;return this.css},getElement:function(a){var b=this.el;b||(this.isCss()?(a=a||"link",b=k.createElement(a),"link"==a?(b.rel="stylesheet",this.prop="href"):this.prop="textContent",b.type="text/css"):(b=k.createElement(a||"script"),b.type="text/javascript",this.prop="src",this.charset&&(b.charset=this.charset),d.hasAsync&&(b.async=!1)),this.el=b);return b},getLoadUrl:function(){var a=d.canonicalUrl(this.url);this.loadUrl||
(this.loadUrl=this.buster?a+(-1===a.indexOf("?")?"?":"\x26")+this.buster:a);return this.loadUrl},fetch:function(a){var b=this.getLoadUrl();d.fetch(b,a.complete,this,!!a.async)},onContentLoaded:function(a){var b=a.status,c=a.content;a=a.exception;this.getLoadUrl();this.loaded=!0;(a||0===b)&&!u.phantom?this.evaluated=this.error=!0:200<=b&&300>b||304===b||u.phantom||0===b&&0<c.length?this.content=c:this.evaluated=this.error=!0},createLoadElement:function(a){var b=this,c=b.getElement();b.preserve=!0;
c.onerror=function(){b.error=!0;a&&a()};d.hasReadyState?c.onreadystatechange=function(){("loaded"===this.readyState||"complete"===this.readyState)&&a&&a()}:c.onload=a;c[b.prop]=b.getLoadUrl()},onLoadElementReady:function(){d.getHead().appendChild(this.getElement());this.evaluated=!0},inject:function(a){var b=d.getHead(),c=this.url,g=this.key,e,f;this.isCss()?(this.preserve=!0,f=g.substring(0,g.lastIndexOf("/")+1),e=k.createElement("base"),e.href=f,b.firstChild?b.insertBefore(e,b.firstChild):b.appendChild(e),
e.href=e.href,c&&(a+="\n/*# sourceURL\x3d"+g+" */"),c=this.getElement("style"),g="styleSheet"in c,b.appendChild(e),g?(b.appendChild(c),c.styleSheet.cssText=a):(c.textContent=a,b.appendChild(c)),b.removeChild(e)):(c&&(a+="\n//# sourceURL\x3d"+g),Ext.globalEval(a));return this},loadCrossDomain:function(){var a=this;a.createLoadElement(function(){a.loaded=a.evaluated=a.done=!0;a.notifyRequests()});a.evaluateLoadElement();return!1},loadElement:function(){var a=this;a.createLoadElement(function(){a.loaded=
a.evaluated=a.done=!0;a.notifyRequests()});a.evaluateLoadElement();return!0},loadSync:function(){var a=this;a.fetch({async:!1,complete:function(b){a.onContentLoaded(b)}});a.evaluate();a.notifyRequests()},load:function(a){var b=this;if(!b.loaded){if(b.loading)return!1;b.loading=!0;if(a)b.loadSync();else{if(b.isCrossDomain())return b.loadCrossDomain();if(!b.isCss()&&d.hasReadyState)b.createLoadElement(function(){b.loaded=!0;b.notifyRequests()});else{if(d.useElements&&(!b.isCss()||!u.phantom))return b.loadElement();
b.fetch({async:!a,complete:function(a){b.onContentLoaded(a);b.notifyRequests()}})}}}return!0},evaluateContent:function(){this.inject(this.content);this.content=null},evaluateLoadElement:function(){d.getHead().appendChild(this.getElement())},evaluate:function(){!this.evaluated&&!this.evaluating&&(this.evaluating=!0,void 0!==this.content?this.evaluateContent():this.error||this.evaluateLoadElement(),this.evaluated=this.done=!0,this.cleanup())},cleanup:function(){var a=this.el,b;if(a){if(!this.preserve)for(b in this.el=
null,a.parentNode.removeChild(a),a)try{b!==this.prop&&(a[b]=null),delete a[b]}catch(c){}a.onload=a.onerror=a.onreadystatechange=l}},notifyRequests:function(){var a=this.requests,b=a.length,c,d;for(c=0;c<b;c++)d=a[c],d.processLoadedEntries();this.done&&this.fireListeners()},onDone:function(a){var b=this.listeners||(this.listeners=[]);this.done?a(this):b.push(a)},fireListeners:function(){var a=this.listeners,b;if(a&&0<a.length)for(;b=a.shift();)b(this)}};Ext.disableCacheBuster=function(a,b){var c=new Date;
c.setTime(c.getTime()+864E5*(a?3650:-1));c=c.toGMTString();k.cookie="ext-cache\x3d1; expires\x3d"+c+"; path\x3d"+(b||"/")};d.init();return d}(function(){});Ext.globalEval=Ext.globalEval||(this.execScript?function(l){execScript(l)}:function(l){eval.call(window,l)});
Function.prototype.bind||function(){var l=Array.prototype.slice,m=function(m){var k=l.call(arguments,1),f=this;if(k.length)return function(){var v=arguments;return f.apply(m,v.length?k.concat(l.call(v)):k)};k=null;return function(){return f.apply(m,arguments)}};Function.prototype.bind=m;m.$extjs=!0}();Ext.setResourcePath=function(l,m){var r=Ext.manifest||(Ext.manifest={}),k=r.resources||(r.resources={});r&&("string"!==typeof l?Ext.apply(k,l):k[l]=m,r.resources=k)};
Ext.getResourcePath=function(l,m,r){"string"!==typeof l&&(m=l.pool,r=l.packageName,l=l.path);var k=Ext.manifest,k=k&&k.resources;m=k[m];var f=[];null==m&&(m=k.path,null==m&&(m="resources"));m&&f.push(m);r&&f.push(r);f.push(l);return f.join("/")};Ext=Ext||window.Ext||{};
Ext.Microloader=Ext.Microloader||function(){var l=Ext.Boot,m=[],r=!1,k={detectPlatformTags:function(){Ext.beforeLoad&&Ext.beforeLoad(Ext.platformTags)},initPlatformTags:function(){k.detectPlatformTags()},init:function(){k.initPlatformTags();var f=Ext._beforereadyhandler;Ext._beforereadyhandler=function(){Ext.Boot!==l&&(Ext.apply(Ext.Boot,l),Ext.Boot=l);f&&f()}},run:function(){k.init();var f=Ext.manifest;if("string"===typeof f){var m=f.indexOf(".json")===f.length-5?f:f+".json";l.fetch(m,function(l){f=
Ext.manifest=JSON.parse(l.content);k.load(f)})}else k.load(f)},load:function(f){var m=f.loadOrder,y=m?l.createLoadOrderMap(m):null,w=[],t=f.js||[],u=f.css||[],j,s=function(){r=!0;k.notify()};m&&(f.loadOrderMap=y);for(var x=u.concat(t),u=x.length,t=0;t<u;t++)f=x[t],j=!0,f.platform&&!l.filterPlatform(f.platform)&&(j=!1),j&&w.push(f.path);l.load({url:w,loadOrder:m,loadOrderMap:y,sequential:!0,success:s,failure:s})},onMicroloaderReady:function(f){r?f():m.push(f)},notify:function(){for(var f;f=m.shift();)f()}};
return k}();Ext.manifest=Ext.manifest||"bootstrap";Ext.Microloader.run();