Code refactoring

This commit is contained in:
RainLoop Team 2015-02-03 03:58:58 +04:00
parent 79233ad83c
commit 286ab567af
53 changed files with 618 additions and 581 deletions

View file

@ -44,10 +44,10 @@
AdminApp.prototype.reloadDomainList = function ()
{
DomainStore.collection.loading(true);
DomainStore.domains.loading(true);
Remote.domainList(function (sResult, oData) {
DomainStore.collection.loading(false);
DomainStore.domains.loading(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
var aList = _.map(oData.Result, function (bEnabled, sName) {
@ -58,18 +58,18 @@
};
}, this);
DomainStore.collection(aList);
DomainStore.domains(aList);
}
});
};
AdminApp.prototype.reloadPluginList = function ()
{
PluginStore.collection.loading(true);
PluginStore.plugins.loading(true);
Remote.pluginList(function (sResult, oData) {
PluginStore.collection.loading(false);
PluginStore.plugins.loading(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
@ -81,19 +81,19 @@
};
}, this);
PluginStore.collection(aList);
PluginStore.plugins(aList);
}
});
};
AdminApp.prototype.reloadPackagesList = function ()
{
PackageStore.collection.loading(true);
PackageStore.packages.loading(true);
PackageStore.packagesReal(true);
Remote.packagesList(function (sResult, oData) {
PackageStore.collection.loading(false);
PackageStore.packages.loading(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
@ -105,7 +105,7 @@
aLoading = {}
;
_.each(PackageStore.collection(), function (oItem) {
_.each(PackageStore.packages(), function (oItem) {
if (oItem && oItem['loading']())
{
aLoading[oItem['file']] = oItem;
@ -124,7 +124,7 @@
}));
}
PackageStore.collection(aList);
PackageStore.packages(aList);
}
else
{

View file

@ -22,9 +22,12 @@
kn = require('Knoin/Knoin'),
SocialStore = require('Stores/Social'),
AppStore = require('Stores/User/App'),
SettingsStore = require('Stores/User/Settings'),
AccountStore = require('Stores/User/Account'),
IdentityStore = require('Stores/User/Identity'),
FolderStore = require('Stores/User/Folder'),
PgpStore = require('Stores/User/Pgp'),
Local = require('Storage/Client'),
Settings = require('Storage/Settings'),
@ -237,7 +240,7 @@
{
var
self = this,
sSpamFolder = Data.spamFolder()
sSpamFolder = FolderStore.spamFolder()
;
_.each(this.oMoveCache, function (oItem) {
@ -340,18 +343,18 @@
switch (iDeleteType)
{
case Enums.FolderType.Spam:
oMoveFolder = Cache.getFolderFromCacheList(Data.spamFolder());
oMoveFolder = Cache.getFolderFromCacheList(FolderStore.spamFolder());
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Spam;
break;
case Enums.FolderType.NotSpam:
oMoveFolder = Cache.getFolderFromCacheList(Cache.getFolderInboxName());
break;
case Enums.FolderType.Trash:
oMoveFolder = Cache.getFolderFromCacheList(Data.trashFolder());
oMoveFolder = Cache.getFolderFromCacheList(FolderStore.trashFolder());
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Trash;
break;
case Enums.FolderType.Archive:
oMoveFolder = Cache.getFolderFromCacheList(Data.archiveFolder());
oMoveFolder = Cache.getFolderFromCacheList(FolderStore.archiveFolder());
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Archive;
break;
}
@ -359,9 +362,9 @@
bUseFolder = Utils.isUnd(bUseFolder) ? true : !!bUseFolder;
if (bUseFolder)
{
if ((Enums.FolderType.Spam === iDeleteType && Consts.Values.UnuseOptionValue === Data.spamFolder()) ||
(Enums.FolderType.Trash === iDeleteType && Consts.Values.UnuseOptionValue === Data.trashFolder()) ||
(Enums.FolderType.Archive === iDeleteType && Consts.Values.UnuseOptionValue === Data.archiveFolder()))
if ((Enums.FolderType.Spam === iDeleteType && Consts.Values.UnuseOptionValue === FolderStore.spamFolder()) ||
(Enums.FolderType.Trash === iDeleteType && Consts.Values.UnuseOptionValue === FolderStore.trashFolder()) ||
(Enums.FolderType.Archive === iDeleteType && Consts.Values.UnuseOptionValue === FolderStore.archiveFolder()))
{
bUseFolder = false;
}
@ -372,7 +375,7 @@
kn.showScreenPopup(require('View/Popup/FolderSystem'), [nSetSystemFoldersNotification]);
}
else if (!bUseFolder || (Enums.FolderType.Trash === iDeleteType &&
(sFromFolderFullNameRaw === Data.spamFolder() || sFromFolderFullNameRaw === Data.trashFolder())))
(sFromFolderFullNameRaw === FolderStore.spamFolder() || sFromFolderFullNameRaw === FolderStore.trashFolder())))
{
kn.showScreenPopup(require('View/Popup/Ask'), [Translator.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
@ -450,12 +453,12 @@
AppUser.prototype.reloadOpenPgpKeys = function ()
{
if (Data.capaOpenPGP())
if (PgpStore.capaOpenPGP())
{
var
aKeys = [],
oEmail = new EmailModel(),
oOpenpgpKeyring = Data.openpgpKeyring,
oOpenpgpKeyring = PgpStore.openpgpKeyring,
oOpenpgpKeys = oOpenpgpKeyring ? oOpenpgpKeyring.getAllKeys() : []
;
@ -487,39 +490,40 @@
}
});
Utils.delegateRunOnDestroy(Data.openpgpkeys());
Data.openpgpkeys(aKeys);
Utils.delegateRunOnDestroy(PgpStore.openpgpkeys());
PgpStore.openpgpkeys(aKeys);
}
};
AppUser.prototype.accountsCounts = function ()
{
AccountStore.accounts.loading(true);
Remote.accountsCounts(function (sResult, oData) {
AccountStore.accounts.loading(false);
if (Enums.StorageResultType.Success === sResult && oData.Result && oData.Result['Counts'])
{
var
sEmail = Data.accountEmail(),
aAcounts = AccountStore.accounts()
;
_.each(oData.Result['Counts'], function (oItem) {
var oAccount = _.find(aAcounts, function (oAccount) {
return oAccount && oItem[0] === oAccount.email && sEmail !== oAccount.email;
});
if (oAccount)
{
oAccount.count(Utils.pInt(oItem[1]));
}
});
}
});
return false;
// AccountStore.accounts.loading(true);
//
// Remote.accountsCounts(function (sResult, oData) {
//
// AccountStore.accounts.loading(false);
//
// if (Enums.StorageResultType.Success === sResult && oData.Result && oData.Result['Counts'])
// {
// var
// sEmail = AccountStore.email(),
// aAcounts = AccountStore.accounts()
// ;
//
// _.each(oData.Result['Counts'], function (oItem) {
//
// var oAccount = _.find(aAcounts, function (oAccount) {
// return oAccount && oItem[0] === oAccount.email && sEmail !== oAccount.email;
// });
//
// if (oAccount)
// {
// oAccount.count(Utils.pInt(oItem[1]));
// }
// });
// }
// });
};
AppUser.prototype.accountsAndIdentities = function (bBoot)
@ -539,7 +543,7 @@
var
aCounts = {},
sParentEmail = Settings.settingsGet('ParentEmail'),
sAccountEmail = Data.accountEmail()
sAccountEmail = AccountStore.email()
;
sParentEmail = '' === sParentEmail ? sAccountEmail : sParentEmail;
@ -1138,14 +1142,18 @@
Data.namespace = oData.Result.Namespace;
}
Data.threading(!!Settings.settingsGet('UseImapThread') && oData.Result.IsThreadsSupported && true);
AppStore.threadsAllowed(!!Settings.settingsGet('UseImapThread') &&
oData.Result.IsThreadsSupported && true);
aList = this.folderResponseParseRec(Data.namespace, oData.Result['@Collection']);
Data.folderList(aList);
if (oData.Result['SystemFolders'] &&
'' === '' + Settings.settingsGet('SentFolder') + Settings.settingsGet('DraftFolder') +
Settings.settingsGet('SpamFolder') + Settings.settingsGet('TrashFolder') + Settings.settingsGet('ArchiveFolder') +
if (oData.Result['SystemFolders'] && '' === '' +
Settings.settingsGet('SentFolder') +
Settings.settingsGet('DraftFolder') +
Settings.settingsGet('SpamFolder') +
Settings.settingsGet('TrashFolder') +
Settings.settingsGet('ArchiveFolder') +
Settings.settingsGet('NullFolder'))
{
// TODO Magic Numbers
@ -1158,20 +1166,20 @@
bUpdate = true;
}
Data.sentFolder(fNormalizeFolder(Settings.settingsGet('SentFolder')));
Data.draftFolder(fNormalizeFolder(Settings.settingsGet('DraftFolder')));
Data.spamFolder(fNormalizeFolder(Settings.settingsGet('SpamFolder')));
Data.trashFolder(fNormalizeFolder(Settings.settingsGet('TrashFolder')));
Data.archiveFolder(fNormalizeFolder(Settings.settingsGet('ArchiveFolder')));
FolderStore.sentFolder(fNormalizeFolder(Settings.settingsGet('SentFolder')));
FolderStore.draftFolder(fNormalizeFolder(Settings.settingsGet('DraftFolder')));
FolderStore.spamFolder(fNormalizeFolder(Settings.settingsGet('SpamFolder')));
FolderStore.trashFolder(fNormalizeFolder(Settings.settingsGet('TrashFolder')));
FolderStore.archiveFolder(fNormalizeFolder(Settings.settingsGet('ArchiveFolder')));
if (bUpdate)
{
Remote.saveSystemFolders(Utils.emptyFunction, {
'SentFolder': Data.sentFolder(),
'DraftFolder': Data.draftFolder(),
'SpamFolder': Data.spamFolder(),
'TrashFolder': Data.trashFolder(),
'ArchiveFolder': Data.archiveFolder(),
'SentFolder': FolderStore.sentFolder(),
'DraftFolder': FolderStore.draftFolder(),
'SpamFolder': FolderStore.spamFolder(),
'TrashFolder': FolderStore.trashFolder(),
'ArchiveFolder': FolderStore.archiveFolder(),
'NullFolder': 'NullFolder'
});
}
@ -1403,8 +1411,7 @@
require('Stores/User/Settings').populate();
require('Stores/User/Notification').populate();
require('Stores/User/Identity').populate();
Data.populateDataOnStart();
require('Stores/User/Account').populate();
var
self = this,
@ -1443,9 +1450,9 @@
if ($LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
{
var fOpenpgpCallback = function (openpgp) {
Data.openpgp = openpgp;
Data.openpgpKeyring = new openpgp.Keyring();
Data.capaOpenPGP(true);
PgpStore.openpgp = openpgp;
PgpStore.openpgpKeyring = new openpgp.Keyring();
PgpStore.capaOpenPGP(true);
Events.pub('openpgp.init');
@ -1468,7 +1475,7 @@
}
else
{
Data.capaOpenPGP(false);
PgpStore.capaOpenPGP(false);
}
kn.startScreens([

View file

@ -15,15 +15,6 @@
'Unload': 'unload'
};
/**
* @enum {number}
*/
Enums.SpoolerType = {
'Delay': 0,
'MessageList': 1,
'Move': 2
};
/**
* @enum {number}
*/
@ -233,15 +224,7 @@
'HtmlForced': 'HtmlForced',
'PlainForced': 'PlainForced'
};
/**
* @enum {string}
*/
Enums.CustomThemeType = {
'Light': 'Light',
'Dark': 'Dark'
};
/**
* @enum {number}
*/

View file

@ -369,9 +369,8 @@
MessageModel.prototype.computeSenderEmail = function ()
{
var
Data = require('Storage/User/Data'),
sSent = Data.sentFolder(),
sDraft = Data.draftFolder()
sSent = require('Stores/User/Folder').sentFolder(),
sDraft = require('Stores/User/Folder').draftFolder()
;
this.senderEmailsString(this.folderFullNameRaw === sSent || this.folderFullNameRaw === sDraft ?
@ -456,7 +455,6 @@
{
var
bResult = false,
Data = require('Storage/User/Data'),
iPriority = Enums.MessagePriority.Normal
;
@ -474,7 +472,7 @@
this.proxy = !!oJsonMessage.ExternalProxy;
if (Data.capaOpenPGP())
if (require('Stores/User/Pgp').capaOpenPGP())
{
this.isPgpSigned(!!oJsonMessage.PgpSigned);
this.isPgpEncrypted(!!oJsonMessage.PgpEncrypted);
@ -1134,8 +1132,7 @@
this.body.data('rl-plain-raw', this.plainRaw);
var Data = require('Storage/User/Data');
if (Data.capaOpenPGP())
if (require('Stores/User/Pgp').capaOpenPGP())
{
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
this.body.data('rl-plain-pgp-encrypted', !!this.isPgpEncrypted());
@ -1147,8 +1144,7 @@
MessageModel.prototype.storePgpVerifyDataToDom = function ()
{
var Data = require('Storage/User/Data');
if (this.body && Data.capaOpenPGP())
if (this.body && require('Stores/User/Pgp').capaOpenPGP())
{
this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser());
@ -1164,8 +1160,7 @@
this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
var Data = require('Storage/User/Data');
if (Data.capaOpenPGP())
if (require('Stores/User/Pgp').capaOpenPGP())
{
this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
this.isPgpEncrypted(!!this.body.data('rl-plain-pgp-encrypted'));
@ -1202,7 +1197,7 @@
try
{
mPgpMessage = Data.openpgp.cleartext.readArmored(this.plainRaw);
mPgpMessage = PgpStore.openpgp.cleartext.readArmored(this.plainRaw);
if (mPgpMessage && mPgpMessage.getText)
{
this.pgpSignedVerifyStatus(
@ -1272,7 +1267,7 @@
try
{
mPgpMessage = Data.openpgp.message.readArmored(this.plainRaw);
mPgpMessage = PgpStore.openpgp.message.readArmored(this.plainRaw);
if (mPgpMessage && oPrivateKey && mPgpMessage.decrypt)
{
this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Unverified);

View file

@ -47,7 +47,7 @@
MailBoxUserScreen.prototype.setNewTitle = function ()
{
var
sEmail = Data.accountEmail(),
sEmail = AccountStore.email(),
nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount()
;
@ -113,10 +113,10 @@
}, 50);
Events.sub('mailbox.inbox-unread-count', function (iCount) {
Data.foldersInboxUnreadCount(iCount);
var sEmail = Data.accountEmail();
var sEmail = AccountStore.email();
_.each(AccountStore.accounts(), function (oItem) {
if (oItem && sEmail === oItem.email)

View file

@ -19,7 +19,7 @@
*/
function DomainsAdminSettings()
{
this.domains = DomainStore.collection;
this.domains = DomainStore.domains;
this.iDomainForDeletionTimeout = 0;

View file

@ -22,7 +22,7 @@
{
this.packagesError = ko.observable('');
this.packages = PackageStore.collection;
this.packages = PackageStore.packages;
this.packagesReal = PackageStore.packagesReal;
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
@ -39,7 +39,7 @@
});
this.visibility = ko.computed(function () {
return PackageStore.collection.loading() ? 'visible' : 'hidden';
return PackageStore.packages.loading() ? 'visible' : 'hidden';
}, this);
}

View file

@ -23,11 +23,11 @@
{
this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins'));
this.plugins = PluginStore.collection;
this.pluginsError = PluginStore.collection.error;
this.plugins = PluginStore.plugins;
this.pluginsError = PluginStore.plugins.error;
this.visibility = ko.computed(function () {
return PluginStore.collection.loading() ? 'visible' : 'hidden';
return PluginStore.plugins.loading() ? 'visible' : 'hidden';
}, this);
this.onPluginLoadRequest = _.bind(this.onPluginLoadRequest, this);
@ -75,7 +75,7 @@
PluginsAdminSettings.prototype.onShow = function ()
{
PluginStore.collection.error('');
PluginStore.plugins.error('');
require('App/Admin').reloadPluginList();
};
@ -95,11 +95,11 @@
{
if (Enums.Notification.UnsupportedPluginPackage === oData.ErrorCode && oData.ErrorMessage && '' !== oData.ErrorMessage)
{
PluginStore.collection.error(oData.ErrorMessage);
PluginStore.plugins.error(oData.ErrorMessage);
}
else
{
PluginStore.collection.error(Translator.getNotification(oData.ErrorCode));
PluginStore.plugins.error(Translator.getNotification(oData.ErrorCode));
}
}
}

View file

@ -112,7 +112,7 @@
}
this.passwordUpdateError(true);
this.errorDescription(oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) :
this.errorDescription(oData && oData.ErrorCode ? Translator.getNotification(oData.ErrorCode) :
Translator.getNotification(Enums.Notification.CouldNotSaveNewPassword));
}
};

View file

@ -24,7 +24,7 @@
var self = this;
this.modules = FilterStore.modules;
this.filters = FilterStore.collection;
this.filters = FilterStore.filters;
this.inited = ko.observable(false);
this.serverError = ko.observable(false);

View file

@ -44,7 +44,7 @@
this.showImages = SettingsStore.showImages;
this.useCheckboxesInList = SettingsStore.useCheckboxesInList;
this.threading = Data.threading;
this.threadsAllowed = AppStore.threadsAllowed;
this.useThreads = SettingsStore.useThreads;
this.replySameFolder = SettingsStore.replySameFolder;
this.allowLanguagesOnSettings = AppStore.allowLanguagesOnSettings;

View file

@ -12,6 +12,7 @@
HtmlEditor = require('Common/HtmlEditor'),
Translator = require('Common/Translator'),
AccountStore = require('Stores/User/Account'),
IdentityStore = require('Stores/User/Identity'),
Data = require('Storage/User/Data'),
@ -26,11 +27,12 @@
this.editor = null;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
this.accountEmail = Data.accountEmail;
this.displayName = Data.displayName;
this.signature = Data.signature;
this.signatureToAll = Data.signatureToAll;
this.replyTo = Data.replyTo;
this.accountEmail = AccountStore.email;
this.displayName = AccountStore.displayName;
this.signature = AccountStore.signature;
this.signatureToAll = AccountStore.signatureToAll;
this.replyTo = AccountStore.replyTo;
this.signatureDom = ko.observable(null);
@ -52,7 +54,7 @@
if (0 < aList.length)
{
aResult.push({
'id': this.accountEmail.peek(),
'id': AccountStore.email.peek(),
'name': this.formattedAccountIdentity(),
'seporator': false
});
@ -106,8 +108,8 @@
IdentitiesUserSettings.prototype.formattedAccountIdentity = function ()
{
var
sDisplayName = this.displayName.peek(),
sEmail = this.accountEmail.peek()
sDisplayName = AccountStore.displayName.peek(),
sEmail = AccountStore.email.peek()
;
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
@ -151,11 +153,11 @@
{
var
self = this,
sSignature = Data.signature()
sSignature = AccountStore.signature()
;
this.editor = new HtmlEditor(self.signatureDom(), function () {
Data.signature(
AccountStore.signature(
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
);
}, function () {
@ -200,25 +202,25 @@
});
});
Data.displayName.subscribe(function (sValue) {
AccountStore.displayName.subscribe(function (sValue) {
Remote.saveSettings(f1, {
'DisplayName': sValue
});
});
Data.replyTo.subscribe(function (sValue) {
AccountStore.replyTo.subscribe(function (sValue) {
Remote.saveSettings(f2, {
'ReplyTo': sValue
});
});
Data.signature.subscribe(function (sValue) {
AccountStore.signature.subscribe(function (sValue) {
Remote.saveSettings(f3, {
'Signature': sValue
});
});
Data.signatureToAll.subscribe(function (bValue) {
AccountStore.signatureToAll.subscribe(function (bValue) {
Remote.saveSettings(null, {
'SignatureToAll': bValue ? '1' : '0'
});

View file

@ -11,6 +11,8 @@
Utils = require('Common/Utils'),
HtmlEditor = require('Common/HtmlEditor'),
AccountStore = require('Stores/User/Account'),
Data = require('Storage/User/Data'),
Remote = require('Storage/User/Remote')
;
@ -22,10 +24,10 @@
{
this.editor = null;
this.displayName = Data.displayName;
this.signature = Data.signature;
this.signatureToAll = Data.signatureToAll;
this.replyTo = Data.replyTo;
this.displayName = AccountStore.displayName;
this.signature = AccountStore.signature;
this.signatureToAll = AccountStore.signatureToAll;
this.replyTo = AccountStore.replyTo;
this.signatureDom = ko.observable(null);
@ -40,11 +42,11 @@
{
var
self = this,
sSignature = Data.signature()
sSignature = AccountStore.signature()
;
this.editor = new HtmlEditor(self.signatureDom(), function () {
Data.signature(
AccountStore.signature(
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
);
}, function () {
@ -71,25 +73,25 @@
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
;
Data.displayName.subscribe(function (sValue) {
AccountStore.displayName.subscribe(function (sValue) {
Remote.saveSettings(f1, {
'DisplayName': sValue
});
});
Data.replyTo.subscribe(function (sValue) {
AccountStore.replyTo.subscribe(function (sValue) {
Remote.saveSettings(f2, {
'ReplyTo': sValue
});
});
Data.signature.subscribe(function (sValue) {
AccountStore.signature.subscribe(function (sValue) {
Remote.saveSettings(f3, {
'Signature': sValue
});
});
Data.signatureToAll.subscribe(function (bValue) {
AccountStore.signatureToAll.subscribe(function (bValue) {
Remote.saveSettings(null, {
'SignatureToAll': bValue ? '1' : '0'
});

View file

@ -11,7 +11,7 @@
kn = require('Knoin/Knoin'),
Data = require('Storage/User/Data')
PgpStore = require('Stores/User/Pgp')
;
/**
@ -19,9 +19,9 @@
*/
function OpenPgpUserSettings()
{
this.openpgpkeys = Data.openpgpkeys;
this.openpgpkeysPublic = Data.openpgpkeysPublic;
this.openpgpkeysPrivate = Data.openpgpkeysPrivate;
this.openpgpkeys = PgpStore.openpgpkeys;
this.openpgpkeysPublic = PgpStore.openpgpkeysPublic;
this.openpgpkeysPrivate = PgpStore.openpgpkeysPrivate;
this.openPgpKeyForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
function (oPrev) {
@ -65,21 +65,21 @@
{
this.openPgpKeyForDeletion(null);
if (oOpenPgpKeyToRemove && Data.openpgpKeyring)
if (oOpenPgpKeyToRemove && PgpStore.openpgpKeyring)
{
var oFindedItem = _.find(this.openpgpkeys(), function (oOpenPgpKey) {
var oFindedItem = _.find(PgpStore.openpgpkeys(), function (oOpenPgpKey) {
return oOpenPgpKeyToRemove === oOpenPgpKey;
});
if (oFindedItem)
{
this.openpgpkeys.remove(oFindedItem);
PgpStore.openpgpkeys.remove(oFindedItem);
Utils.delegateRunOnDestroy(oFindedItem);
Data.openpgpKeyring[oFindedItem.isPrivate ? 'privateKeys' : 'publicKeys']
PgpStore.openpgpKeyring[oFindedItem.isPrivate ? 'privateKeys' : 'publicKeys']
.removeForId(oFindedItem.guid);
Data.openpgpKeyring.store();
PgpStore.openpgpKeyring.store();
}
require('App/User').reloadOpenPgpKeys();

View file

@ -4,6 +4,7 @@
'use strict';
var
_ = require('_'),
ko = require('ko'),
Enums = require('Common/Enums'),
@ -65,12 +66,6 @@
Remote.createTwoFactor(this.onResult);
};
SecurityUserSettings.prototype.enableTwoFactor = function ()
{
this.processing(true);
Remote.enableTwoFactor(this.onResult, this.viewEnable());
};
SecurityUserSettings.prototype.testTwoFactor = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest'));
@ -122,6 +117,7 @@
if (this.bFirst)
{
this.bFirst = false;
var self = this;
this.viewEnable.subscribe(function (bValue) {
if (this.viewEnable.subs)

View file

@ -17,16 +17,14 @@
Links = require('Common/Links'),
Translator = require('Common/Translator'),
SettingsUserStore = require('Stores/User/Settings'),
SettingsStore = require('Stores/User/Settings'),
Settings = require('Storage/Settings'),
Cache = require('Storage/User/Cache'),
kn = require('Knoin/Knoin'),
MessageModel = require('Model/Message'),
Local = require('Storage/Client')
MessageModel = require('Model/Message')
;
/**
@ -34,71 +32,6 @@
*/
function DataUserStorage()
{
var
fRemoveSystemFolderType = function (observable) {
return function () {
var oFolder = Cache.getFolderFromCacheList(observable());
if (oFolder)
{
oFolder.type(Enums.FolderType.User);
}
};
},
fSetSystemFolderType = function (iType) {
return function (sValue) {
var oFolder = Cache.getFolderFromCacheList(sValue);
if (oFolder)
{
oFolder.type(iType);
}
};
}
;
this.devEmail = '';
this.devPassword = '';
this.accountEmail = ko.observable('');
this.accountIncLogin = ko.observable('');
this.accountOutLogin = ko.observable('');
this.projectHash = ko.observable('');
this.threading = ko.observable(false);
this.lastFoldersHash = '';
this.remoteSuggestions = false;
// system folders
this.sentFolder = ko.observable('');
this.draftFolder = ko.observable('');
this.spamFolder = ko.observable('');
this.trashFolder = ko.observable('');
this.archiveFolder = ko.observable('');
this.sentFolder.subscribe(fRemoveSystemFolderType(this.sentFolder), this, 'beforeChange');
this.draftFolder.subscribe(fRemoveSystemFolderType(this.draftFolder), this, 'beforeChange');
this.spamFolder.subscribe(fRemoveSystemFolderType(this.spamFolder), this, 'beforeChange');
this.trashFolder.subscribe(fRemoveSystemFolderType(this.trashFolder), this, 'beforeChange');
this.archiveFolder.subscribe(fRemoveSystemFolderType(this.archiveFolder), this, 'beforeChange');
this.sentFolder.subscribe(fSetSystemFolderType(Enums.FolderType.SentItems), this);
this.draftFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Draft), this);
this.spamFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Spam), this);
this.trashFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Trash), this);
this.archiveFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Archive), this);
this.draftFolderNotEnabled = ko.computed(function () {
return '' === this.draftFolder() || Consts.Values.UnuseOptionValue === this.draftFolder();
}, this);
// personal
this.displayName = ko.observable('');
this.signature = ko.observable('');
this.signatureToAll = ko.observable(false);
this.replyTo = ko.observable('');
// security
this.enableTwoFactor = ko.observable(false);
// contacts
this.contacts = ko.observableArray([]);
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
@ -176,13 +109,15 @@
this.folderListSystemNames = ko.computed(function () {
var
FolderStore = require('Stores/User/Folder'),
aList = [Cache.getFolderInboxName()],
aFolders = this.folderList(),
sSentFolder = this.sentFolder(),
sDraftFolder = this.draftFolder(),
sSpamFolder = this.spamFolder(),
sTrashFolder = this.trashFolder(),
sArchiveFolder = this.archiveFolder()
sSentFolder = FolderStore.sentFolder(),
sDraftFolder = FolderStore.draftFolder(),
sSpamFolder = FolderStore.spamFolder(),
sTrashFolder = FolderStore.trashFolder(),
sArchiveFolder = FolderStore.archiveFolder()
;
if (Utils.isArray(aFolders) && 0 < aFolders.length)
@ -261,7 +196,7 @@
this.messageListPageCount = ko.computed(function () {
var iPage = window.Math.ceil(this.messageListCount() /
SettingsUserStore.messagesPerPage());
SettingsStore.messagesPerPage());
return 0 >= iPage ? 1 : iPage;
}, this);
@ -317,13 +252,13 @@
this.messageFullScreenMode(false);
this.hideMessageBodies();
if (Enums.Layout.NoPreview === SettingsUserStore.layout() &&
if (Enums.Layout.NoPreview === SettingsStore.layout() &&
-1 < window.location.hash.indexOf('message-preview'))
{
require('App/User').historyBack();
}
}
else if (Enums.Layout.NoPreview === SettingsUserStore.layout())
else if (Enums.Layout.NoPreview === SettingsStore.layout())
{
this.message.focused(true);
}
@ -337,7 +272,7 @@
}
else if (Enums.KeyState.MessageView === Globals.keyScope())
{
if (Enums.Layout.NoPreview === SettingsUserStore.layout() && this.message())
if (Enums.Layout.NoPreview === SettingsStore.layout() && this.message())
{
Globals.keyScope(Enums.KeyState.MessageView);
}
@ -422,20 +357,6 @@
// other
this.composeInEdit = ko.observable(false);
this.capaOpenPGP = ko.observable(false);
this.openpgpkeys = ko.observableArray([]);
this.openpgp = null;
this.openpgpKeyring = null;
this.openpgpkeysPublic = this.openpgpkeys.filter(function (oItem) {
return !!(oItem && !oItem.isPrivate);
});
this.openpgpkeysPrivate = this.openpgpkeys.filter(function (oItem) {
return !!(oItem && oItem.isPrivate);
});
this.customThemeType = ko.observable(Enums.CustomThemeType.Light);
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
}
@ -472,27 +393,6 @@
}
};
DataUserStorage.prototype.populateDataOnStart = function()
{
this.accountEmail(Settings.settingsGet('Email'));
this.accountIncLogin(Settings.settingsGet('IncLogin'));
this.accountOutLogin(Settings.settingsGet('OutLogin'));
this.projectHash(Settings.settingsGet('ProjectHash'));
this.displayName(Settings.settingsGet('DisplayName'));
this.replyTo(Settings.settingsGet('ReplyTo'));
this.signature(Settings.settingsGet('Signature'));
this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
this.enableTwoFactor(!!Settings.settingsGet('EnableTwoFactor'));
this.lastFoldersHash = Local.get(Enums.ClientSideKeyName.FoldersLashHash) || '';
this.remoteSuggestions = !!Settings.settingsGet('RemoteSuggestions');
this.devEmail = Settings.settingsGet('DevEmail');
this.devPassword = Settings.settingsGet('DevPassword');
};
DataUserStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
{
if (Cache.getFolderInboxName() === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
@ -515,7 +415,7 @@
{
NotificationStore.displayDesktopNotification(
Links.notificationMailIcon(),
this.accountEmail(),
require('Stores/User/Account').email(),
Translator.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', {
'COUNT': iLen
})
@ -793,7 +693,7 @@
bIsHtml = false;
sResultHtml = Utils.plainToHtml(oData.Result.Plain.toString(), false);
if ((oMessage.isPgpSigned() || oMessage.isPgpEncrypted()) && this.capaOpenPGP())
if ((oMessage.isPgpSigned() || oMessage.isPgpEncrypted()) && require('Stores/User/Pgp').capaOpenPGP())
{
oMessage.plainRaw = Utils.pString(oData.Result.Plain);
@ -856,7 +756,7 @@
oMessage.showInternalImages(true);
}
if (oMessage.hasImages() && SettingsUserStore.showImages())
if (oMessage.hasImages() && SettingsStore.showImages())
{
oMessage.showExternalImages(true);
}
@ -907,7 +807,7 @@
DataUserStorage.prototype.findPublicKeyByHex = function (sHash)
{
return _.find(this.openpgpkeysPublic(), function (oItem) {
return _.find(require('Stores/User/Pgp').openpgpkeysPublic(), function (oItem) {
return oItem && sHash === oItem.id;
});
};
@ -915,7 +815,7 @@
DataUserStorage.prototype.findPublicKeysByEmail = function (sEmail)
{
var self = this;
return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) {
return _.compact(_.map(require('Stores/User/Pgp').openpgpkeysPublic(), function (oItem) {
var oKey = null;
if (oItem && sEmail === oItem.email)
@ -946,7 +846,7 @@
var
self = this,
oPrivateKey = null,
oKey = _.find(this.openpgpkeysPrivate(), function (oItem) {
oKey = _.find(require('Stores/User/Pgp').openpgpkeysPrivate(), function (oItem) {
return oItem && sEmail === oItem.email;
})
;
@ -981,7 +881,7 @@
*/
DataUserStorage.prototype.findSelfPrivateKey = function (sPassword)
{
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
return this.findPrivateKeyByEmail(require('Stores/User/Account').email(), sPassword);
};
module.exports = new DataUserStorage();

View file

@ -10,7 +10,8 @@
Consts = require('Common/Consts'),
Base64 = require('Common/Base64'),
SettingsUserStore = require('Stores/User/Settings'),
AppStore = require('Stores/User/App'),
SettingsStore = require('Stores/User/Settings'),
Settings = require('Storage/Settings'),
Cache = require('Storage/User/Cache'),
@ -294,11 +295,11 @@
iOffset,
iLimit,
sSearch,
Data.projectHash(),
AppStore.projectHash(),
sFolderHash,
Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
Data.threading() && SettingsUserStore.useThreads() ? '1' : '0',
Data.threading() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0',
AppStore.threadsAllowed() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
].join(String.fromCharCode(0))), bSilent ? [] : ['MessageList']);
}
else
@ -309,8 +310,8 @@
'Limit': iLimit,
'Search': sSearch,
'UidNext': Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
'UseThreads': Data.threading() && SettingsUserStore.useThreads() ? '1' : '0',
'ExpandedThreadUid': Data.threading() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
'UseThreads': AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0',
'ExpandedThreadUid': AppStore.threadsAllowed() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
}, '' === sSearch ? Consts.Defaults.DefaultAjaxTimeout : Consts.Defaults.SearchAjaxTimeout, '', bSilent ? [] : ['MessageList']);
}
};
@ -343,8 +344,8 @@
'Message/' + Base64.urlsafe_encode([
sFolderFullNameRaw,
iUid,
Data.projectHash(),
Data.threading() && SettingsUserStore.useThreads() ? '1' : '0'
AppStore.projectHash(),
AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0'
].join(String.fromCharCode(0))), ['Message']);
return true;
@ -423,7 +424,7 @@
'UidNext': Cache.getFolderInboxName() === sFolder ? Cache.getFolderUidNext(sFolder) : ''
});
}
else if (SettingsUserStore.useThreads())
else if (SettingsStore.useThreads())
{
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
}

View file

@ -1,20 +0,0 @@
(function () {
'use strict';
var
queue = require('queue')
;
/**
* @constructor
*/
function Spooler()
{
this.queue = queue(1);
}
module.exports = new Spooler();
}());

View file

@ -6,7 +6,9 @@
var
ko = require('ko'),
Settings = require('Storage/Settings')
Settings = require('Storage/Settings'),
AppStore = require('Stores/App')
;
/**
@ -14,10 +16,7 @@
*/
function AppAdminStore()
{
// same
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true);
// ----
AppStore.call(this);
this.determineUserLanguage = ko.observable(false);
this.determineUserDomain = ko.observable(false);
@ -28,8 +27,7 @@
AppAdminStore.prototype.populate = function()
{
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
AppStore.prototype.populate.call(this);
this.determineUserLanguage(!!Settings.settingsGet('DetermineUserLanguage'));
this.determineUserDomain(!!Settings.settingsGet('DetermineUserDomain'));

View file

@ -12,8 +12,8 @@
*/
function DomainAdminStore()
{
this.collection = ko.observableArray([]);
this.collection.loading = ko.observable(false).extend({'throttle': 100});
this.domains = ko.observableArray([]);
this.domains.loading = ko.observable(false).extend({'throttle': 100});
}
module.exports = new DomainAdminStore();

View file

@ -10,15 +10,15 @@
/**
* @constructor
*/
function PluginAdminStore()
function PackageAdminStore()
{
this.collection = ko.observableArray([]);
this.collection.loading = ko.observable(false).extend({'throttle': 100});
this.packages = ko.observableArray([]);
this.packages.loading = ko.observable(false).extend({'throttle': 100});
this.packagesReal = ko.observable(true);
this.packagesMainUpdatable = ko.observable(true);
}
module.exports = new PluginAdminStore();
module.exports = new PackageAdminStore();
}());

View file

@ -12,9 +12,9 @@
*/
function PluginAdminStore()
{
this.collection = ko.observableArray([]);
this.collection.loading = ko.observable(false).extend({'throttle': 100});
this.collection.error = ko.observable('');
this.plugins = ko.observableArray([]);
this.plugins.loading = ko.observable(false).extend({'throttle': 100});
this.plugins.error = ko.observable('');
}
module.exports = new PluginAdminStore();

42
dev/Stores/App.js Normal file
View file

@ -0,0 +1,42 @@
(function () {
'use strict';
var
ko = require('ko'),
Globals = require('Common/Globals'),
Settings = require('Storage/Settings')
;
/**
* @constructor
*/
function AppStore()
{
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true);
this.interfaceAnimation = ko.observable(true);
this.interfaceAnimation.subscribe(function (bValue) {
var bAnim = Globals.bMobileDevice || !bValue;
Globals.$html.toggleClass('rl-anim', !bAnim).toggleClass('no-rl-anim', bAnim);
});
this.interfaceAnimation.valueHasMutated();
}
AppStore.prototype.populate = function()
{
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
};
module.exports = AppStore;
}());

View file

@ -7,6 +7,8 @@
_ = require('_'),
ko = require('ko'),
Settings = require('Storage/Settings'),
Remote = require('Storage/User/Remote')
;
@ -15,6 +17,15 @@
*/
function AccountUserStore()
{
this.email = ko.observable('');
// this.incLogin = ko.observable('');
// this.outLogin = ko.observable('');
this.displayName = ko.observable('');
this.replyTo = ko.observable('');
this.signature = ko.observable('');
this.signatureToAll = ko.observable(false);
this.accounts = ko.observableArray([]);
this.accounts.loading = ko.observable(false).extend({'throttle': 100});
@ -42,18 +53,30 @@
var iResult = 0;
_.each(this.accounts(), function (oItem) {
if (oItem)
{
iResult += oItem.count();
}
});
// _.each(this.accounts(), function (oItem) {
// if (oItem)
// {
// iResult += oItem.count();
// }
// });
return iResult;
}, this);
}
AccountUserStore.prototype.populate = function ()
{
this.email(Settings.settingsGet('Email'));
// this.incLogin(Settings.settingsGet('IncLogin'));
// this.outLogin(Settings.settingsGet('OutLogin'));
this.displayName(Settings.settingsGet('DisplayName'));
this.replyTo(Settings.settingsGet('ReplyTo'));
this.signature(Settings.settingsGet('Signature'));
this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
};
module.exports = new AccountUserStore();
}());

View file

@ -6,9 +6,9 @@
var
ko = require('ko'),
Globals = require('Common/Globals'),
Settings = require('Storage/Settings')
Settings = require('Storage/Settings'),
AppStore = require('Stores/App')
;
/**
@ -16,40 +16,31 @@
*/
function AppUserStore()
{
// same
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true);
// ----
AppStore.call(this);
this.projectHash = ko.observable('');
this.threadsAllowed = ko.observable(false);
this.contactsAutosave = ko.observable(false);
this.useLocalProxyForExternalImages = ko.observable(false);
this.contactsIsAllowed = ko.observable(false);
this.interfaceAnimation = ko.observable(true);
this.interfaceAnimation.subscribe(function (bValue) {
if (Globals.bMobileDevice || !bValue)
{
Globals.$html.removeClass('rl-anim').addClass('no-rl-anim');
}
else
{
Globals.$html.removeClass('no-rl-anim').addClass('rl-anim');
}
});
this.interfaceAnimation.valueHasMutated();
this.devEmail = '';
this.devPassword = '';
}
AppUserStore.prototype.populate = function()
{
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
AppStore.prototype.populate.call(this);
this.projectHash(Settings.settingsGet('ProjectHash'));
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
this.devEmail = Settings.settingsGet('DevEmail');
this.devPassword = Settings.settingsGet('DevPassword');
};
module.exports = new AppUserStore();

View file

@ -15,10 +15,10 @@
this.capa = ko.observable('');
this.modules = ko.observable({});
this.collection = ko.observableArray([]);
this.filters = ko.observableArray([]);
this.collection.loading = ko.observable(false).extend({'throttle': 200});
this.collection.saving = ko.observable(false).extend({'throttle': 200});
this.filters.loading = ko.observable(false).extend({'throttle': 200});
this.filters.saving = ko.observable(false).extend({'throttle': 200});
this.raw = ko.observable('');
}

75
dev/Stores/User/Folder.js Normal file
View file

@ -0,0 +1,75 @@
(function () {
'use strict';
var
ko = require('ko'),
Enums = require('Common/Enums'),
Consts = require('Common/Consts'),
Cache = require('Storage/User/Cache')
;
/**
* @constructor
*/
function FolderUserStore()
{
this.sentFolder = ko.observable('');
this.draftFolder = ko.observable('');
this.spamFolder = ko.observable('');
this.trashFolder = ko.observable('');
this.archiveFolder = ko.observable('');
this.computed();
this.subscribe();
}
FolderUserStore.prototype.computed = function ()
{
this.draftFolderNotEnabled = ko.computed(function () {
return '' === this.draftFolder() || Consts.Values.UnuseOptionValue === this.draftFolder();
}, this);
};
FolderUserStore.prototype.subscribe = function ()
{
var
fRemoveSystemFolderType = function (observable) {
return function () {
var oFolder = Cache.getFolderFromCacheList(observable());
if (oFolder)
{
oFolder.type(Enums.FolderType.User);
}
};
},
fSetSystemFolderType = function (iType) {
return function (sValue) {
var oFolder = Cache.getFolderFromCacheList(sValue);
if (oFolder)
{
oFolder.type(iType);
}
};
}
;
this.sentFolder.subscribe(fRemoveSystemFolderType(this.sentFolder), this, 'beforeChange');
this.draftFolder.subscribe(fRemoveSystemFolderType(this.draftFolder), this, 'beforeChange');
this.spamFolder.subscribe(fRemoveSystemFolderType(this.spamFolder), this, 'beforeChange');
this.trashFolder.subscribe(fRemoveSystemFolderType(this.trashFolder), this, 'beforeChange');
this.archiveFolder.subscribe(fRemoveSystemFolderType(this.archiveFolder), this, 'beforeChange');
this.sentFolder.subscribe(fSetSystemFolderType(Enums.FolderType.SentItems), this);
this.draftFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Draft), this);
this.spamFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Spam), this);
this.trashFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Trash), this);
this.archiveFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Archive), this);
};
module.exports = new FolderUserStore();
}());

View file

@ -2,96 +2,108 @@
'use strict';
// var
// window = require('window')
// ;
var
ko = require('ko')
;
/**
* @constructor
*/
function PgpUserStore()
{
this.capaOpenPGP = ko.observable(false);
this.openpgp = null;
this.keyring = [];
this.openpgpkeys = ko.observableArray([]);
this.openpgpKeyring = null;
this.openpgpkeysPublic = this.openpgpkeys.filter(function (oItem) {
return !!(oItem && !oItem.isPrivate);
});
this.openpgpkeysPrivate = this.openpgpkeys.filter(function (oItem) {
return !!(oItem && oItem.isPrivate);
});
}
PgpUserStore.prototype.sign = function (sText, oPrivateKey)
{
try
{
return this.openpgp.signClearMessage([oPrivateKey], sText);
}
catch (oExc) {}
return sText;
};
PgpUserStore.prototype.encrypt = function (sText, aPublicKeys)
{
try
{
return this.openpgp.encryptMessage(aPublicKeys, sText);
}
catch (oExc) {}
return sText;
};
PgpUserStore.prototype.signAndEncrypt = function (sText, aPublicKeys, oPrivateKey)
{
try
{
return this.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, sText);
}
catch (oExc) {}
return sText;
};
/**/
PgpUserStore.prototype.verify = function (sText, aPublicKeys)
{
var
mPgpMessage = null
;
try
{
mPgpMessage = this.openpgp.cleartext.readArmored(sText);
if (mPgpMessage && mPgpMessage.getText)
{
mPgpMessage.verify(aPublicKeys);
}
}
catch (oExc) {}
return false;
};
PgpUserStore.prototype.decryptAndVerify = function (sEnctyptedText, aPublicKeys, oPivateKey)
{
var
mPgpMessageDecrypted = null,
mPgpMessage = null
;
try
{
mPgpMessage = this.openpgp.message.readArmored(sEnctyptedText);
if (mPgpMessage && oPivateKey && mPgpMessage.decrypt)
{
mPgpMessageDecrypted = mPgpMessage.decrypt(oPivateKey);
if (mPgpMessageDecrypted)
{
mPgpMessageDecrypted.verify(aPublicKeys);
}
}
}
catch (oExc) {}
return false;
};
// PgpUserStore.prototype.sign = function (sText, oPrivateKey)
// {
// try
// {
// return this.openpgp.signClearMessage([oPrivateKey], sText);
// }
// catch (oExc) {}
//
// return sText;
// };
//
// PgpUserStore.prototype.encrypt = function (sText, aPublicKeys)
// {
// try
// {
// return this.openpgp.encryptMessage(aPublicKeys, sText);
// }
// catch (oExc) {}
//
// return sText;
// };
//
// PgpUserStore.prototype.signAndEncrypt = function (sText, aPublicKeys, oPrivateKey)
// {
// try
// {
// return this.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, sText);
// }
// catch (oExc) {}
//
// return sText;
// };
//
// /**/
//
// PgpUserStore.prototype.verify = function (sText, aPublicKeys)
// {
// var
// mPgpMessage = null
// ;
//
// try
// {
// mPgpMessage = this.openpgp.cleartext.readArmored(sText);
// if (mPgpMessage && mPgpMessage.getText)
// {
// mPgpMessage.verify(aPublicKeys);
// }
// }
// catch (oExc) {}
//
// return false;
// };
//
// PgpUserStore.prototype.decryptAndVerify = function (sEnctyptedText, aPublicKeys, oPivateKey)
// {
// var
// mPgpMessageDecrypted = null,
// mPgpMessage = null
// ;
//
// try
// {
// mPgpMessage = this.openpgp.message.readArmored(sEnctyptedText);
// if (mPgpMessage && oPivateKey && mPgpMessage.decrypt)
// {
// mPgpMessageDecrypted = mPgpMessage.decrypt(oPivateKey);
// if (mPgpMessageDecrypted)
// {
// mPgpMessageDecrypted.verify(aPublicKeys);
// }
// }
// }
// catch (oExc) {}
//
// return false;
// };
/**
* @return {boolean}

View file

@ -18,12 +18,12 @@
}
html.rl-started-trigger.no-mobile .b-login-content .loginFormWrapper {
transform: translateY(-30px);
transform: translateY(-20px);
}
html.rl-started-trigger.no-mobile #rl-content {
/*html.rl-started-trigger.no-mobile #rl-content {
opacity: 0.7;
}
}*/
#rl-loading {
.transition(opacity 0.5s linear);
@ -50,9 +50,9 @@ html.rl-started-trigger.no-mobile #rl-content {
}
}
&.csstransitions.no-mobile #rl-content {
/* &.csstransitions.no-mobile #rl-content {
.transition(opacity 0.3s ease-out);
}
}*/
&.csstransitions.no-mobile .b-login-content .loginFormWrapper {
.transition(all 0.3s ease-out);
@ -103,8 +103,8 @@ html.rl-started-trigger.no-mobile #rl-content {
&.csstransitions .modal.fade {
.transition(all 0.2s ease-out);
transform: translateY(-20px);
.transition(all 200ms ease-out);
transform: scale(.9);
&.in {
transform: none;

View file

@ -237,7 +237,8 @@ html.no-rgba .modal {
}
.modal-backdrop, .modal-backdrop.fade.in {
.opacity(10);
.opacity(20);
transform: none;
}
.popups {

View file

@ -29,9 +29,9 @@
this.adminManLoading = ko.computed(function () {
return '000' !== [
require('Stores/Admin/Domain').collection.loading() ? '1' : '0',
require('Stores/Admin/Plugin').collection.loading() ? '1' : '0',
require('Stores/Admin/Package').collection.loading() ? '1' : '0'
require('Stores/Admin/Domain').domains.loading() ? '1' : '0',
require('Stores/Admin/Plugin').plugins.loading() ? '1' : '0',
require('Stores/Admin/Package').packages.loading() ? '1' : '0'
].join('');
}, this);

View file

@ -9,7 +9,7 @@
Utils = require('Common/Utils'),
Data = require('Storage/User/Data'),
PgpStore = require('Stores/User/Pgp'),
kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView')
@ -38,7 +38,7 @@
aMatch = null,
sKey = Utils.trim(this.key()),
oReg = /[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,
oOpenpgpKeyring = Data.openpgpKeyring
oOpenpgpKeyring = PgpStore.openpgpKeyring
;
sKey = sKey.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g, '\n$1!-!N!-!$2')

View file

@ -24,6 +24,9 @@
AppStore = require('Stores/User/App'),
SettingsStore = require('Stores/User/Settings'),
IdentityStore = require('Stores/User/Identity'),
AccountStore = require('Stores/User/Account'),
FolderStore = require('Stores/User/Folder'),
PgpStore = require('Stores/User/Pgp'),
SocialStore = require('Stores/Social'),
Settings = require('Storage/Settings'),
@ -63,7 +66,7 @@
this.composeInEdit = Data.composeInEdit;
this.editorDefaultType = SettingsStore.editorDefaultType;
this.capaOpenPGP = Data.capaOpenPGP;
this.capaOpenPGP = PgpStore.capaOpenPGP;
this.resizer = ko.observable(false).extend({'throttle': 50});
@ -175,7 +178,7 @@
this.identitiesOptions = ko.computed(function () {
var aList = [{
'optValue': Data.accountEmail(),
'optValue': AccountStore.email(),
'optText': this.formattedFrom(false)
}];
@ -200,7 +203,7 @@
sID = this.currentIdentityID()
;
if (this.bCapaAdditionalIdentities && sID && sID !== Data.accountEmail())
if (this.bCapaAdditionalIdentities && sID && sID !== AccountStore.email())
{
oItem = _.find(aList, function (oItem) {
return oItem && sID === oItem['id'];
@ -269,7 +272,7 @@
var
sTo = Utils.trim(this.to()),
sSentFolder = Data.sentFolder(),
sSentFolder = FolderStore.sentFolder(),
aFlagsCache = []
;
@ -356,7 +359,7 @@
this.saveCommand = Utils.createCommand(this, function () {
if (Data.draftFolderNotEnabled())
if (FolderStore.draftFolderNotEnabled())
{
kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]);
}
@ -367,13 +370,13 @@
this.autosaveStart();
Cache.setFolderHash(Data.draftFolder(), '');
Cache.setFolderHash(FolderStore.draftFolder(), '');
Remote.saveMessage(
this.saveMessageResponse,
this.draftFolder(),
this.draftUid(),
Data.draftFolder(),
FolderStore.draftFolder(),
this.currentIdentityResultEmail(),
this.to(),
this.cc(),
@ -396,7 +399,7 @@
this.bSkipNextHide = true;
if (this.modalVisibility() && !this.saving() && !this.sending() &&
!Data.draftFolderNotEnabled())
!FolderStore.draftFolderNotEnabled())
{
this.saveCommand();
}
@ -422,7 +425,7 @@
Events.sub('interval.2m', function () {
if (this.modalVisibility() && !Data.draftFolderNotEnabled() && !this.isEmptyForm(false) &&
if (this.modalVisibility() && !FolderStore.draftFolderNotEnabled() && !this.isEmptyForm(false) &&
!this.saving() && !this.sending() && !this.savedError())
{
this.saveCommand();
@ -494,7 +497,7 @@
ComposePopupView.prototype.autosaveFunction = function ()
{
if (this.modalVisibility() && !Data.draftFolderNotEnabled() && !this.isEmptyForm(false) &&
if (this.modalVisibility() && !FolderStore.draftFolderNotEnabled() && !this.isEmptyForm(false) &&
!this.saving() && !this.sending() && !this.savedError())
{
this.saveCommand();
@ -525,7 +528,7 @@
ComposePopupView.prototype.openOpenPgpPopup = function ()
{
if (this.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml())
if (PgpStore.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml())
{
var self = this;
kn.showScreenPopup(require('View/Popup/ComposeOpenPgp'), [
@ -546,7 +549,7 @@
ComposePopupView.prototype.reloadDraftFolder = function ()
{
var
sDraftFolder = Data.draftFolder()
sDraftFolder = FolderStore.draftFolder()
;
if ('' !== sDraftFolder)
@ -589,7 +592,7 @@
});
}
oIDs[Data.accountEmail()] = Data.accountEmail();
oIDs[AccountStore.email()] = AccountStore.email();
if (oMessage)
{
@ -616,7 +619,7 @@
if ('' === sResult)
{
sResult = Data.accountEmail();
sResult = AccountStore.email();
sEmail = sResult;
}
@ -639,8 +642,8 @@
ComposePopupView.prototype.formattedFrom = function (bHeaderResult)
{
var
sDisplayName = Data.displayName(),
sEmail = Data.accountEmail()
sDisplayName = AccountStore.displayName(),
sEmail = AccountStore.email()
;
return '' === sDisplayName ? sEmail :
@ -946,9 +949,9 @@
aResplyAllParts = [],
oExcludeEmail = {},
oIdResult = null,
mEmail = Data.accountEmail(),
sSignature = Data.signature(),
bSignatureToAll = Data.signatureToAll(),
mEmail = AccountStore.email(),
sSignature = AccountStore.signature(),
bSignatureToAll = AccountStore.signatureToAll(),
aDownloads = [],
aDraftInfo = null,
oMessage = null,

View file

@ -114,19 +114,19 @@
if (oPrivateKey && 0 === aPublicKeys.length)
{
self.resultCallback(
Data.openpgp.signClearMessage([oPrivateKey], self.text())
PgpStore.openpgp.signClearMessage([oPrivateKey], self.text())
);
}
else if (oPrivateKey && 0 < aPublicKeys.length)
{
self.resultCallback(
Data.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, self.text())
PgpStore.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, self.text())
);
}
else if (!oPrivateKey && 0 < aPublicKeys.length)
{
self.resultCallback(
Data.openpgp.encryptMessage(aPublicKeys, self.text())
PgpStore.openpgp.encryptMessage(aPublicKeys, self.text())
);
}
}

View file

@ -18,7 +18,7 @@
Links = require('Common/Links'),
Translator = require('Common/Translator'),
SettingsUserStore = require('Stores/User/Settings'),
SettingsStore = require('Stores/User/Settings'),
Data = require('Storage/User/Data'),
Remote = require('Storage/User/Remote'),
@ -175,7 +175,7 @@
this.viewSaving = ko.observable(false);
this.useCheckboxesInList = SettingsUserStore.useCheckboxesInList;
this.useCheckboxesInList = SettingsStore.useCheckboxesInList;
this.search.subscribe(function () {
this.reloadContactList();

View file

@ -12,6 +12,8 @@
Utils = require('Common/Utils'),
Translator = require('Common/Translator'),
FolderStore = require('Stores/User/Folder'),
Settings = require('Storage/Settings'),
Data = require('Storage/User/Data'),
Remote = require('Storage/User/Remote'),
@ -43,31 +45,30 @@
}, this);
var
self = this,
fSaveSystemFolders = null,
fCallback = null
;
this.sentFolder = Data.sentFolder;
this.draftFolder = Data.draftFolder;
this.spamFolder = Data.spamFolder;
this.trashFolder = Data.trashFolder;
this.archiveFolder = Data.archiveFolder;
this.sentFolder = FolderStore.sentFolder;
this.draftFolder = FolderStore.draftFolder;
this.spamFolder = FolderStore.spamFolder;
this.trashFolder = FolderStore.trashFolder;
this.archiveFolder = FolderStore.archiveFolder;
fSaveSystemFolders = _.debounce(function () {
Settings.settingsSet('SentFolder', self.sentFolder());
Settings.settingsSet('DraftFolder', self.draftFolder());
Settings.settingsSet('SpamFolder', self.spamFolder());
Settings.settingsSet('TrashFolder', self.trashFolder());
Settings.settingsSet('ArchiveFolder', self.archiveFolder());
Settings.settingsSet('SentFolder', FolderStore.sentFolder());
Settings.settingsSet('DraftFolder', FolderStore.draftFolder());
Settings.settingsSet('SpamFolder', FolderStore.spamFolder());
Settings.settingsSet('TrashFolder', FolderStore.trashFolder());
Settings.settingsSet('ArchiveFolder', FolderStore.archiveFolder());
Remote.saveSystemFolders(Utils.emptyFunction, {
'SentFolder': self.sentFolder(),
'DraftFolder': self.draftFolder(),
'SpamFolder': self.spamFolder(),
'TrashFolder': self.trashFolder(),
'ArchiveFolder': self.archiveFolder(),
'SentFolder': FolderStore.sentFolder(),
'DraftFolder': FolderStore.draftFolder(),
'SpamFolder': FolderStore.spamFolder(),
'TrashFolder': FolderStore.trashFolder(),
'ArchiveFolder': FolderStore.archiveFolder(),
'NullFolder': 'NullFolder'
});
@ -75,20 +76,20 @@
fCallback = function () {
Settings.settingsSet('SentFolder', self.sentFolder());
Settings.settingsSet('DraftFolder', self.draftFolder());
Settings.settingsSet('SpamFolder', self.spamFolder());
Settings.settingsSet('TrashFolder', self.trashFolder());
Settings.settingsSet('ArchiveFolder', self.archiveFolder());
Settings.settingsSet('SentFolder', FolderStore.sentFolder());
Settings.settingsSet('DraftFolder', FolderStore.draftFolder());
Settings.settingsSet('SpamFolder', FolderStore.spamFolder());
Settings.settingsSet('TrashFolder', FolderStore.trashFolder());
Settings.settingsSet('ArchiveFolder', FolderStore.archiveFolder());
fSaveSystemFolders();
};
this.sentFolder.subscribe(fCallback);
this.draftFolder.subscribe(fCallback);
this.spamFolder.subscribe(fCallback);
this.trashFolder.subscribe(fCallback);
this.archiveFolder.subscribe(fCallback);
FolderStore.sentFolder.subscribe(fCallback);
FolderStore.draftFolder.subscribe(fCallback);
FolderStore.spamFolder.subscribe(fCallback);
FolderStore.trashFolder.subscribe(fCallback);
FolderStore.archiveFolder.subscribe(fCallback);
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;

View file

@ -12,7 +12,7 @@
Translator = require('Common/Translator'),
Remote = require('Storage/User/Remote'),
Data = require('Storage/User/Data'),
AccountStore = require('Stores/User/Account'),
kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView')
@ -147,7 +147,7 @@
this.replyTo(oIdentity.replyTo());
this.bcc(oIdentity.bcc());
this.owner(this.id === Data.accountEmail());
this.owner(this.id === AccountStore.email());
}
};

View file

@ -10,6 +10,7 @@
Utils = require('Common/Utils'),
Data = require('Storage/User/Data'),
PgpStore = require('Stores/User/Pgp'),
kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView')
@ -43,7 +44,7 @@
self = this,
sUserID = '',
mKeyPair = null,
oOpenpgpKeyring = Data.openpgpKeyring
oOpenpgpKeyring = PgpStore.openpgpKeyring
;
this.email.error('' === Utils.trim(this.email()));
@ -61,8 +62,7 @@
this.submitRequest(true);
_.delay(function () {
// mKeyPair = Data.openpgp.generateKeyPair(1, Utils.pInt(self.keyBitLength()), sUserID, Utils.trim(self.password()));
mKeyPair = Data.openpgp.generateKeyPair({
mKeyPair = PgpStore.openpgp.generateKeyPair({
'userId': sUserID,
'numBits': Utils.pInt(self.keyBitLength()),
'passphrase': Utils.trim(self.password())

View file

@ -29,7 +29,7 @@
{
AbstractView.call(this, 'Right', 'SystemDropDown');
this.accountEmail = Data.accountEmail;
this.accountEmail = AccountStore.email;
this.accounts = AccountStore.accounts;
this.accountsUnreadCount = AccountStore.accountsUnreadCount;
@ -58,7 +58,7 @@
AbstractSystemDropDownUserView.prototype.emailTitle = function ()
{
return Data.accountEmail();
return AccountStore.email();
};
AbstractSystemDropDownUserView.prototype.settingsClick = function ()

View file

@ -357,8 +357,8 @@
break;
}
this.email(Data.devEmail);
this.password(Data.devPassword);
this.email(AppStore.devEmail);
this.password(AppStore.devPassword);
if (this.googleLoginEnabled())
{

View file

@ -16,7 +16,7 @@
Links = require('Common/Links'),
AppStore = require('Stores/User/App'),
SettingsUserStore = require('Stores/User/Settings'),
SettingsStore = require('Stores/User/Settings'),
Cache = require('Storage/User/Cache'),
Data = require('Storage/User/Data'),
@ -90,7 +90,7 @@
if (oFolder)
{
if (Enums.Layout.NoPreview === SettingsUserStore.layout())
if (Enums.Layout.NoPreview === SettingsStore.layout())
{
Data.message(null);
}

View file

@ -22,6 +22,7 @@
QuotaStore = require('Stores/User/Quota'),
SettingsStore = require('Stores/User/Settings'),
FolderStore = require('Stores/User/Folder'),
Settings = require('Storage/Settings'),
Cache = require('Storage/User/Cache'),
@ -137,36 +138,36 @@
}, this);
this.isSpamFolder = ko.computed(function () {
return Data.spamFolder() === this.messageListEndFolder() &&
'' !== Data.spamFolder();
return FolderStore.spamFolder() === this.messageListEndFolder() &&
'' !== FolderStore.spamFolder();
}, this);
this.isSpamDisabled = ko.computed(function () {
return Consts.Values.UnuseOptionValue === Data.spamFolder();
return Consts.Values.UnuseOptionValue === FolderStore.spamFolder();
}, this);
this.isTrashFolder = ko.computed(function () {
return Data.trashFolder() === this.messageListEndFolder() &&
'' !== Data.trashFolder();
return FolderStore.trashFolder() === this.messageListEndFolder() &&
'' !== FolderStore.trashFolder();
}, this);
this.isDraftFolder = ko.computed(function () {
return Data.draftFolder() === this.messageListEndFolder() &&
'' !== Data.draftFolder();
return FolderStore.draftFolder() === this.messageListEndFolder() &&
'' !== FolderStore.draftFolder();
}, this);
this.isSentFolder = ko.computed(function () {
return Data.sentFolder() === this.messageListEndFolder() &&
'' !== Data.sentFolder();
return FolderStore.sentFolder() === this.messageListEndFolder() &&
'' !== FolderStore.sentFolder();
}, this);
this.isArchiveFolder = ko.computed(function () {
return Data.archiveFolder() === this.messageListEndFolder() &&
'' !== Data.archiveFolder();
return FolderStore.archiveFolder() === this.messageListEndFolder() &&
'' !== FolderStore.archiveFolder();
}, this);
this.isArchiveDisabled = ko.computed(function () {
return Consts.Values.UnuseOptionValue === Data.archiveFolder();
return Consts.Values.UnuseOptionValue === FolderStore.archiveFolder();
}, this);
this.canBeMoved = this.hasCheckedOrSelectedLines;

View file

@ -19,7 +19,9 @@
Events = require('Common/Events'),
Translator = require('Common/Translator'),
SettingsUserStore = require('Stores/User/Settings'),
SettingsStore = require('Stores/User/Settings'),
AccountStore = require('Stores/User/Account'),
FolderStore = require('Stores/User/Folder'),
Local = require('Storage/Client'),
Cache = require('Storage/User/Cache'),
@ -62,10 +64,10 @@
this.messageLoading = Data.messageLoading;
this.messageLoadingThrottle = Data.messageLoadingThrottle;
this.messagesBodiesDom = Data.messagesBodiesDom;
this.useThreads = SettingsUserStore.useThreads;
this.replySameFolder = SettingsUserStore.replySameFolder;
this.layout = SettingsUserStore.layout;
this.usePreviewPane = SettingsUserStore.usePreviewPane;
this.useThreads = SettingsStore.useThreads;
this.replySameFolder = SettingsStore.replySameFolder;
this.layout = SettingsStore.layout;
this.usePreviewPane = SettingsStore.usePreviewPane;
this.isMessageSelected = Data.isMessageSelected;
this.messageActiveDom = Data.messageActiveDom;
this.messageError = Data.messageError;
@ -727,7 +729,7 @@
*/
MessageViewMailBoxUserView.prototype.isDraftFolder = function ()
{
return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw;
return Data.message() && FolderStore.draftFolder() === Data.message().folderFullNameRaw;
};
/**
@ -735,7 +737,7 @@
*/
MessageViewMailBoxUserView.prototype.isSentFolder = function ()
{
return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw;
return Data.message() && FolderStore.sentFolder() === Data.message().folderFullNameRaw;
};
/**
@ -743,7 +745,7 @@
*/
MessageViewMailBoxUserView.prototype.isSpamFolder = function ()
{
return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw;
return Data.message() && FolderStore.spamFolder() === Data.message().folderFullNameRaw;
};
/**
@ -751,7 +753,7 @@
*/
MessageViewMailBoxUserView.prototype.isSpamDisabled = function ()
{
return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue;
return Data.message() && FolderStore.spamFolder() === Consts.Values.UnuseOptionValue;
};
/**
@ -759,7 +761,7 @@
*/
MessageViewMailBoxUserView.prototype.isArchiveFolder = function ()
{
return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw;
return Data.message() && FolderStore.archiveFolder() === Data.message().folderFullNameRaw;
};
/**
@ -767,7 +769,7 @@
*/
MessageViewMailBoxUserView.prototype.isArchiveDisabled = function ()
{
return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue;
return Data.message() && FolderStore.archiveFolder() === Consts.Values.UnuseOptionValue;
};
/**
@ -873,7 +875,7 @@
Remote.sendReadReceiptMessage(Utils.emptyFunction, oMessage.folderFullNameRaw, oMessage.uid,
oMessage.readReceipt(),
Translator.i18n('READ_RECEIPT/SUBJECT', {'SUBJECT': oMessage.subject()}),
Translator.i18n('READ_RECEIPT/BODY', {'READ-RECEIPT': Data.accountEmail()}));
Translator.i18n('READ_RECEIPT/BODY', {'READ-RECEIPT': AccountStore.email()}));
oMessage.isReadReceipt(true);

View file

@ -1,8 +1,8 @@
{
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.7.3",
"release": "243",
"version": "1.8.0",
"release": "244",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "gulpfile.js",

View file

@ -2527,7 +2527,7 @@ class Actions
$bComplete = true;
$aCounts = array();
if ($this->Config()->Get('webmail', 'allow_additional_accounts', true))
{
$iLimit = 7;
@ -3006,6 +3006,21 @@ class Actions
));
}
/**
* @param string $sDomain
*
* @return string
*/
public function domainPathHelper($sDomain)
{
$sDomain = \strtolower(\trim($sDomain));
$sDomainPrefix = \substr(\preg_replace('/[^a-z0-9]+/', '', $sDomain), 0, 2);
$sDomainPrefix = \str_pad($sDomainPrefix, 2, '_');
return 'domains/'.$sDomainPrefix.'/'.\urlencode($sDomain);
}
/**
* @return string
*/
@ -3062,13 +3077,23 @@ class Actions
$iCode = 0;
$sContentType = '';
$sValue = $oHttp->GetUrlAsString(APP_API_PATH.'status/'.\urlencode($sDomain),
$sValue = $oHttp->GetUrlAsString(APP_STATUS_PATH.$this->domainPathHelper($sDomain),
'RainLoop/'.APP_VERSION, $sContentType, $iCode, $this->Logger(), 10,
$this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''),
array(), false
);
if (200 !== $iCode)
// $sValue = $oHttp->GetUrlAsString(APP_API_PATH.'status/'.\urlencode($sDomain),
// 'RainLoop/'.APP_VERSION, $sContentType, $iCode, $this->Logger(), 10,
// $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''),
// array(), false
// );
if (404 === $iCode)
{
$sValue = 'NO';
}
else if (200 !== $iCode)
{
$sValue = '';
}
@ -3425,34 +3450,41 @@ class Actions
}
}
try
if ($oDomain->UseSieve())
{
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->Logger());
$oSieveClient->SetTimeOuts($iConnectionTimeout);
$iTime = \microtime(true);
$oSieveClient->Connect($oDomain->SieveHost(), $oDomain->SievePort(), $oDomain->SieveSecure(),
!!$this->Config()->Get('ssl', 'verify_certificate', false),
!!$this->Config()->Get('ssl', 'allow_self_signed', true)
);
$iSieveTime = \microtime(true) - $iTime;
$oSieveClient->Disconnect();
$bSieveResult = true;
}
catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException)
{
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
$sSieveErrorDesc = $oException->getSocketMessage();
if (empty($sSieveErrorDesc))
try
{
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->Logger());
$oSieveClient->SetTimeOuts($iConnectionTimeout);
$iTime = \microtime(true);
$oSieveClient->Connect($oDomain->SieveHost(), $oDomain->SievePort(), $oDomain->SieveSecure(),
!!$this->Config()->Get('ssl', 'verify_certificate', false),
!!$this->Config()->Get('ssl', 'allow_self_signed', true)
);
$iSieveTime = \microtime(true) - $iTime;
$oSieveClient->Disconnect();
$bSieveResult = true;
}
catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException)
{
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
$sSieveErrorDesc = $oException->getSocketMessage();
if (empty($sSieveErrorDesc))
{
$sSieveErrorDesc = $oException->getMessage();
}
}
catch (\Exception $oException)
{
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
$sSieveErrorDesc = $oException->getMessage();
}
}
catch (\Exception $oException)
else
{
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
$sSieveErrorDesc = $oException->getMessage();
$bSieveResult = true;
}
}

View file

@ -63,7 +63,7 @@
</p>
</div>
<div data-bind="visible: licensing()">
<div class="alert alert-success span8" style="margin-left: 0; padding-top: 20px" data-bind="visible: licenseValid() && '' === licenseError()">
<div class="alert alert-success span8" style="margin-left: 0; margin-top: 10px; padding-top: 20px" data-bind="visible: licenseValid() && '' === licenseError()">
<h4>
Premium
<span data-bind="visible: licenseIsUnlim()">(Lifetime)</span>
@ -74,7 +74,7 @@
<span data-bind="text: licenseExpiredMomentValue()"></span>
</p>
</div>
<div class="alert alert-error span8" style="margin-left: 0" data-bind="visible: !licenseValid() && '' !== licenseError(), text: licenseError"></div>
<div class="alert alert-error span8" style="margin-left: 0; margin-top: 10px;" data-bind="visible: !licenseValid() && '' !== licenseError(), text: licenseError"></div>
</div>
</div>
</div>

View file

@ -104,7 +104,7 @@
<div class="e-languages thm-languages" data-bind="visible: allowLanguagesOnLogin() && socialLoginEnabled()">
<label class="flag-selector">
<i data-bind="css: langRequest() ? 'icon-spinner animated' : 'icon-world'"></i>
&nbsp;
&nbsp;&nbsp;
<span class="flag-name" data-bind="text: languageFullName, click: selectLanguage"></span>
</label>
</div>

View file

@ -90,7 +90,7 @@
}
}"></div>
<br />
<div data-bind="visible: threading, component: {
<div data-bind="visible: threadsAllowed, component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_GENERAL/LABEL_USE_THREADS',

View file

@ -22,17 +22,6 @@
<strong><span data-bind="text: viewUser"></span></strong>
</div>
</div>
<!--
<div class="control-group">
<label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_SECURITY/LABEL_TWO_FACTOR_STATUS"></span>
</label>
<div class="controls" style="padding-top: 5px;">
<strong data-bind="visible: !processing()"><span data-bind="text: viewTwoFactorStatus"></span></strong>
<strong data-bind="visible: processing()">...</strong>
</div>
</div>
-->
<div class="control-group">
<div class="controls">
<a class="btn" data-bind="click: clearTwoFactor, visible: twoFactorStatus">
@ -75,7 +64,7 @@
<p class="muted i18n" style="width: 550px" data-i18n-text="SETTINGS_SECURITY/TWO_FACTOR_SECRET_DESC"></p>
</blockquote>
<!-- ko if: '' !== viewUrl() -->
<img style="margin-left: -7px;" src="javascript:void();" data-bind="attr: {'src': viewUrl}" />
<img style="margin-left: -7px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=" data-bind="attr: {'src': viewUrl}" />
<!-- /ko -->
</div>
</div>

View file

@ -6,9 +6,9 @@
<i data-bind="css: {'icon-user': !accounts.loading(), 'icon-spinner animated': accounts.loading()}"
></i>
&nbsp;
<b data-bind="text: accountsUnreadCount, visible: 100 > accountsUnreadCount() && 0 < accountsUnreadCount()"></b>
<!-- <b data-bind="text: accountsUnreadCount, visible: 100 > accountsUnreadCount() && 0 < accountsUnreadCount()"></b>
<b data-bind="visible: 99 < accountsUnreadCount()">99+</b>
&nbsp;
&nbsp;-->
<span class="caret"></span>
</a>
<ul class="dropdown-menu g-ui-menu" tabindex="-1" role="menu" aria-labelledby="top-system-dropdown-id">
@ -18,10 +18,10 @@
<li class="e-item" role="presentation">
<a class="e-link menuitem account-item" href="#" data-bind="click: $root.accountClick,
attr: {'href': changeAccountLink()}, css: {current: $root.accountEmail() === email}">
<b class="pull-right counter" data-bind="visible: 0 < count()">
<!-- <b class="pull-right counter" data-bind="visible: 0 < count()">
<span data-bind="text: count, visible: 100 > count()"></span>
<span data-bind="visible: 99 < count()">99+</span>
</b>
</b>-->
<i class="icon-ok"></i>
<i class="icon-user"></i>
&nbsp;&nbsp;

View file

@ -57,6 +57,7 @@ Options -Indexes
define('APP_API_PATH', 'http://api.rainloop.net/');
define('APP_REP_PATH', 'http://repository.rainloop.net/v1/');
define('APP_REPO_CORE_FILE', 'http://repository.rainloop.net/v2/core.{{channel}}.json');
define('APP_STATUS_PATH', 'http://status.rainloop.net/');
define('APP_WEB_PATH', 'rainloop/v/'.APP_VERSION.'/');
define('APP_WEB_STATIC_PATH', APP_WEB_PATH.'static/');
define('APP_DATA_FOLDER_PATH_UNIX', str_replace('\\', '/', APP_DATA_FOLDER_PATH));

View file

@ -16,8 +16,8 @@
@login-box-shadow: 0px 2px 10px rgba(0,0,0,0.2);
@login-border: none;
@login-border-radius: 7px;
@powered-color: #ddd;
@languages-color: #ddd;
@powered-color: #fff;
@languages-color: #fff;
// MENU
@dropdown-menu-color: #333;

File diff suppressed because one or more lines are too long