/
load-modules.js
169 lines (154 loc) · 6.58 KB
/
load-modules.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
function custom_require(urls, callback) {
var total = urls.length;
var amount = 0;
for (var index in urls) {
var url = urls[index];
if (navigator.userAgent.indexOf("MSIE") !=-1 || true) {
url += "?random=" + Math.random()*99999;
urls[index] = url;
}
}
require(urls, callback);
}
var loadOS = function() {
$(document).ready(function(){
UTILS.Auth.initialize("http://mcu5.dit.upm.es:5000/v2.0/");
var fiRouter = new OSRouter();
Backbone.history.start();
});
}
var loadRoutes = function() {
custom_require([ "js/routes/os-routes.js"
], function(someModule) {
loadOS();
});
}
var loadViews = function() {
custom_require([ "js/views/LoginView.js",
"js/views/NavTabView.js",
"js/views/TopBarView.js",
"js/views/SideBarView.js",
"js/views/RootView.js",
"js/views/syspanel/OverviewView.js",
"js/views/syspanel/ImageView.js",
"js/views/syspanel/InstanceView.js",
"js/views/syspanel/FlavorView.js",
"js/views/syspanel/ProjectView.js",
"js/views/syspanel/ServiceView.js",
"js/views/syspanel/UserView.js",
"js/views/syspanel/QuotaView.js",
"js/views/nova/OverviewView.js",
"js/views/nova/AccessAndSecurityView.js",
"js/views/nova/InstancesAndVolumesView.js",
"js/views/nova/VolumeDetailView.js",
"js/views/nova/VolumesView.js",
"js/views/nova/InstancesView.js",
"js/views/nova/ImagesAndSnapshotsView.js",
"js/views/nova/ImagesAndInstanceSnapshotsView.js",
"js/views/nova/VolumeSnapshotsView.js",
"js/views/forms/UpdateInstanceView.js",
"js/views/forms/CreateFlavorView.js",
"js/views/forms/UpdateImageView.js",
"js/views/forms/LaunchImageView.js",
"js/views/forms/ConsultImageDetailView.js",
"js/views/forms/ChangePasswordView.js",
"js/views/forms/CreateSnapshotView.js",
"js/views/forms/CreateVolumeSnapshotView.js",
"js/views/forms/CreateVolumeView.js",
"js/views/forms/EditVolumeAttachmentsView.js",
"js/views/forms/ConfirmView.js",
"js/views/nova/InstanceDetailView.js",
"js/views/SettingsView.js",
"js/views/forms/MessagesView.js"
], function(someModule) {
loadRoutes();
});
}
var loadModels = function() {
custom_require(["js/models/FlavorModel.js",
"js/models/OverviewModel.js",
"js/models/ImageModel.js",
"js/models/ProjectModel.js",
"js/models/InstanceModel.js",
"js/models/VolumeModel.js",
"js/models/VolumeSnapshotModel.js",
"js/models/UserModel.js",
"js/models/QuotaModel.js",
"js/models/KeypairModel.js",
"js/models/LoginModel.js",
"js/models/ServiceModel.js",
"js/models/NavTabModel.js",
"js/models/TopBarModel.js"
], function(someModule) {
loadViews();
});
}
var loadUtils = function() {
custom_require([ "js/os-utils.js"
], function(someModule) {
UTILS.i18n.init();
loadModels();
});
}
var loadLibraries = function() {
custom_require([ "lib/backbone.js",
"lib/jstack.js",
"lib/bootstrap.min.js"
], function(someModule) {
loadUtils();
});
}
var loadTemplates = function() {
custom_require(["js/load-templates.js"
], function(someModule) {
loadTemplates([
'templates/auth/login.html',
'templates/forms/updateInstance.html',
'templates/forms/createFlavor.html',
'templates/forms/updateImage.html',
'templates/forms/rebootInstances.html',
'templates/forms/changePassword.html',
'templates/forms/createSnapshot.html',
'templates/forms/createVolumeSnapshot.html',
'templates/forms/createVolume.html',
'templates/forms/editVolumeAttachments.html',
'templates/forms/launchImage.html',
'templates/root/nova/overview.html',
'templates/root/nova/accessAndSecurity.html',
'templates/root/nova/imagesAndSnapshots.html',
'templates/root/nova/imagesAndSnapshots/imagesAndInstanceSnapshots.html',
'templates/root/nova/imagesAndSnapshots/volumeSnapshots.html',
'templates/root/nova/instancesAndVolumes.html',
'templates/root/nova/instancesAndVolumes/instances.html',
'templates/root/nova/instancesAndVolumes/volumes.html',
'templates/root/nova/instanceDetail.html',
'templates/root/nova/imageDetail.html',
'templates/root/nova/volumeDetail.html',
'templates/root/sys/images.html',
'templates/root/sys/overview.html',
'templates/root/sys/instances.html',
'templates/root/sys/services.html',
'templates/root/sys/flavors.html',
'templates/root/sys/projects.html',
'templates/root/sys/users.html',
'templates/root/sys/quotas.html',
'templates/root/root.html',
'templates/root/navTab.html',
'templates/root/topBar.html',
'templates/root/sideBar.html',
'templates/root/confirm.html',
'templates/root/settings.html',
'templates/messages.html'
], function(){
loadLibraries();
});
});
}
var loadModules = function() {
custom_require([ "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",
"lib/underscore.js"
], function(someModule) {
loadTemplates();
});
}
loadModules();