initial import for Open Source 🎉
This commit is contained in:
parent
1898c361f3
commit
9c0dd3b722
2048 changed files with 218743 additions and 0 deletions
32
static/js/directives/ui/label-view.js
Normal file
32
static/js/directives/ui/label-view.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* An element which displays a single label.
|
||||
*/
|
||||
angular.module('quay').directive('labelView', function () {
|
||||
return {
|
||||
templateUrl: '/static/directives/label-view.html',
|
||||
restrict: 'C',
|
||||
replace: true,
|
||||
scope: {
|
||||
expand: '@expand',
|
||||
label: '<label'
|
||||
},
|
||||
controller: function($scope, $sanitize) {
|
||||
$scope.getKind = function(label) {
|
||||
switch (label.media_type) {
|
||||
case 'application/json':
|
||||
return 'json';
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
$scope.viewLabelValue = function() {
|
||||
bootbox.alert({
|
||||
size: "small",
|
||||
title: $scope.label.key,
|
||||
message: '<pre>' + $sanitize($scope.label.value.replace('<', '<').replace('>', '>')) + '</pre>'
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
Reference in a new issue