-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
48 lines (36 loc) · 847 Bytes
/
index.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
37
38
39
40
41
42
43
44
45
46
47
48
function loadScriptOrFallback() {
function tryNextScript(evt) {
while (
filePaths
&& filePaths.length > 0
) {
var filePath = '' + filePaths.shift();
if (filePath.length > 0) {
var script = document.createElement('script');
script.onerror = tryNextScript;
script.onload = stopHereIfReady;
script.src = filePath;
document.head.appendChild(script);
return;
}
}
}
function stopHereIfReady(evt) {
if (typeof initUI === 'undefined') {
tryNextScript(evt);
return;
}
USE_ES5_JS = /es5[^\/]*$/i.test(evt.target.src);
if (typeof initUI === 'function') {
initUI();
}
}
var filePaths = Array.prototype.slice.call(arguments);
tryNextScript();
}
var USE_ES5_JS;
loadScriptOrFallback(
'index.es-latest.js'
// , 'lib/util/regenerator-runtime-0.13.7/runtime.js'
// , 'index.es5.js'
);