aboutsummaryrefslogtreecommitdiffstats
path: root/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/scripts/utils/page-resource.js
blob: 18b10f43025190c65477f2562a663e9d043e9c74 (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*-
 * ================================================================================
 * DCAE DMaaP Bus Controller Web Application
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ================================================================================
 */
function loadjscssfile(filename, filetype){
    if (filetype=="js"){ //if filename is a external JavaScript file
    	var done = false;
        var script = document.createElement('script');	
  		script.src = filename;
  		script.async = false; 			
 		document.head.appendChild(script);
    }else if (filetype=="css"){ //if filename is an external CSS file
        var fileref=document.createElement("link")
        fileref.setAttribute("rel", "stylesheet")
        fileref.setAttribute("type", "text/css")
        fileref.setAttribute("async", false)
        fileref.setAttribute("href", filename)
        document.head.appendChild(fileref);
    } 
}

function loadResource(){
	//css
	loadjscssfile("app/fusion/external/ebz/fn-ebz.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/demo.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/base.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/btn.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/dtpk.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/frms.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/sldr.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/style.css", "css");	
	loadjscssfile("app/fusion/external/ebz/sandbox/styles/tbs.css", "css");	
	loadjscssfile("app/fusion/external/ebz/ebz_header/portal_ebz_header.css", "css");	
	loadjscssfile("static/fusion/css/jquery-ui.css", "css");	
	
	
	loadjscssfile("app/fusion/external/ebz/ebz_header/header.css", "css");	
	loadjscssfile("app/fusion/external/ebz/ebz_header/footer.css", "css");	
	// Basic AngularJS -->
	loadjscssfile("app/fusion/external/ebz/angular_js/angular.js", "js");
	loadjscssfile("app/fusion/external/ebz/angular_js/angular-sanitize.js", "js");
	loadjscssfile("app/fusion/external/ebz/angular_js/angular-route.min.js", "js");
	loadjscssfile("app/fusion/external/ebz/angular_js/angular-cookies.js", "js");
	loadjscssfile("app/fusion/external/ebz/angular_js/gestures.js", "js");
	loadjscssfile("app/fusion/external/ebz/angular_js/app.js", "js");

	loadjscssfile("app/fusion/external/ebz/sandbox/att-abs-tpls.js", "js");
		
	// jQuery -->	
	loadjscssfile("static/js/jquery-1.10.2.js", "js");
	loadjscssfile("static/js/jquery.mask.min.js", "js");	
	loadjscssfile("static/js/jquery-ui.js", "js");
	
	// AngularJS Gridster -->
	loadjscssfile("static/fusion/js/att_angular_gridster/ui-gridster-tpls.js", "js");
	loadjscssfile("static/fusion/js/att_angular_gridster/angular-gridster.js", "js");
	
	// AngularJS Config -->
	loadjscssfile("app/fusion/external/ebz/angular_js/checklist-model.js", "js");
	
	// Utility -->
	loadjscssfile("app/fusion/scripts/modalService.js", "js");
	loadjscssfile("app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js", "js");	
	
	// Controller js -->
	loadjscssfile("app/fusion/scripts/controllers/profile-search-controller.js", "js");
	loadjscssfile("app/fusion/scripts/controllers/profile-controller.js", "js");
	loadjscssfile("app/fusion/scripts/controllers/post-search-controller.js", "js");
	loadjscssfile("app/fusion/scripts/controllers/self-profile-controller.js", "js");
	loadjscssfile("app/fusion/scripts/controllers/rolefunctionpopupController.js", "js");	
	loadjscssfile("app/fusion/scripts/controllers/modelpopupController.js", "js");
	
	// Header and Footer -->
	loadjscssfile("app/fusion/scripts/directives/footer.js", "js");
	loadjscssfile("app/fusion/external/ebz/js/footer.js", "js");
	loadjscssfile("app/fusion/scripts/directives/header.js", "js");		
	loadjscssfile("app/fusion/scripts/directives/leftMenu.js", "js");
	
	// Services -->
	loadjscssfile("app/fusion/scripts/services/profileService.js", "js");	
	loadjscssfile("app/fusion/scripts/services/userInfoService.js", "js");
	loadjscssfile("app/fusion/scripts/services/leftMenuService.js", "js");	
	loadjscssfile("app/fusion/scripts/controllers/profileController.js", "js");			
}

window.onload = loadResource();
window.onload = function(){
	var appLoadingInterval = setInterval(function(){ loadApp() }, 500);
	var count=0;
	function loadApp(){	
		count++
		if(typeof angular !== 'undefined') {
			angular.bootstrap(document, ['abs']);
			clearInterval(appLoadingInterval);
		}else if(count>10){
			clearInterval(appLoadingInterval);
		}
	}
}