/
tb02.08_app.js
86 lines (80 loc) · 2.46 KB
/
tb02.08_app.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* tb02.08.app.js
* @author Michael S. Mikowski - mike.mikowski@gmail.com
*
* Typebomb 2 wip convert to xhi instances instead of modules.
* Version 02 replaces the _css_ module with PowerCSS
*
*/
/*global tb02*/
// == BEGIN MODULE tb02 ================================================
(function () {
// == BEGIN MODULE SCOPE VARIABLES ===================================
'use strict';
var
libList = [
'js/vendor/pcss-1.4.6.js',
'js/vendor/pcss.cfg-1.4.6.js',
'js/vendor/jquery-3.3.1.js',
'js/plugin/jquery.deferred.whenAll-1.0.0.js',
'js/vendor/jquery.event.gevent-1.1.6.js',
'js/vendor/jquery.event.ue-1.3.2.js',
'js/vendor/jquery.urianchor-1.3.5.js',
// Arch libs
'js/xhi/00_root.js',
'js/xhi/01_util.js',
// 'js/xhi/02_data.js', // custom
// 'js/xhi/02_fake.js', // not used currently
// 'js/xhi/03_model.js', // custom
'js/xhi/04_utilb.js',
'js/xhi/05_02_css_base.js',
'js/xhi/05_03_css_lb.js',
'js/xhi/05_css.js',
// 'js/xhi/05_css_shell.js', // custom
'js/xhi/06_lb.js', // custom
// 'js/xhi/07_shell.js', // custom
// App libs
'js/app-tb02/tb02.00_root.js',
'js/app-tb02/tb02.01_util.js',
'js/app-tb02/tb02.02_data.js',
'js/app-tb02/tb02.03_model.js',
'js/app-tb02/tb02.04_utilb.js',
'js/app-tb02/tb02.05_02_css_base.js',
'js/app-tb02/tb02.05_03_css_lb.js',
'js/app-tb02/tb02.05_css.js',
'js/app-tb02/tb02.06_lb.js',
'js/app-tb02/tb02.07_shell.js'
],
libCount = libList.length,
loadCount = 0,
loadDelayMs = 100,
$, scriptObj, libIdx, libSrcStr;
// == . END MODULE SCOPE VARIABLES ===================================
function startAppFn () {
tb02._07_shell_._initModuleFn_();
}
function testLoadFn() {
if ( window.xhiJQ ) {
$ = window.xhiJQ;
$( startAppFn );
}
else {
console.warn( 'reload...' );
setTimeout( testLoadFn, loadDelayMs );
loadDelayMs *= 1.5;
}
}
function onLoadFn() {
loadCount++;
if ( loadCount === libCount ) { testLoadFn(); }
}
for ( libIdx = 0; libIdx < libCount; libIdx++ ) {
libSrcStr = libList[ libIdx ];
scriptObj = document.createElement( 'script' );
scriptObj.type = 'text/javascript';
scriptObj.async = false;
scriptObj.src = libSrcStr;
scriptObj.onload = onLoadFn;
document.head.appendChild( scriptObj );
}
}());