1 |
40746
|
michele.ar
|
var module = angular.module('reposUI', ['ngGrid', 'ngRoute', 'repoControllers']);
|
2 |
|
|
|
3 |
|
|
module.config([
|
4 |
|
|
'$routeProvider',
|
5 |
40823
|
michele.ar
|
function ($routeProvider) {
|
6 |
40746
|
michele.ar
|
$routeProvider
|
7 |
40823
|
michele.ar
|
.when('/browse', {templateUrl: '../resources/html/repoBrowse.html', controller: 'repoBrowseCtrl'})
|
8 |
|
|
.when('/list/:param/:value', {templateUrl: '../resources/html/repoList.html', controller: 'repoListCtrl'})
|
9 |
|
|
.otherwise({redirectTo: '/browse'});
|
10 |
40746
|
michele.ar
|
}
|
11 |
|
|
]);
|
12 |
|
|
|
13 |
41981
|
michele.ar
|
module.directive('compileTemplate', function ($compile, $parse) {
|
14 |
|
|
return {
|
15 |
|
|
link: function (scope, element, attr) {
|
16 |
|
|
var parsed = $parse(attr.ngBindHtml);
|
17 |
|
|
|
18 |
|
|
function getStringValue() {
|
19 |
|
|
return (parsed(scope) || '').toString();
|
20 |
|
|
}
|
21 |
|
|
|
22 |
|
|
//Recompile if the template changes
|
23 |
|
|
scope.$watch(getStringValue, function () {
|
24 |
|
|
$compile(element, null, -9999)(scope); //The -9999 makes it skip directives so that we do not recompile ourselves
|
25 |
|
|
});
|
26 |
|
|
}
|
27 |
|
|
}
|
28 |
|
|
});
|
29 |
|
|
|
30 |
|
|
module.directive('tooltip', function () {
|
31 |
|
|
return {
|
32 |
|
|
restrict: 'A',
|
33 |
|
|
link: function (scope, element, attrs) {
|
34 |
|
|
$(element).tooltip();
|
35 |
|
|
}
|
36 |
|
|
}
|
37 |
|
|
});
|
38 |
|
|
|
39 |
|
|
module.filter('sprintf', function () {
|
40 |
|
|
function parse(str) {
|
41 |
|
|
var args = [].slice.call(arguments, 1),
|
42 |
|
|
i = 0;
|
43 |
|
|
return str.replace(/%s/g, function () {
|
44 |
|
|
return args[i++];
|
45 |
|
|
});
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
return function (str) {
|
49 |
|
|
return parse(str, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
50 |
|
|
};
|
51 |
|
|
});
|
52 |
|
|
|
53 |
40823
|
michele.ar
|
module.directive('ngApiMdstoreInfo', function () {
|
54 |
40746
|
michele.ar
|
return {
|
55 |
|
|
restrict: 'E',
|
56 |
|
|
scope: {
|
57 |
40823
|
michele.ar
|
'label': '@',
|
58 |
|
|
'date': '=',
|
59 |
|
|
'total': '=',
|
60 |
|
|
'id': '='
|
61 |
40746
|
michele.ar
|
},
|
62 |
|
|
templateUrl: '../resources/html/ngApiMdstoreInfo.html'
|
63 |
|
|
}
|
64 |
|
|
});
|
65 |
|
|
|
66 |
40823
|
michele.ar
|
module.directive('ngApiObjectstoreInfo', function () {
|
67 |
|
|
return {
|
68 |
|
|
restrict: 'E',
|
69 |
|
|
scope: {
|
70 |
|
|
'label': '@',
|
71 |
|
|
'date': '=',
|
72 |
|
|
'total': '=',
|
73 |
|
|
'id': '='
|
74 |
|
|
},
|
75 |
|
|
templateUrl: '../resources/html/ngApiObjectstoreInfo.html'
|
76 |
|
|
}
|
77 |
40746
|
michele.ar
|
});
|
78 |
|
|
|
79 |
40823
|
michele.ar
|
module.directive('ngRepoCountryCell', function () {
|
80 |
40746
|
michele.ar
|
return {
|
81 |
|
|
restrict: 'E',
|
82 |
|
|
templateUrl: '../resources/html/ngRepoCountryCell.html'
|
83 |
|
|
}
|
84 |
|
|
});
|
85 |
|
|
|
86 |
40823
|
michele.ar
|
module.directive('ngReponameCell', function () {
|
87 |
40746
|
michele.ar
|
return {
|
88 |
|
|
restrict: 'E',
|
89 |
|
|
templateUrl: '../resources/html/ngRepoNameCell.html'
|
90 |
|
|
}
|
91 |
|
|
});
|
92 |
|
|
|
93 |
40823
|
michele.ar
|
module.directive('ngAggrDateCell', function () {
|
94 |
40746
|
michele.ar
|
return {
|
95 |
|
|
restrict: 'E',
|
96 |
|
|
templateUrl: '../resources/html/ngAggrDateCell.html'
|
97 |
|
|
}
|
98 |
|
|
});
|
99 |
|
|
|
100 |
40823
|
michele.ar
|
module.directive('ngAggrTotalCell', function () {
|
101 |
40746
|
michele.ar
|
return {
|
102 |
|
|
restrict: 'E',
|
103 |
|
|
templateUrl: '../resources/html/ngAggrTotalCell.html'
|
104 |
|
|
}
|
105 |
|
|
});
|