Revision 55097
Added by Alessia Bardi over 5 years ago
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet45-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<modelVersion>4.0.0</modelVersion> |
|
9 |
<groupId>eu.dnetlib</groupId> |
|
10 |
<artifactId>dnet-modular-repositories-ui</artifactId> |
|
11 |
<packaging>jar</packaging> |
|
12 |
<version>4.0.23</version> |
|
13 |
<scm> |
|
14 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23</developerConnection> |
|
15 |
</scm> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>eu.dnetlib</groupId> |
|
19 |
<artifactId>dnet-modular-ui</artifactId> |
|
20 |
<version>[3.0.0,4.0.0)</version> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>eu.dnetlib</groupId> |
|
24 |
<artifactId>dnet-modular-workflows-ui</artifactId> |
|
25 |
<version>[4.0.0,5.0.0)</version> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>eu.dnetlib</groupId> |
|
29 |
<artifactId>dnet-datasource-manager-common</artifactId> |
|
30 |
<version>[1.0.0-SNAPSHOT,2.0.0)</version> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>junit</groupId> |
|
34 |
<artifactId>junit</artifactId> |
|
35 |
<version>${junit.version}</version> |
|
36 |
<scope>test</scope> |
|
37 |
</dependency> |
|
38 |
<dependency> |
|
39 |
<groupId>javax.servlet</groupId> |
|
40 |
<artifactId>javax.servlet-api</artifactId> |
|
41 |
<version>${javax.servlet.version}</version> |
|
42 |
<scope>provided</scope> |
|
43 |
</dependency> |
|
44 |
</dependencies> |
|
45 |
|
|
46 |
<properties> |
|
47 |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|
48 |
</properties> |
|
49 |
|
|
50 |
</project> |
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23/src/main/resources/eu/dnetlib/web/resources/js/repos.js | ||
---|---|---|
1 |
var module = angular.module('reposUI', ['ngGrid', 'ngRoute', 'repoControllers']); |
|
2 |
|
|
3 |
addCommonDirectives(module); |
|
4 |
|
|
5 |
module.config([ |
|
6 |
'$routeProvider', |
|
7 |
function($routeProvider) { |
|
8 |
$routeProvider |
|
9 |
.when('/browse', { templateUrl: '../resources/html/repoBrowse.html', controller: 'repoBrowseCtrl' }) |
|
10 |
.when('/list/:param/:value', { templateUrl: '../resources/html/repoList.html', controller: 'repoListCtrl' }) |
|
11 |
.when('/api/:repoId/:ifaceId/:metawf/:wf', { templateUrl: './repos/repoApi.html', controller: 'repoApiCtrl' }) |
|
12 |
.otherwise({ redirectTo: '/browse' }); |
|
13 |
} |
|
14 |
]); |
|
15 |
|
|
16 |
module.directive('ngApiMdstoreInfo', function() { |
|
17 |
return { |
|
18 |
restrict: 'E', |
|
19 |
scope: { |
|
20 |
'label' : '@', |
|
21 |
'date' : '=', |
|
22 |
'total' : '=', |
|
23 |
'id' : '=' |
|
24 |
}, |
|
25 |
templateUrl: '../resources/html/ngApiMdstoreInfo.html' |
|
26 |
} |
|
27 |
}); |
|
28 |
|
|
29 |
module.directive('ngApiObjectstoreInfo', function() { |
|
30 |
return { |
|
31 |
restrict: 'E', |
|
32 |
scope: { |
|
33 |
'label' : '@', |
|
34 |
'date' : '=', |
|
35 |
'total' : '=', |
|
36 |
'id' : '=' |
|
37 |
}, |
|
38 |
templateUrl: '../resources/html/ngApiObjectstoreInfo.html' |
|
39 |
} |
|
40 |
}); |
|
41 |
|
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23/src/main/resources/eu/dnetlib/web/resources/js/repoControllers.js | ||
---|---|---|
1 |
var repoControllers = angular.module('repoControllers', []); |
|
2 |
|
|
3 |
repoControllers.controller('repoBrowseCtrl', [ |
|
4 |
'$scope', '$http', '$timeout', '$sce', '$location', |
|
5 |
function ($scope, $http, $timeout, $sce, $location) { |
|
6 |
common_init($scope, $http, $sce, $location); |
|
7 |
$scope.repoBrowseFields = getBrowseFields(); |
|
8 |
|
|
9 |
$scope.sortType = 'term'; |
|
10 |
$scope.sortReverse = false; |
|
11 |
|
|
12 |
$scope.repoBrowseData = { 'data' : [] }; |
|
13 |
|
|
14 |
$scope.searchApis = function (text) { |
|
15 |
$scope.go('/list/__SEARCH__/' + text); |
|
16 |
} |
|
17 |
|
|
18 |
$scope.browseApis = function (field, value) { |
|
19 |
$('#showRepoBrowseData').modal('hide'); |
|
20 |
$scope.showSpinner(); |
|
21 |
$timeout(function() { |
|
22 |
$scope.go('/list/' + field + '/' + value); |
|
23 |
}, 1500); |
|
24 |
} |
|
25 |
|
|
26 |
$scope.browseRepoField = function(field) { |
|
27 |
$scope.repoBrowseData = { |
|
28 |
'label' : field.label, |
|
29 |
'id' : field.id, |
|
30 |
'data' : [] |
|
31 |
}; |
|
32 |
$scope.showSpinner(); |
|
33 |
$http.get('browseRepoField.do?field=' + field.id).success( |
|
34 |
function(data) { |
|
35 |
$scope.hideSpinner(); |
|
36 |
$scope.repoBrowseData.data = data; |
|
37 |
$('#showRepoBrowseData').modal('show'); |
|
38 |
} |
|
39 |
).error( |
|
40 |
function() { |
|
41 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
42 |
$scope.hideSpinner(); |
|
43 |
} |
|
44 |
); |
|
45 |
}; |
|
46 |
} |
|
47 |
]); |
|
48 |
|
|
49 |
repoControllers.controller('repoListCtrl', [ |
|
50 |
'$scope', '$http', '$timeout', '$sce', '$routeParams', '$location', |
|
51 |
function ($scope, $http, $timeout, $sce, $routeParams, $location) { |
|
52 |
common_init($scope, $http, $sce, $location); |
|
53 |
|
|
54 |
$scope.sortType = 'repoName'; |
|
55 |
$scope.sortReverse = false; |
|
56 |
$scope.apis = []; |
|
57 |
$scope.currentApiSelectionParam = $routeParams.param; |
|
58 |
$scope.currentApiSelectionValue = $routeParams.value; |
|
59 |
|
|
60 |
$scope.updateApis = function(refresh) { |
|
61 |
$scope.showSpinner(); |
|
62 |
|
|
63 |
var params = { |
|
64 |
'param' : $scope.currentApiSelectionParam, |
|
65 |
'value' : $scope.currentApiSelectionValue |
|
66 |
}; |
|
67 |
if (refresh) { |
|
68 |
params.refresh = 1; |
|
69 |
} |
|
70 |
|
|
71 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
72 |
$http.post('listApis.do', $.param(params)).success( |
|
73 |
function(data) { |
|
74 |
$scope.hideSpinner(); |
|
75 |
$scope.apis = data; |
|
76 |
} |
|
77 |
).error( |
|
78 |
function() { |
|
79 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
80 |
$scope.hideSpinner(); |
|
81 |
} |
|
82 |
); |
|
83 |
}; |
|
84 |
|
|
85 |
$scope.updateApis(false); |
|
86 |
} |
|
87 |
]); |
|
88 |
|
|
89 |
repoControllers.controller('repoApiCtrl', [ |
|
90 |
'$scope', '$http', '$timeout', '$sce', '$routeParams', '$location', |
|
91 |
function ($scope, $http, $timeout, $sce, $routeParams, $location) { |
|
92 |
common_init($scope, $http, $sce, $location); |
|
93 |
|
|
94 |
commonInitialize($scope, $http, $sce); |
|
95 |
wf_init($scope, $http, $sce); |
|
96 |
|
|
97 |
$scope.availableRepohiWfs = getAvailableRepohiWfs(); |
|
98 |
$scope.compatibilityLevels = getCompatibilityLevels(); |
|
99 |
|
|
100 |
$scope.validatorBlacklistAddress = ''; |
|
101 |
$scope.validatorBlacklistAddress = ''; |
|
102 |
|
|
103 |
$scope.currentRepoApi = {}; |
|
104 |
$scope.currentSets = []; |
|
105 |
$scope.selectedSets = []; |
|
106 |
|
|
107 |
$scope.loadApi = function() { |
|
108 |
$scope.showSpinner(); |
|
109 |
$(".btnRefreshApi").attr("disabled", "disabled"); |
|
110 |
$http.get('repoApi.get?repoId=' + $routeParams.repoId + "&ifaceId=" + $routeParams.ifaceId) |
|
111 |
.success( |
|
112 |
function(data) { |
|
113 |
$scope.currentRepoApi = data; |
|
114 |
$scope.metaworkflows = data.metaWFs; |
|
115 |
|
|
116 |
angular.forEach(data.otherParams, function(term){ |
|
117 |
if (term.id == 'last_validation_job') { |
|
118 |
if (getValidatorAddress()) { |
|
119 |
$scope.validatorDetailsAddress = getValidatorAddress() + "/prepareSummary.action?jobId=" + term.value; |
|
120 |
} |
|
121 |
if (getValidatorServiceAddress()) { |
|
122 |
$scope.validatorBlacklistAddress = getValidatorServiceAddress() + "/workflows?request=GetBlacklistedRecords&datasourceId=" + $routeParams.repoId; |
|
123 |
} |
|
124 |
} |
|
125 |
}); |
|
126 |
|
|
127 |
if (data.protocol == 'oai') { |
|
128 |
var found = false; |
|
129 |
angular.forEach(data.accessParams, function(param, pos){ |
|
130 |
if (param.name == 'set') { |
|
131 |
$scope.listSets($scope.currentRepoApi.accessParams); |
|
132 |
} |
|
133 |
}); |
|
134 |
} |
|
135 |
$scope.hideSpinner(); |
|
136 |
|
|
137 |
$(".btnRefreshApi").removeAttr("disabled"); |
|
138 |
|
|
139 |
if ($routeParams.metawf != 'ALL' && $routeParams.wf != 'ALL') { |
|
140 |
$scope.getAtomicWorkflowAndMetaWf($routeParams.metawf, $routeParams.wf); |
|
141 |
$timeout(function() { |
|
142 |
$("#collapse_" + $routeParams.metawf.substring(0, 36)).collapse('show'); |
|
143 |
}, 2000); |
|
144 |
} |
|
145 |
} |
|
146 |
).error( |
|
147 |
function() { |
|
148 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
149 |
$scope.hideSpinner(); |
|
150 |
} |
|
151 |
); |
|
152 |
}; |
|
153 |
|
|
154 |
|
|
155 |
$scope.removeApi = function() { |
|
156 |
if (confirm("You are deleting the current API.\n\nAre you sure?")) { |
|
157 |
$scope.showSpinner(); |
|
158 |
$http.get('repoApi.delete?repo=' + $routeParams.repoId + "&iface=" + $routeParams.ifaceId).success(function(data) { |
|
159 |
alert("The API has been deleted !!!"); |
|
160 |
$scope.hideSpinner(); |
|
161 |
$scope.go("/browse"); |
|
162 |
}).error(function(err) { |
|
163 |
$scope.showError('Error removing API: ' + err.message); |
|
164 |
$scope.hideSpinner(); |
|
165 |
}); |
|
166 |
} |
|
167 |
}; |
|
168 |
|
|
169 |
|
|
170 |
$scope.newDataProviderWorkflow = function (wf) { |
|
171 |
|
|
172 |
if (wf == undefined) { |
|
173 |
$scope.showError('Please choose a workflow !'); |
|
174 |
return; |
|
175 |
} |
|
176 |
|
|
177 |
$scope.showSpinner(); |
|
178 |
|
|
179 |
$scope.metaworkflows.push({"id":"","name":"Waiting...","status":"MISSING","progress":0}); |
|
180 |
|
|
181 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
182 |
$http.post('repoMetaWf.new', $.param({ |
|
183 |
'wf' : wf, |
|
184 |
'iface' : $scope.currentRepoApi.id, |
|
185 |
'id' : $scope.currentRepoApi.repoId, |
|
186 |
'name' : $scope.currentRepoApi.repoName |
|
187 |
})).success( |
|
188 |
function(data) { |
|
189 |
$scope.hideSpinner(); |
|
190 |
$(".btnRefreshApi").attr("disabled", "disabled"); |
|
191 |
$timeout(function () { $scope.loadApi() }, 7000); |
|
192 |
} |
|
193 |
).error( |
|
194 |
function() { |
|
195 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
196 |
$scope.hideSpinner(); |
|
197 |
} |
|
198 |
); |
|
199 |
}; |
|
200 |
|
|
201 |
$scope.destroyDataProviderWorkflow = function (metaWf) { |
|
202 |
|
|
203 |
if (metaWf.destroyWorkflow == undefined) { |
|
204 |
$scope.showError('Destroy wf is missing !'); |
|
205 |
return; |
|
206 |
} |
|
207 |
|
|
208 |
if (!confirm("Are you sure ?")) { |
|
209 |
return; |
|
210 |
} |
|
211 |
|
|
212 |
$scope.showSpinner(); |
|
213 |
|
|
214 |
metaWf.deleting = true; |
|
215 |
|
|
216 |
$http.get('repoMetaWf.destroy?destroyWf=' + metaWf.destroyWorkflow) |
|
217 |
.success( |
|
218 |
function(data) { |
|
219 |
$scope.hideSpinner(); |
|
220 |
$(".btnRefreshApi").attr("disabled", "disabled"); |
|
221 |
$timeout(function () { $scope.loadApi() }, 7000); |
|
222 |
} |
|
223 |
).error( |
|
224 |
function() { |
|
225 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
226 |
$scope.hideSpinner(); |
|
227 |
} |
|
228 |
); |
|
229 |
}; |
|
230 |
|
|
231 |
$scope.testOAI = function (params) { |
|
232 |
angular.forEach(params, function(param, pos){ |
|
233 |
if (param.name == 'baseUrl') { |
|
234 |
location.href = "oaiExplorer.do?oaiBaseUrl=" + param.value; |
|
235 |
} |
|
236 |
}); |
|
237 |
} |
|
238 |
|
|
239 |
$scope.prepareUpdateRepoApi = function() { |
|
240 |
$scope.tempAccessParams = angular.copy($scope.currentRepoApi.accessParams); |
|
241 |
|
|
242 |
$scope.tempMdIdPath = ''; |
|
243 |
angular.forEach($scope.currentRepoApi.otherParams, function(param, pos){ |
|
244 |
if (param.name == 'metadata_identifier_path') { |
|
245 |
$scope.tempMdIdPath = param.value; |
|
246 |
} |
|
247 |
}); |
|
248 |
} |
|
249 |
|
|
250 |
|
|
251 |
$scope.updateRepoApi = function() { |
|
252 |
$scope.showSpinner(); |
|
253 |
|
|
254 |
var map = {}; |
|
255 |
angular.forEach($scope.tempAccessParams, function(param, pos){ |
|
256 |
if (param.name) { |
|
257 |
map[param.name] = param.value |
|
258 |
} |
|
259 |
}); |
|
260 |
|
|
261 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
262 |
$http.post('repoApi.update', $.param({ |
|
263 |
'id' : $scope.currentRepoApi.repoId, |
|
264 |
'iface' : $scope.currentRepoApi.id, |
|
265 |
'mdIdPath' : $scope.tempMdIdPath, |
|
266 |
'accessParams' : JSON.stringify(map) |
|
267 |
})).success(function(data) { |
|
268 |
$scope.showNotification('Api correctly saved !'); |
|
269 |
$scope.loadApi(); |
|
270 |
}).error(function(err) { |
|
271 |
$scope.hideSpinner(); |
|
272 |
$scope.showError('Error updating api: ' + err.message); |
|
273 |
}); |
|
274 |
}; |
|
275 |
|
|
276 |
|
|
277 |
$scope.updateSets = function(selection, accessParams) { |
|
278 |
var s = selection.join(); |
|
279 |
angular.forEach(accessParams, function(param, pos){ |
|
280 |
if (param.name == 'set') { |
|
281 |
param.value = s; |
|
282 |
} |
|
283 |
}); |
|
284 |
} |
|
285 |
|
|
286 |
$scope.listSets = function(accessParams) { |
|
287 |
var baseUrl = ''; |
|
288 |
|
|
289 |
$scope.selectedSets = []; |
|
290 |
$scope.currentSets = []; |
|
291 |
|
|
292 |
angular.forEach(accessParams, function(param, pos){ |
|
293 |
if (param.name == 'baseUrl') { |
|
294 |
baseUrl = param.value |
|
295 |
} |
|
296 |
if (param.name == 'set') { |
|
297 |
$scope.selectedSets = param.value.split(","); |
|
298 |
} |
|
299 |
}); |
|
300 |
|
|
301 |
if (!baseUrl) { |
|
302 |
$scope.showError("baseUrl param is missing"); |
|
303 |
return; |
|
304 |
} |
|
305 |
|
|
306 |
$scope.showSpinner(); |
|
307 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
308 |
$http.post("listValidValuesForParam.do", $.param({ |
|
309 |
'protocol' : 'oai', |
|
310 |
'param' : 'set', |
|
311 |
'baseUrl' : baseUrl |
|
312 |
})).success(function(data) { |
|
313 |
$scope.hideSpinner(); |
|
314 |
$scope.currentSets = data; |
|
315 |
angular.forEach($scope.currentSets, function(curr, pos1) { |
|
316 |
angular.forEach($scope.selectedSets, function(sel, pos2) { |
|
317 |
if (curr.id.trim() == sel.trim()) { |
|
318 |
curr.selected = true; |
|
319 |
} |
|
320 |
}); |
|
321 |
}); |
|
322 |
}).error(function() { |
|
323 |
$scope.hideSpinner(); |
|
324 |
$scope.showError("baseUrl param is missing"); |
|
325 |
}); |
|
326 |
|
|
327 |
}; |
|
328 |
|
|
329 |
|
|
330 |
$scope.verifyMetaWf = function(ds, wf) { |
|
331 |
var compliance = ''; |
|
332 |
var type = ''; |
|
333 |
angular.forEach(ds.commonParams, function(p,pos) { |
|
334 |
if (p.id == 'compliance') { |
|
335 |
compliance = p.value; |
|
336 |
} |
|
337 |
if (p.id == 'typology') { |
|
338 |
type = p.value; |
|
339 |
} |
|
340 |
}); |
|
341 |
|
|
342 |
return (compliance && type && $scope.isValidTerm(compliance, wf.compliances) && $scope.isValidTerm(type, wf.ifaceTypes)); |
|
343 |
} |
|
344 |
|
|
345 |
$scope.isValidTerm = function(term, list) { |
|
346 |
|
|
347 |
if (list.length == 0) { |
|
348 |
return true; |
|
349 |
} |
|
350 |
var res = false; |
|
351 |
angular.forEach(list, function(curr,pos) { |
|
352 |
if (term.lastIndexOf(curr, 0) === 0) { // implementation of term.startsWith(curr) |
|
353 |
res = true; |
|
354 |
} |
|
355 |
}); |
|
356 |
return res; |
|
357 |
} |
|
358 |
|
|
359 |
$scope.overrideApiCompliance = function(level) { |
|
360 |
$scope.showSpinner(); |
|
361 |
$http.get('repoApiCompliance.update?id=' + $scope.currentRepoApi.repoId + '&iface=' + $scope.currentRepoApi.id + '&compliance=' + level) |
|
362 |
.success( |
|
363 |
function(data) { |
|
364 |
$scope.hideSpinner(); |
|
365 |
$scope.showNotification('Api correctly updated !'); |
|
366 |
$scope.loadApi(); |
|
367 |
} |
|
368 |
).error( |
|
369 |
function() { |
|
370 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
371 |
$scope.hideSpinner(); |
|
372 |
} |
|
373 |
); |
|
374 |
} |
|
375 |
|
|
376 |
$scope.resetApiCompliance = function() { |
|
377 |
$scope.showSpinner(); |
|
378 |
$http.get('repoApiCompliance.reset?id=' + $scope.currentRepoApi.repoId + '&iface=' + $scope.currentRepoApi.id) |
|
379 |
.success( |
|
380 |
function(data) { |
|
381 |
$scope.hideSpinner(); |
|
382 |
$scope.showNotification('Api correctly updated !'); |
|
383 |
$scope.loadApi(); |
|
384 |
} |
|
385 |
).error( |
|
386 |
function() { |
|
387 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
388 |
$scope.hideSpinner(); |
|
389 |
} |
|
390 |
); |
|
391 |
} |
|
392 |
|
|
393 |
$scope.loadApi(); |
|
394 |
} |
|
395 |
|
|
396 |
]); |
|
397 |
|
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23/src/main/resources/eu/dnetlib/web/resources/js/addRepoApi.js | ||
---|---|---|
1 |
var module = angular.module('addRepoApiUI', ['localytics.directives']); |
|
2 |
|
|
3 |
module.directive('bsHasError', function() { |
|
4 |
return { |
|
5 |
restrict: "A", |
|
6 |
link: function(scope, element, attrs, ctrl) { |
|
7 |
element.toggleClass('has-feedback', true); |
|
8 |
var input = element.find('input[ng-model], select[ng-model]'); |
|
9 |
if (input) { |
|
10 |
scope.$watch(function() { |
|
11 |
if (input.hasClass('ng-invalid')) { |
|
12 |
return 0; |
|
13 |
} else if (input.hasClass('empty')) { |
|
14 |
return 1; |
|
15 |
} else { |
|
16 |
return 2; |
|
17 |
} |
|
18 |
}, function(code) { |
|
19 |
if (code < 0) return; |
|
20 |
|
|
21 |
element.toggleClass('has-error', (code == 0)); |
|
22 |
element.toggleClass('has-warning', (code == 1)); |
|
23 |
element.toggleClass('has-success', (code == 2)); |
|
24 |
|
|
25 |
var feedback = element.find('.form-control-feedback'); |
|
26 |
if (feedback) { |
|
27 |
feedback.toggleClass('glyphicon-remove', (code == 0)); |
|
28 |
feedback.toggleClass('glyphicon-warning-sign', (code == 1)); |
|
29 |
feedback.toggleClass('glyphicon-ok', (code == 2)); |
|
30 |
} |
|
31 |
}); |
|
32 |
} |
|
33 |
} |
|
34 |
}; |
|
35 |
}); |
|
36 |
|
|
37 |
module.directive('ngSelectRepoField', function($http) { |
|
38 |
return { |
|
39 |
restrict: 'E', |
|
40 |
scope: { |
|
41 |
'label' : '@', |
|
42 |
'typology' : '=', |
|
43 |
'selection' : '=' |
|
44 |
}, |
|
45 |
templateUrl: '../resources/html/addRepoApi/ngSelectRepoField.html', |
|
46 |
link: function(scope, element, attrs, ctrl) { |
|
47 |
scope.repositories = []; |
|
48 |
scope.current = ''; |
|
49 |
scope.$watch('typology', function() { |
|
50 |
scope.repositories = []; |
|
51 |
if (scope.typology) { |
|
52 |
showSpinner(); |
|
53 |
$http.get('listRepositories.json?type=' + scope.typology).success(function(data) { |
|
54 |
scope.repositories = data; |
|
55 |
hideSpinner(); |
|
56 |
}).error(function() { |
|
57 |
show_notification("error", "An error occurred while fetching datasource of type " + scope.typology); |
|
58 |
hideSpinner(); |
|
59 |
}); |
|
60 |
} |
|
61 |
}); |
|
62 |
} |
|
63 |
} |
|
64 |
}); |
|
65 |
|
|
66 |
module.directive('ngFixedValueField', function() { |
|
67 |
return { |
|
68 |
restrict: 'E', |
|
69 |
scope: { |
|
70 |
'label' : '@', |
|
71 |
'value' : '=' |
|
72 |
}, |
|
73 |
templateUrl: '../resources/html/addRepoApi/ngFixedValueField.html' |
|
74 |
} |
|
75 |
}); |
|
76 |
|
|
77 |
module.directive('ngApiIdValidation', function() { |
|
78 |
return { |
|
79 |
restrict: 'A', |
|
80 |
scope: { |
|
81 |
'valid' : '=' |
|
82 |
}, |
|
83 |
require: 'ng-model', |
|
84 |
link: function(scope, element, attrs, ctrl) { |
|
85 |
scope.$watch('valid', function() { |
|
86 |
ctrl.$setValidity('wrongId', scope.valid); |
|
87 |
}); |
|
88 |
} |
|
89 |
} |
|
90 |
}); |
|
91 |
|
|
92 |
module.directive('ngApiIdField', function() { |
|
93 |
return { |
|
94 |
restrict: 'E', |
|
95 |
scope: { |
|
96 |
'label' : '@', |
|
97 |
'prefix' : '@', |
|
98 |
'selection' : '=', |
|
99 |
'exclusion' : '=' |
|
100 |
}, |
|
101 |
templateUrl: '../resources/html/addRepoApi/ngApiIdField.html', |
|
102 |
link: function(scope, element, attrs) { |
|
103 |
scope.suffix = ''; |
|
104 |
scope.alert = ''; |
|
105 |
scope.valid = false; |
|
106 |
scope.required = true; |
|
107 |
scope.mypattern = new RegExp(scope.regex); |
|
108 |
|
|
109 |
scope.validate = function(b, newValue, message) { |
|
110 |
scope.valid = b; |
|
111 |
scope.selection = newValue; |
|
112 |
scope.alert = message; |
|
113 |
element.toggleClass('has-error', !b); |
|
114 |
element.toggleClass('has-success', b); |
|
115 |
var feedback = element.find('.form-control-feedback'); |
|
116 |
if (feedback) { |
|
117 |
feedback.toggleClass('glyphicon-remove', !b); |
|
118 |
feedback.toggleClass('glyphicon-ok', b); |
|
119 |
} |
|
120 |
} |
|
121 |
|
|
122 |
scope.$watch('suffix', function() { |
|
123 |
var tmpId = scope.prefix + scope.suffix; |
|
124 |
|
|
125 |
if (!scope.suffix) { |
|
126 |
scope.validate(false, '', 'ID is empty'); |
|
127 |
} else if (!scope.suffix.match(/^[A-Za-z0-9_]*$/g)) { |
|
128 |
scope.validate(false, '', 'Invalid format, valid chars are: A-Za-z0-9_'); |
|
129 |
} else if($.inArray(tmpId, scope.exclusion) > -1) { |
|
130 |
scope.validate(false, '', 'The ID already exists'); |
|
131 |
} else { |
|
132 |
scope.selection = tmpId; |
|
133 |
scope.validate(true, tmpId, ''); |
|
134 |
} |
|
135 |
}); |
|
136 |
} |
|
137 |
} |
|
138 |
}); |
|
139 |
|
|
140 |
module.directive('ngSelectVocabularyField', function() { |
|
141 |
return { |
|
142 |
restrict: 'E', |
|
143 |
scope: { |
|
144 |
'label' : '@', |
|
145 |
'vocabulary' : '=', |
|
146 |
'selection' : '=', |
|
147 |
'contextualParams' : '=' |
|
148 |
}, |
|
149 |
templateUrl: '../resources/html/addRepoApi/ngSelectVocabularyField.html', |
|
150 |
link: function(scope, elem, attrs) { |
|
151 |
scope.required = true; |
|
152 |
scope.selectId = 'select_' + scope.label.replace( /\s/g, "_").toLowerCase(); |
|
153 |
|
|
154 |
scope.$watch('selection', function() { |
|
155 |
scope.contextualParams = []; |
|
156 |
angular.forEach(scope.vocabulary, function(term){ |
|
157 |
if (term.name == scope.selection) { |
|
158 |
scope.contextualParams = term.params; |
|
159 |
} |
|
160 |
}); |
|
161 |
}); |
|
162 |
} |
|
163 |
} |
|
164 |
}); |
|
165 |
|
|
166 |
module.filter('vocabularyTerm', function() { |
|
167 |
return function(term) { |
|
168 |
if(term.desc) { |
|
169 |
return term.name + ' (' + term.desc + ')'; |
|
170 |
} else { |
|
171 |
return term.name; |
|
172 |
} |
|
173 |
}; |
|
174 |
}); |
|
175 |
|
|
176 |
module.directive('ngSimpleEditField', function() { |
|
177 |
return { |
|
178 |
restrict: 'E', |
|
179 |
scope: { |
|
180 |
'label' : '@', |
|
181 |
'regex' : '@', |
|
182 |
'optional' : '@', |
|
183 |
'type' : '@', |
|
184 |
'selection' : '=', |
|
185 |
}, |
|
186 |
templateUrl: '../resources/html/addRepoApi/ngSimpleEditField.html', |
|
187 |
link: function(scope, element, attrs) { |
|
188 |
scope.required = (scope.optional != 'true'); |
|
189 |
if (scope.regex) { scope.mypattern = new RegExp(scope.regex); } |
|
190 |
else if (scope.type == 'NUMBER') { scope.mypattern = new RegExp("^[-+]?[0-9]+(\.[0-9]+)?$"); } |
|
191 |
else if (scope.type == 'BOOLEAN') { scope.mypattern = new RegExp("^(true|false)$"); } |
|
192 |
else { scope.mypattern = new RegExp(".+"); } |
|
193 |
} |
|
194 |
} |
|
195 |
}); |
|
196 |
|
|
197 |
module.directive('ngSimpleSelectField', function() { |
|
198 |
return { |
|
199 |
restrict: 'E', |
|
200 |
scope: { |
|
201 |
'label' : '@', |
|
202 |
'optional' : '@', |
|
203 |
'refreshFunction' : '&', |
|
204 |
'validValues' : '=', |
|
205 |
'selection' : '=' |
|
206 |
}, |
|
207 |
templateUrl: '../resources/html/addRepoApi/ngSimpleSelectField.html', |
|
208 |
link: function(scope, element, attrs) { |
|
209 |
scope.required = (scope.optional != 'true'); |
|
210 |
scope.populateList = function() { |
|
211 |
scope.validValues = scope.functionList(); |
|
212 |
} |
|
213 |
} |
|
214 |
} |
|
215 |
}); |
|
216 |
|
|
217 |
|
|
218 |
module.directive('ngMultiSelectField', function() { |
|
219 |
return { |
|
220 |
restrict: 'E', |
|
221 |
scope: { |
|
222 |
'label' : '@', |
|
223 |
'optional' : '@', |
|
224 |
'refreshFunction' : '&', |
|
225 |
'validValues' : '=', |
|
226 |
'selection' : '=' |
|
227 |
}, |
|
228 |
templateUrl: '../resources/html/addRepoApi/ngMultiSelectField.html', |
|
229 |
link: function(scope, element, attrs) { |
|
230 |
scope.arraySelection = []; |
|
231 |
scope.required = (scope.optional != 'true'); |
|
232 |
scope.$watch('arraySelection', function() { |
|
233 |
scope.selection = scope.arraySelection.join(); |
|
234 |
}); |
|
235 |
} |
|
236 |
} |
|
237 |
}); |
|
238 |
|
|
239 |
|
|
240 |
module.controller('addRepoApiCtrl', function ($scope, $http, $sce, $location) { |
|
241 |
|
|
242 |
common_init($scope, $http, $sce, $location) |
|
243 |
|
|
244 |
$scope.values = { |
|
245 |
'compliances' : getCompliances(), |
|
246 |
'types' : getTypes(), |
|
247 |
'contentDescriptions' : getContentDescriptions(), |
|
248 |
'protocols' : getProtocols() |
|
249 |
} |
|
250 |
|
|
251 |
$scope.$watch('repo', function() { |
|
252 |
if ($scope.repo) { |
|
253 |
$scope.apiParams = {}; |
|
254 |
$scope.api = { |
|
255 |
'typology' : $scope.repo.typology, |
|
256 |
'apiParams' : [] |
|
257 |
}; |
|
258 |
} |
|
259 |
}); |
|
260 |
|
|
261 |
$scope.resetForm = function() { |
|
262 |
$scope.currentParams = []; |
|
263 |
$scope.selectedTypology = ''; |
|
264 |
$scope.repo = {}; |
|
265 |
$scope.api = {}; |
|
266 |
$scope.apiParams = {}; |
|
267 |
$scope.validValues = []; |
|
268 |
} |
|
269 |
|
|
270 |
$scope.registerApi = function() { |
|
271 |
if (confirm('Add new api to repository \n\n' + $scope.repo.name + '?')) { |
|
272 |
|
|
273 |
$scope.api.apiParams = []; |
|
274 |
angular.forEach($scope.apiParams, function(value, param) { |
|
275 |
$scope.api.apiParams.push({ |
|
276 |
'param' : param, |
|
277 |
'value' : value |
|
278 |
}); |
|
279 |
}); |
|
280 |
|
|
281 |
$scope.showSpinner(); |
|
282 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
283 |
$http.post('repoApi.new', $.param({ |
|
284 |
'repoId' : $scope.repo.origId, |
|
285 |
'iface' : JSON.stringify($scope.api) |
|
286 |
})).success(function(res) { |
|
287 |
if(res) { |
|
288 |
$scope.showNotification('The API has been registered'); |
|
289 |
$scope.hideSpinner(); |
|
290 |
$scope.done = 1; |
|
291 |
//TODO once we'll get rid of pending/valid repo state, we'll ba able to redirect to the repo detail page |
|
292 |
//location.href = 'isManager.do#/profile/' + $scope.repo.id; |
|
293 |
} else { |
|
294 |
$scope.hideSpinner(); |
|
295 |
$scope.showError('Registration failed'); |
|
296 |
} |
|
297 |
}).error(function(err) { |
|
298 |
$scope.hideSpinner(); |
|
299 |
$scope.showError('Registration failed: ' + err.message); |
|
300 |
}); |
|
301 |
} |
|
302 |
} |
|
303 |
|
|
304 |
$scope.listValidValuesForParam = function(param) { |
|
305 |
if (!param) { |
|
306 |
$scope.showError("Invalid param"); |
|
307 |
return; |
|
308 |
} |
|
309 |
|
|
310 |
if (!$scope.api.protocol) { |
|
311 |
$scope.showError("Access Protocol is missing"); |
|
312 |
return; |
|
313 |
} |
|
314 |
if (!$scope.api.baseurl) { |
|
315 |
$scope.showError("BaseUrl is missing"); |
|
316 |
return; |
|
317 |
} |
|
318 |
|
|
319 |
var key = $scope.api.baseurl + '@@@' + param; |
|
320 |
$scope.validValues[key] = []; |
|
321 |
|
|
322 |
$scope.showSpinner(); |
|
323 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
324 |
$http.post('listValidValuesForParam.do', $.param({ |
|
325 |
'protocol' : $scope.api.protocol, |
|
326 |
'param' : param, |
|
327 |
'baseUrl' : $scope.api.baseurl, |
|
328 |
})).success(function(data) { |
|
329 |
$scope.hideSpinner(); |
|
330 |
$scope.validValues[key] = data; |
|
331 |
}).error(function(message) { |
|
332 |
$scope.hideSpinner(); |
|
333 |
$scope.showError('Error obtaining values: ' + message); |
|
334 |
}); |
|
335 |
} |
|
336 |
|
|
337 |
$scope.resetForm(); |
|
338 |
}); |
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23/src/main/resources/eu/dnetlib/web/resources/js/addRepo.js | ||
---|---|---|
1 |
var module = angular.module('addRepoUI', []); |
|
2 |
|
|
3 |
module.directive('bsHasError', function() { |
|
4 |
return { |
|
5 |
restrict: "A", |
|
6 |
link: function(scope, element, attrs, ctrl) { |
|
7 |
element.toggleClass('has-feedback', true); |
|
8 |
var input = element.find('input[ng-model], select[ng-model]'); |
|
9 |
if (input) { |
|
10 |
scope.$watch(function() { |
|
11 |
if (input.hasClass('ng-invalid')) { |
|
12 |
return 0; |
|
13 |
} else if (input.hasClass('empty')) { |
|
14 |
return 1; |
|
15 |
} else { |
|
16 |
return 2; |
|
17 |
} |
|
18 |
}, function(code) { |
|
19 |
if (code < 0) return; |
|
20 |
|
|
21 |
element.toggleClass('has-error', (code == 0)); |
|
22 |
element.toggleClass('has-warning', (code == 1)); |
|
23 |
element.toggleClass('has-success', (code == 2)); |
|
24 |
|
|
25 |
var feedback = element.find('.form-control-feedback'); |
|
26 |
if (feedback) { |
|
27 |
feedback.toggleClass('glyphicon-remove', (code == 0)); |
|
28 |
feedback.toggleClass('glyphicon-warning-sign', (code == 1)); |
|
29 |
feedback.toggleClass('glyphicon-ok', (code == 2)); |
|
30 |
} |
|
31 |
}); |
|
32 |
} |
|
33 |
} |
|
34 |
}; |
|
35 |
}); |
|
36 |
|
|
37 |
module.directive('ngSelectVocabularyField', function() { |
|
38 |
return { |
|
39 |
restrict: 'E', |
|
40 |
scope: { |
|
41 |
'label' : '@', |
|
42 |
'vocabulary' : '=', |
|
43 |
'selection' : '=', |
|
44 |
'contextualParams' : '=' |
|
45 |
}, |
|
46 |
templateUrl: '../resources/html/addRepoApi/ngSelectVocabularyField.html', |
|
47 |
link: function(scope, elem, attrs) { |
|
48 |
scope.required = true; |
|
49 |
scope.selectId = 'select_' + scope.label.replace( /\s/g, "_").toLowerCase(); |
|
50 |
|
|
51 |
scope.$watch('selection', function() { |
|
52 |
scope.contextualParams = []; |
|
53 |
angular.forEach(scope.vocabulary, function(term){ |
|
54 |
if (term.name == scope.selection) { |
|
55 |
scope.contextualParams = term.params; |
|
56 |
} |
|
57 |
}); |
|
58 |
}); |
|
59 |
} |
|
60 |
} |
|
61 |
}); |
|
62 |
|
|
63 |
module.filter('vocabularyTerm', function() { |
|
64 |
return function(term) { |
|
65 |
if(term.desc) { |
|
66 |
return term.name + ' (' + term.desc + ')'; |
|
67 |
} else { |
|
68 |
return term.name; |
|
69 |
} |
|
70 |
}; |
|
71 |
}); |
|
72 |
|
|
73 |
module.directive('ngSimpleEditField', function() { |
|
74 |
return { |
|
75 |
restrict: 'E', |
|
76 |
scope: { |
|
77 |
'label' : '@', |
|
78 |
'regex' : '@', |
|
79 |
'optional' : '@', |
|
80 |
'type' : '@', |
|
81 |
'selection' : '=', |
|
82 |
}, |
|
83 |
templateUrl: '../resources/html/addRepoApi/ngSimpleEditField.html', |
|
84 |
link: function(scope, element, attrs) { |
|
85 |
scope.required = (scope.optional != 'true'); |
|
86 |
if (scope.regex) { scope.mypattern = new RegExp(scope.regex); } |
|
87 |
else if (scope.type == 'NUMBER') { scope.mypattern = new RegExp("^[-+]?[0-9]+(\.[0-9]+)?$"); } |
|
88 |
else if (scope.type == 'BOOLEAN') { scope.mypattern = new RegExp("^(true|false)$"); } |
|
89 |
else { scope.mypattern = new RegExp(".+"); } |
|
90 |
} |
|
91 |
} |
|
92 |
}); |
|
93 |
|
|
94 |
module.controller('addRepoCtrl', function ($scope, $http, $sce, $location) { |
|
95 |
|
|
96 |
common_init($scope, $http, $sce, $location) |
|
97 |
|
|
98 |
$scope.validTypes = getTypes(); |
|
99 |
$scope.validCountries = getCountries(); |
|
100 |
|
|
101 |
$scope.resetForm = function() { |
|
102 |
$scope.repo = { |
|
103 |
latitude : '0.0', |
|
104 |
longitude : '0.0', |
|
105 |
timezone : '0.0', |
|
106 |
}; |
|
107 |
|
|
108 |
$scope.org = {}; |
|
109 |
} |
|
110 |
|
|
111 |
$scope.registerRepo = function() { |
|
112 |
if (confirm('Add new datasource \n\n' + $scope.repo.officialname + '?')) { |
|
113 |
$scope.showSpinner(); |
|
114 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
115 |
|
|
116 |
$scope.org.id = 'openaire____::' + $scope.repo.id; |
|
117 |
$scope.repo.organizations = [$scope.org]; |
|
118 |
|
|
119 |
$http.post('repo.new', $.param({ |
|
120 |
'repo' : JSON.stringify($scope.repo) |
|
121 |
})).success(function(res) { |
|
122 |
if(res) { |
|
123 |
$scope.showNotification('The Datasource has been registered'); |
|
124 |
$scope.hideSpinner(); |
|
125 |
$scope.done = 1; |
|
126 |
} else { |
|
127 |
$scope.hideSpinner(); |
|
128 |
$scope.showError('Registration failed'); |
|
129 |
} |
|
130 |
}).error(function(message) { |
|
131 |
$scope.hideSpinner(); |
|
132 |
$scope.showError('Registration failed: ' + message); |
|
133 |
}); |
|
134 |
} |
|
135 |
} |
|
136 |
|
|
137 |
$scope.resetForm(); |
|
138 |
}); |
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.23/src/main/resources/eu/dnetlib/web/resources/js/chosen/angular-chosen.js | ||
---|---|---|
1 |
// Generated by CoffeeScript 1.8.0 |
|
2 |
(function() { |
|
3 |
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; |
|
4 |
|
|
5 |
angular.module('localytics.directives', []); |
|
6 |
|
|
7 |
angular.module('localytics.directives').directive('chosen', [ |
|
8 |
'$timeout', function($timeout) { |
|
9 |
var CHOSEN_OPTION_WHITELIST, NG_OPTIONS_REGEXP, isEmpty, snakeCase; |
|
10 |
NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/; |
|
11 |
CHOSEN_OPTION_WHITELIST = ['noResultsText', 'allowSingleDeselect', 'disableSearchThreshold', 'disableSearch', 'enableSplitWordSearch', 'inheritSelectClasses', 'maxSelectedOptions', 'placeholderTextMultiple', 'placeholderTextSingle', 'searchContains', 'singleBackstrokeDelete', 'displayDisabledOptions', 'displaySelectedOptions', 'width']; |
|
12 |
snakeCase = function(input) { |
|
13 |
return input.replace(/[A-Z]/g, function($1) { |
|
14 |
return "_" + ($1.toLowerCase()); |
|
15 |
}); |
|
16 |
}; |
|
17 |
isEmpty = function(value) { |
|
18 |
var key; |
|
19 |
if (angular.isArray(value)) { |
|
20 |
return value.length === 0; |
|
21 |
} else if (angular.isObject(value)) { |
|
22 |
for (key in value) { |
|
23 |
if (value.hasOwnProperty(key)) { |
|
24 |
return false; |
|
25 |
} |
|
26 |
} |
|
27 |
} |
|
28 |
return true; |
|
29 |
}; |
|
30 |
return { |
|
31 |
restrict: 'A', |
|
32 |
require: '?ngModel', |
|
33 |
terminal: true, |
|
34 |
link: function(scope, element, attr, ngModel) { |
|
35 |
var chosen, defaultText, disableWithMessage, empty, initOrUpdate, match, options, origRender, removeEmptyMessage, startLoading, stopLoading, valuesExpr, viewWatch; |
|
36 |
element.addClass('localytics-chosen'); |
|
37 |
options = scope.$eval(attr.chosen) || {}; |
|
38 |
angular.forEach(attr, function(value, key) { |
|
39 |
if (__indexOf.call(CHOSEN_OPTION_WHITELIST, key) >= 0) { |
|
40 |
return options[snakeCase(key)] = scope.$eval(value); |
|
41 |
} |
|
42 |
}); |
|
43 |
startLoading = function() { |
|
44 |
return element.addClass('loading').attr('disabled', true).trigger('chosen:updated'); |
|
45 |
}; |
|
46 |
stopLoading = function() { |
|
47 |
return element.removeClass('loading').attr('disabled', false).trigger('chosen:updated'); |
|
48 |
}; |
|
49 |
chosen = null; |
|
50 |
defaultText = null; |
|
51 |
empty = false; |
|
52 |
initOrUpdate = function() { |
|
53 |
if (chosen) { |
|
54 |
return element.trigger('chosen:updated'); |
|
55 |
} else { |
|
56 |
chosen = element.chosen(options).data('chosen'); |
|
57 |
return defaultText = chosen.default_text; |
|
58 |
} |
|
59 |
}; |
|
60 |
removeEmptyMessage = function() { |
|
61 |
empty = false; |
|
62 |
return element.attr('data-placeholder', defaultText); |
|
63 |
}; |
|
64 |
disableWithMessage = function() { |
|
65 |
empty = true; |
|
66 |
return element.attr('data-placeholder', chosen.results_none_found).attr('disabled', true).trigger('chosen:updated'); |
|
67 |
}; |
|
68 |
if (ngModel) { |
|
69 |
origRender = ngModel.$render; |
|
70 |
ngModel.$render = function() { |
|
71 |
origRender(); |
|
72 |
return initOrUpdate(); |
|
73 |
}; |
|
74 |
if (attr.multiple) { |
|
75 |
viewWatch = function() { |
|
76 |
return ngModel.$viewValue; |
|
77 |
}; |
|
78 |
scope.$watch(viewWatch, ngModel.$render, true); |
|
79 |
} |
|
80 |
} else { |
|
81 |
initOrUpdate(); |
|
82 |
} |
|
83 |
attr.$observe('disabled', function() { |
|
84 |
return element.trigger('chosen:updated'); |
|
85 |
}); |
|
86 |
if (attr.ngOptions && ngModel) { |
|
87 |
match = attr.ngOptions.match(NG_OPTIONS_REGEXP); |
|
88 |
valuesExpr = match[7]; |
|
89 |
scope.$watchCollection(valuesExpr, function(newVal, oldVal) { |
|
90 |
var timer; |
|
91 |
return timer = $timeout(function() { |
|
92 |
if (angular.isUndefined(newVal)) { |
|
93 |
return startLoading(); |
|
94 |
} else { |
|
95 |
if (empty) { |
|
96 |
removeEmptyMessage(); |
|
97 |
} |
|
98 |
stopLoading(); |
|
99 |
if (isEmpty(newVal)) { |
|
100 |
return disableWithMessage(); |
|
101 |
} |
|
102 |
} |
|
103 |
}); |
|
104 |
}); |
|
105 |
return scope.$on('$destroy', function(event) { |
|
106 |
if (typeof timer !== "undefined" && timer !== null) { |
|
107 |
return $timeout.cancel(timer); |
|
108 |
} |
|
109 |
}); |
|
110 |
} |
|
111 |
} |
|
112 |
}; |
|
113 |
} |
|
114 |
]); |
|
115 |
|
|
116 |
}).call(this); |
Also available in: Unified diff
[maven-release-plugin] copy for tag dnet-modular-repositories-ui-4.0.23