diff options
| author | Duda Dornelles <ddornell@thoughtworks.com> | 2015-02-13 10:27:51 -0200 | 
|---|---|---|
| committer | Duda Dornelles <ddornell@thoughtworks.com> | 2015-02-13 12:47:12 -0200 | 
| commit | c52ce25ac49cdfdc1791bcb65c5262aec63dadbd (patch) | |
| tree | d7c5ce18b12f9a86f4a0cb09cc163d4534ddbbeb /web-ui | |
| parent | 2e88b9d9d68bae91cfde466edfc027f19f7c74b8 (diff) | |
Adding encryption info for a recipient when composing.
To do that we look into the KeysResouce to see if we will find a key for
each address entered for the recipients.
Diffstat (limited to 'web-ui')
| -rw-r--r-- | web-ui/app/js/mail_view/ui/recipients/recipient.js | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/web-ui/app/js/mail_view/ui/recipients/recipient.js b/web-ui/app/js/mail_view/ui/recipients/recipient.js index 004b9247..c14f36b2 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipient.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js @@ -32,6 +32,7 @@ define(          html.insertBefore(nodeToPrependTo.children().last());          var component = new this.constructor();          component.initialize(html, recipient); +        component.attr.recipient = recipient;          return component;        }; @@ -47,6 +48,24 @@ define(        this.doUnselect = function () {          this.$node.find('.recipient-value').removeClass('selected');        }; + +      this.discoverEncryption = function () { +        this.$node.addClass('discorver-encryption'); +        var p = $.getJSON('/keys?search=' + this.attr.address).promise(); +        p.done(function () { +          this.$node.addClass('encrypted'); +          this.$node.removeClass('discorver-encryption') +        }.bind(this)); +        p.fail(function () { +          this.$node.addClass('not-encrypted'); +          this.$node.removeClass('discorver-encryption') +        }.bind(this)); + +      }; + +      this.after('initialize', function () { +        this.discoverEncryption(); +      });      }    }  ); | 
