OpenPGP (#53) UNSTABLE

This commit is contained in:
RainLoop Team 2014-03-20 20:05:35 +04:00
parent 67b5a72a71
commit b330f77bc0
14 changed files with 526 additions and 260 deletions

View file

@ -16,7 +16,11 @@ function AbstractApp()
this.isLocalAutocomplete = true;
this.popupVisibility = ko.observable(false);
this.popupVisibilityNames = ko.observableArray([]);
this.popupVisibility = ko.computed(function () {
return 0 < this.popupVisibilityNames().length;
}, this);
this.iframe = $('<iframe style="display:none" src="javascript:;" />').appendTo('body');

View file

@ -333,17 +333,21 @@ RainLoopApp.prototype.reloadOpenPgpKeys = function ()
;
_.each(oOpenpgpKeys, function (oItem, iIndex) {
if (oItem)
if (oItem && oItem.primaryKey)
{
var
aIDs = _.map(oItem.getKeyIds(), function (oID) {
return oID ? oID.toHex() : '';
})
var
oPrimaryUser = oItem.getPrimaryUser(),
sUser = (oPrimaryUser && oPrimaryUser.user) ? oPrimaryUser.user.userId.userid
: (oItem.users && oItem.users[0] ? oItem.users[0].userId.userid : '')
;
aKeys.push(
new OpenPgpKeyModel(iIndex, aIDs.join(', '), oItem.getUserIds().join(', '),
oItem.isPrivate(), oItem.armor())
aKeys.push(new OpenPgpKeyModel(
iIndex,
oItem.primaryKey.getFingerprint(),
oItem.primaryKey.getKeyId().toHex().toLowerCase(),
sUser,
oItem.isPrivate(),
oItem.armor())
);
}
});