Fix not spam translate (Closes #168)

Small refactoring and fixes
This commit is contained in:
RainLoop Team 2014-05-16 19:57:50 +04:00
parent 07b0f20305
commit d3ee36bb97
68 changed files with 629 additions and 392 deletions

View file

@ -16,7 +16,7 @@ function AbstractSystemDropDownViewModel()
this.accountMenuDropdownTrigger = ko.observable(false);
this.allowAddAccount = RL.settingsGet('AllowAdditionalAccounts');
this.capaAdditionalAccounts = RL.capa(Enums.Capa.AdditionalAccounts);
this.loading = ko.computed(function () {
return this.accountsLoading();
@ -58,7 +58,7 @@ AbstractSystemDropDownViewModel.prototype.settingsHelp = function ()
AbstractSystemDropDownViewModel.prototype.addAccountClick = function ()
{
if (this.allowAddAccount)
if (this.capaAdditionalAccounts)
{
kn.showScreenPopup(PopupsAddAccountViewModel);
}

View file

@ -665,7 +665,7 @@ MailBoxMessageListViewModel.prototype.onBuild = function (oDom)
this.initUploaderForAppend();
this.initShortcuts();
if (!Globals.bMobileDevice && !!RL.settingsGet('AllowPrefetch') && ifvisible)
if (!Globals.bMobileDevice && RL.capa(Enums.Capa.Prefetch) && ifvisible)
{
ifvisible.setIdleDuration(10);

View file

@ -14,8 +14,8 @@ function PopupsComposeViewModel()
this.bFromDraft = false;
this.bSkipNext = false;
this.sReferences = '';
this.bAllowIdentities = RL.settingsGet('AllowIdentities');
this.bCapaAdditionalIdentities = RL.capa(Enums.Capa.AdditionalIdentities);
var
self = this,
@ -28,7 +28,7 @@ function PopupsComposeViewModel()
}
;
this.allowOpenPGP = oRainLoopData.allowOpenPGP;
this.capaOpenPGP = oRainLoopData.capaOpenPGP;
this.resizer = ko.observable(false).extend({'throttle': 50});
@ -125,7 +125,7 @@ function PopupsComposeViewModel()
sID = this.currentIdentityID()
;
if (this.bAllowIdentities && sID && sID !== RL.data().accountEmail())
if (this.bCapaAdditionalIdentities && sID && sID !== RL.data().accountEmail())
{
oItem = _.find(aList, function (oItem) {
return oItem && sID === oItem['id'];
@ -366,7 +366,7 @@ Utils.extendAsViewModel('PopupsComposeViewModel', PopupsComposeViewModel);
PopupsComposeViewModel.prototype.openOpenPgpPopup = function ()
{
if (this.allowOpenPGP() && this.oEditor && !this.oEditor.isHtml())
if (this.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml())
{
var self = this;
kn.showScreenPopup(PopupsComposeOpenPgpViewModel, [
@ -417,7 +417,7 @@ PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeTyp
}
;
if (this.bAllowIdentities)
if (this.bCapaAdditionalIdentities)
{
_.each(this.identities(), function (oItem) {
oIDs[oItem.email()] = oItem['id'];

View file

@ -47,6 +47,13 @@ function PopupsGenerateNewOpenPgpKeyViewModel()
_.delay(function () {
mKeyPair = window.openpgp.generateKeyPair(1, Utils.pInt(self.keyBitLength()), sUserID, Utils.trim(self.password()));
// 0.6.0
// mKeyPair = window.openpgp.generateKeyPair({
// 'numBits': Utils.pInt(self.keyBitLength()),
// 'userId': sUserID,
// 'passphrase': Utils.trim(self.password())
// });
if (mKeyPair && mKeyPair.privateKeyArmored)
{
oOpenpgpKeyring.privateKeys.importKey(mKeyPair.privateKeyArmored);