diff --git a/UI/WebServerResources/js/Contacts/CardController.js b/UI/WebServerResources/js/Contacts/CardController.js
index 560d750e6..feb865458 100644
--- a/UI/WebServerResources/js/Contacts/CardController.js
+++ b/UI/WebServerResources/js/Contacts/CardController.js
@@ -7,8 +7,8 @@
* Controller to view and edit a card
* @ngInject
*/
- CardController.$inject = ['$scope', '$timeout', 'AddressBook', 'Card', 'Dialog', 'sgFocus', '$state', '$stateParams', 'stateCard'];
- function CardController($scope, $timeout, AddressBook, Card, Dialog, focus, $state, $stateParams, stateCard) {
+ CardController.$inject = ['$scope', '$timeout', '$mdDialog', 'AddressBook', 'Card', 'Dialog', 'sgFocus', '$state', '$stateParams', 'stateCard'];
+ function CardController($scope, $timeout, $mdDialog, AddressBook, Card, Dialog, focus, $state, $stateParams, stateCard) {
var vm = this;
vm.card = stateCard;
@@ -31,6 +31,7 @@
vm.reset = reset;
vm.cancel = cancel;
vm.confirmDelete = confirmDelete;
+ vm.viewRawSource = viewRawSource;
function addOrgUnit() {
var i = vm.card.$addOrgUnit('');
@@ -116,6 +117,40 @@
});
});
}
+
+ function viewRawSource($event) {
+ Card.$$resource.post(vm.currentFolder.id + '/' + vm.card.id, "raw").then(function(data) {
+ $mdDialog.show({
+ parent: angular.element(document.body),
+ targetEvent: $event,
+ clickOutsideToClose: true,
+ escapeToClose: true,
+ template: [
+ '',
+ ' ',
+ ' ',
+ data,
+ '
',
+ ' ',
+ ' ',
+ ' ' + l('Close') + '',
+ '
',
+ ''
+ ].join(''),
+ controller: CardRawSourceDialogController
+ });
+
+ /**
+ * @ngInject
+ */
+ CardRawSourceDialogController.$inject = ['scope', '$mdDialog'];
+ function CardRawSourceDialogController(scope, $mdDialog) {
+ scope.close = function() {
+ $mdDialog.hide();
+ };
+ }
+ });
+ }
}
angular