[POLICY-73] replace openecomp for policy-engine
[policy/engine.git] / ONAP-SDK-APP / src / main / webapp / app / fusion / scripts / utils / page-resource-ds2.js
1 function loadjscssfile(filename, filetype){
2     if (filetype=="js"){ //if filename is a external JavaScript file
3         var done = false;
4         var script = document.createElement('script');  
5                 script.src = filename;
6                 script.async = false;                   
7                 document.head.appendChild(script);
8     }else if (filetype=="css"){ //if filename is an external CSS file
9         var fileref=document.createElement("link")
10         fileref.setAttribute("rel", "stylesheet")
11         fileref.setAttribute("type", "text/css")
12         fileref.setAttribute("async", false)
13         fileref.setAttribute("href", filename)
14         document.head.appendChild(fileref);
15     } 
16 }
17
18 function loadResource(){
19         /*********************AngularJs***************************/
20         loadjscssfile("./app/fusion/external/angular-1.5/angular.min.js", "js");
21         loadjscssfile("./app/fusion/external/angular-1.5/angular-messages.js", "js");
22         loadjscssfile("./app/fusion/external/angular-1.5/angular-touch.js", "js");
23         loadjscssfile("./app/fusion/external/angular-1.5/angular-sanitize.min.js", "js");       
24         loadjscssfile("./app/fusion/external/angular-1.5/angular-route.min.js", "js");
25         loadjscssfile("./app/fusion/external/angular-1.5/angular-cookies.min.js", "js");
26         
27         loadjscssfile("./app/fusion/external/ds2/js/b2b-angular/b2b-library.min.js", "js");
28 /*      loadjscssfile("./app/fusion/external/ds2/js/digital-ng-library/digital.ng.library.min.js", "js");
29 */
30         loadjscssfile("./app/fusion/external/jquery/dist/jquery.min.js", "js");
31         
32         /*********************Angular Gridster***************************/
33         loadjscssfile("./app/fusion/external/angular-gridster/dist/angular-gridster.min.css", "css");   
34         loadjscssfile("./app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css", "css");   
35         loadjscssfile("./app/fusion/external/javascript-detect-element-resize/jquery.resize.js", "js");
36         loadjscssfile("./app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js", "js");
37         loadjscssfile("./app/fusion/external/angular-gridster/dist/angular-gridster.min.js", "js");
38
39         /*********************Angular UI grid***************************/
40         loadjscssfile("./app/fusion/external/angular-ui-grid/ui-grid.js", "js");
41         loadjscssfile("./app/fusion/external/angular-ui-grid/ui-grid.css", "css");
42
43         loadjscssfile("./app/fusion/external/ds2/js/appDS2.js", "js");  
44
45         loadjscssfile("./app/fusion/scripts/DS2-services/headerServiceDS2.js", "js");
46         loadjscssfile("./app/fusion/scripts/DS2-services/leftMenuServiceDS2.js", "js");
47         loadjscssfile("./app/fusion/scripts/DS2-services/manifestService.js", "js");
48         loadjscssfile("./app/fusion/scripts/DS2-directives/footer.js", "js");
49         loadjscssfile("./app/fusion/scripts/DS2-directives/ds2Header.js", "js");
50         loadjscssfile("./app/fusion/scripts/DS2-directives/ds2LeftMenu.js", "js");
51         loadjscssfile("./app/fusion/external/ds2/js/digital-ng-library/digital-design-library.js", "js");       
52
53         /*******DS2 styles*******/
54         loadjscssfile("./app/fusion/external/ds2/css/b2b-angular/b2b-angular.css", "css");      
55         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/extras/ds2-accordion.css", "css");      
56         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/extras/ds2-bootstrap-datepicker.css", "css");   
57         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/extras/ds2-cc-input-field.css", "css"); 
58         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/extras/ds2-tooltip.css", "css");        
59         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/extras/x-tabs-pills.css", "css");       
60         
61         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-accordion.css", "css");     
62         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-bootstrap-datepicker.css", "css");  
63         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-c2c.css", "css");   
64         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-cc-input-field.css", "css");        
65         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-filmstrip.css", "css");
66         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-filters.css", "css");
67         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-legacynav-fix.css", "css");
68         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-marquee.css", "css");
69         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-pagination.css", "css");
70         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-popover.css", "css");
71         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-progressbar.css", "css");
72         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ds2-tooltip.css", "css");
73         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/global.css", "css");
74
75         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/digital-design-library.css", "css");    
76         /*******DS2 ICONS*******/
77         
78         loadjscssfile("./app/fusion/external/ds2/css/digital-ng-library/ionicons.css", "css");  
79         loadjscssfile("./app/fusion/styles/onap.css", "css");
80         loadjscssfile("./app/fusion/external/angular-gridster/dist/angular-gridster.min.css", "css");
81
82 }
83
84 window.onload = loadResource();
85 /*window.onload = function(){
86         var appLoadingInterval = setInterval(function(){ loadApp() }, 10000);
87         var count=0;
88         function loadApp(){     
89                 count++
90                 if(typeof angular !== 'undefined') {
91                         angular.bootstrap(document, ['abs']);
92                         clearInterval(appLoadingInterval);
93                 }else if(count>10){
94                         clearInterval(appLoadingInterval);
95                 }
96         }
97 }*/