mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 06:58:27 +03:00
OpenPgp: small improvements
This commit is contained in:
parent
fc827326c4
commit
d6d19c99bf
6 changed files with 28 additions and 13 deletions
|
|
@ -110,6 +110,7 @@
|
|||
'Menu': 'menu',
|
||||
'PopupComposeOpenPGP': 'compose-open-pgp',
|
||||
'PopupMessageOpenPGP': 'message-open-pgp',
|
||||
'PopupViewOpenPGP': 'view-open-pgp',
|
||||
'PopupKeyboardShortcutsHelp': 'popup-keyboard-shortcuts-help',
|
||||
'PopupAsk': 'popup-ask'
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
return _.compact(_.map(PgpStore.openpgpkeysPublic(), function (oKey) {
|
||||
return -1 < Utils.inArray(oKey, self.encryptKeysView()) ? null : {
|
||||
'id': oKey.guid,
|
||||
'name': '(' + oKey.id.substr(-6) + ') ' + oKey.user,
|
||||
'name': '(' + oKey.id.substr(-8).toUpperCase() + ') ' + oKey.user,
|
||||
'key': oKey
|
||||
};
|
||||
}));
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
{
|
||||
if (!this.signKey())
|
||||
{
|
||||
this.notification(Translator.i18n('PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL'));
|
||||
this.notification(Translator.i18n('PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND'));
|
||||
bResult = false;
|
||||
}
|
||||
else if (!this.signKey().key)
|
||||
|
|
@ -237,15 +237,12 @@
|
|||
'empty': !oOption.key,
|
||||
'selected': ko.observable(!!oOption.key),
|
||||
'user': oOption.key.user,
|
||||
'hash': oOption.key.id.substr(-6),
|
||||
'hash': oOption.key.id.substr(-8).toUpperCase(),
|
||||
'key': oOption.key
|
||||
});
|
||||
|
||||
this.encryptKeys(aKeys);
|
||||
}
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.selectedPublicKey();
|
||||
});
|
||||
|
||||
this.selectedPublicKey.subscribe(function (sValue) {
|
||||
|
|
@ -286,8 +283,6 @@
|
|||
this.encryptKeys([]);
|
||||
this.text('');
|
||||
|
||||
this.submitRequest(false);
|
||||
|
||||
this.resultCallback = null;
|
||||
};
|
||||
|
||||
|
|
@ -370,7 +365,7 @@
|
|||
{
|
||||
this.signKey({
|
||||
'user': oKey.user || sEmail,
|
||||
'hash': oKey.id.substr(-6),
|
||||
'hash': oKey.id.substr(-8).toUpperCase(),
|
||||
'key': oKey
|
||||
});
|
||||
}
|
||||
|
|
@ -389,7 +384,7 @@
|
|||
'empty': !oKey,
|
||||
'selected': ko.observable(!!oKey),
|
||||
'user': oKey ? (oKey.user || sEmail) : sEmail,
|
||||
'hash': oKey ? oKey.id.substr(-6) : '',
|
||||
'hash': oKey ? oKey.id.substr(-8).toUpperCase() : '',
|
||||
'key': oKey
|
||||
};
|
||||
})));
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
key = require('key'),
|
||||
$ = require('$'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
Enums = require('Common/Enums'),
|
||||
|
|
@ -61,18 +62,25 @@ _.delay(_.bind(function() {
|
|||
{
|
||||
if (!oPrivateKey.decrypt(Utils.pString(this.password())))
|
||||
{
|
||||
Utils.log('Error: Private key cannot be decrypted');
|
||||
oPrivateKey = null;
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
Utils.log(e);
|
||||
oPrivateKey = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.log('Error: Private key cannot be found');
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (oExc)
|
||||
catch (e)
|
||||
{
|
||||
Utils.log(e);
|
||||
oPrivateKey = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
key = require('key'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
|
@ -24,6 +26,8 @@
|
|||
this.key = ko.observable('');
|
||||
this.keyDom = ko.observable(null);
|
||||
|
||||
this.sDefaultKeyScope = Enums.KeyState.PopupViewOpenPGP;
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +58,14 @@
|
|||
}
|
||||
};
|
||||
|
||||
ViewOpenPgpKeyPopupView.prototype.onBuild = function ()
|
||||
{
|
||||
key('ctrl+a, command+a', Enums.KeyState.PopupViewOpenPGP, _.bind(function () {
|
||||
this.selectKey();
|
||||
return false;
|
||||
}, this));
|
||||
};
|
||||
|
||||
module.exports = ViewOpenPgpKeyPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "RainLoop",
|
||||
"title": "RainLoop Webmail",
|
||||
"version": "1.9.2",
|
||||
"release": "353",
|
||||
"release": "357",
|
||||
"description": "Simple, modern & fast web-based email client",
|
||||
"homepage": "http://rainloop.net",
|
||||
"main": "gulpfile.js",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<!-- ko template: { name: 'PhotoSwipe' } --><!-- /ko -->
|
||||
<div id="rl-sub-right">
|
||||
<div class="messageView" data-bind="css: {'message-selected': isMessageSelected, 'message-focused': messageFocused}">
|
||||
<div class="toolbar top-toolbar g-ui-user-select-none" data-bind="visible: !usePreviewPane()">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue