diff --git a/src/js/controller/write.js b/src/js/controller/write.js index 050f4f4..e4bdc24 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -6,15 +6,19 @@ define(function(require) { aes = require('cryptoLib/aes-cbc'), util = require('cryptoLib/util'), str = require('js/app-config').string, - emailDao; + crypto, emailDao; // // Controller // var WriteCtrl = function($scope, $filter) { + crypto = appController._crypto; emailDao = appController._emailDao; + // set default value so that the popover height is correct on init + $scope.fingerprint = 'XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX'; + // // Init // @@ -125,6 +129,20 @@ define(function(require) { }); }; + $scope.getFingerprint = function(recipient) { + $scope.fingerprint = 'Fingerprint cannot be displayed. Public key not found for that user.'; + + if (!recipient.key) { + return; + } + + var fpr = crypto.getFingerprint(recipient.key.publicKey); + var formatted = fpr.slice(0, 4) + ' ' + fpr.slice(4, 8) + ' ' + fpr.slice(8, 12) + ' ' + fpr.slice(12, 16) + ' ' + fpr.slice(16, 20) + ' ' + fpr.slice(20, 24) + ' ' + fpr.slice(24, 28) + ' ' + fpr.slice(28, 32) + ' ' + fpr.slice(32, 36) + ' ' + fpr.slice(36); + + $scope.fingerprint = formatted; + $scope.$apply(); + }; + /** * Check if it is ok to send an email depending on the invitation state of the addresses */ diff --git a/src/sass/components/_popover.scss b/src/sass/components/_popover.scss index 997c4b5..3ad8d73 100644 --- a/src/sass/components/_popover.scss +++ b/src/sass/components/_popover.scss @@ -7,7 +7,7 @@ top: -9999px; left: -9999px; display: block; - z-index: 1010; + z-index: 9000; max-width: 276px; padding: 1px; text-align: left; diff --git a/src/tpl/write.html b/src/tpl/write.html index a4dab8e..0ea80a1 100644 --- a/src/tpl/write.html +++ b/src/tpl/write.html @@ -10,13 +10,13 @@

To: - +

Cc: - +

@@ -44,4 +44,11 @@ + + +
+
+
PGP Fingerprint
+
{{fingerprint}}
+
\ No newline at end of file