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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -17,16 +17,14 @@
Links = require('Common/Links'), Links = require('Common/Links'),
Translator = require('Common/Translator'), Translator = require('Common/Translator'),
SettingsUserStore = require('Stores/User/Settings'), SettingsStore = require('Stores/User/Settings'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage/User/Cache'), Cache = require('Storage/User/Cache'),
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
MessageModel = require('Model/Message'), MessageModel = require('Model/Message')
Local = require('Storage/Client')
; ;
/** /**
@ -34,71 +32,6 @@
*/ */
function DataUserStorage() 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 // contacts
this.contacts = ko.observableArray([]); this.contacts = ko.observableArray([]);
this.contacts.loading = ko.observable(false).extend({'throttle': 200}); this.contacts.loading = ko.observable(false).extend({'throttle': 200});
@ -176,13 +109,15 @@
this.folderListSystemNames = ko.computed(function () { this.folderListSystemNames = ko.computed(function () {
var var
FolderStore = require('Stores/User/Folder'),
aList = [Cache.getFolderInboxName()], aList = [Cache.getFolderInboxName()],
aFolders = this.folderList(), aFolders = this.folderList(),
sSentFolder = this.sentFolder(), sSentFolder = FolderStore.sentFolder(),
sDraftFolder = this.draftFolder(), sDraftFolder = FolderStore.draftFolder(),
sSpamFolder = this.spamFolder(), sSpamFolder = FolderStore.spamFolder(),
sTrashFolder = this.trashFolder(), sTrashFolder = FolderStore.trashFolder(),
sArchiveFolder = this.archiveFolder() sArchiveFolder = FolderStore.archiveFolder()
; ;
if (Utils.isArray(aFolders) && 0 < aFolders.length) if (Utils.isArray(aFolders) && 0 < aFolders.length)
@ -261,7 +196,7 @@
this.messageListPageCount = ko.computed(function () { this.messageListPageCount = ko.computed(function () {
var iPage = window.Math.ceil(this.messageListCount() / var iPage = window.Math.ceil(this.messageListCount() /
SettingsUserStore.messagesPerPage()); SettingsStore.messagesPerPage());
return 0 >= iPage ? 1 : iPage; return 0 >= iPage ? 1 : iPage;
}, this); }, this);
@ -317,13 +252,13 @@
this.messageFullScreenMode(false); this.messageFullScreenMode(false);
this.hideMessageBodies(); this.hideMessageBodies();
if (Enums.Layout.NoPreview === SettingsUserStore.layout() && if (Enums.Layout.NoPreview === SettingsStore.layout() &&
-1 < window.location.hash.indexOf('message-preview')) -1 < window.location.hash.indexOf('message-preview'))
{ {
require('App/User').historyBack(); require('App/User').historyBack();
} }
} }
else if (Enums.Layout.NoPreview === SettingsUserStore.layout()) else if (Enums.Layout.NoPreview === SettingsStore.layout())
{ {
this.message.focused(true); this.message.focused(true);
} }
@ -337,7 +272,7 @@
} }
else if (Enums.KeyState.MessageView === Globals.keyScope()) 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); Globals.keyScope(Enums.KeyState.MessageView);
} }
@ -422,20 +357,6 @@
// other // other
this.composeInEdit = ko.observable(false); 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); 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) DataUserStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
{ {
if (Cache.getFolderInboxName() === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '') if (Cache.getFolderInboxName() === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
@ -515,7 +415,7 @@
{ {
NotificationStore.displayDesktopNotification( NotificationStore.displayDesktopNotification(
Links.notificationMailIcon(), Links.notificationMailIcon(),
this.accountEmail(), require('Stores/User/Account').email(),
Translator.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', { Translator.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', {
'COUNT': iLen 'COUNT': iLen
}) })
@ -793,7 +693,7 @@
bIsHtml = false; bIsHtml = false;
sResultHtml = Utils.plainToHtml(oData.Result.Plain.toString(), 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); oMessage.plainRaw = Utils.pString(oData.Result.Plain);
@ -856,7 +756,7 @@
oMessage.showInternalImages(true); oMessage.showInternalImages(true);
} }
if (oMessage.hasImages() && SettingsUserStore.showImages()) if (oMessage.hasImages() && SettingsStore.showImages())
{ {
oMessage.showExternalImages(true); oMessage.showExternalImages(true);
} }
@ -907,7 +807,7 @@
DataUserStorage.prototype.findPublicKeyByHex = function (sHash) 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; return oItem && sHash === oItem.id;
}); });
}; };
@ -915,7 +815,7 @@
DataUserStorage.prototype.findPublicKeysByEmail = function (sEmail) DataUserStorage.prototype.findPublicKeysByEmail = function (sEmail)
{ {
var self = this; var self = this;
return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) { return _.compact(_.map(require('Stores/User/Pgp').openpgpkeysPublic(), function (oItem) {
var oKey = null; var oKey = null;
if (oItem && sEmail === oItem.email) if (oItem && sEmail === oItem.email)
@ -946,7 +846,7 @@
var var
self = this, self = this,
oPrivateKey = null, oPrivateKey = null,
oKey = _.find(this.openpgpkeysPrivate(), function (oItem) { oKey = _.find(require('Stores/User/Pgp').openpgpkeysPrivate(), function (oItem) {
return oItem && sEmail === oItem.email; return oItem && sEmail === oItem.email;
}) })
; ;
@ -981,7 +881,7 @@
*/ */
DataUserStorage.prototype.findSelfPrivateKey = function (sPassword) DataUserStorage.prototype.findSelfPrivateKey = function (sPassword)
{ {
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword); return this.findPrivateKeyByEmail(require('Stores/User/Account').email(), sPassword);
}; };
module.exports = new DataUserStorage(); module.exports = new DataUserStorage();

View file

@ -10,7 +10,8 @@
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Base64 = require('Common/Base64'), Base64 = require('Common/Base64'),
SettingsUserStore = require('Stores/User/Settings'), AppStore = require('Stores/User/App'),
SettingsStore = require('Stores/User/Settings'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage/User/Cache'), Cache = require('Storage/User/Cache'),
@ -294,11 +295,11 @@
iOffset, iOffset,
iLimit, iLimit,
sSearch, sSearch,
Data.projectHash(), AppStore.projectHash(),
sFolderHash, sFolderHash,
Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '', Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
Data.threading() && SettingsUserStore.useThreads() ? '1' : '0', AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0',
Data.threading() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : '' AppStore.threadsAllowed() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
].join(String.fromCharCode(0))), bSilent ? [] : ['MessageList']); ].join(String.fromCharCode(0))), bSilent ? [] : ['MessageList']);
} }
else else
@ -309,8 +310,8 @@
'Limit': iLimit, 'Limit': iLimit,
'Search': sSearch, 'Search': sSearch,
'UidNext': Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '', 'UidNext': Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
'UseThreads': Data.threading() && SettingsUserStore.useThreads() ? '1' : '0', 'UseThreads': AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0',
'ExpandedThreadUid': Data.threading() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : '' 'ExpandedThreadUid': AppStore.threadsAllowed() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
}, '' === sSearch ? Consts.Defaults.DefaultAjaxTimeout : Consts.Defaults.SearchAjaxTimeout, '', bSilent ? [] : ['MessageList']); }, '' === sSearch ? Consts.Defaults.DefaultAjaxTimeout : Consts.Defaults.SearchAjaxTimeout, '', bSilent ? [] : ['MessageList']);
} }
}; };
@ -343,8 +344,8 @@
'Message/' + Base64.urlsafe_encode([ 'Message/' + Base64.urlsafe_encode([
sFolderFullNameRaw, sFolderFullNameRaw,
iUid, iUid,
Data.projectHash(), AppStore.projectHash(),
Data.threading() && SettingsUserStore.useThreads() ? '1' : '0' AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0'
].join(String.fromCharCode(0))), ['Message']); ].join(String.fromCharCode(0))), ['Message']);
return true; return true;
@ -423,7 +424,7 @@
'UidNext': Cache.getFolderInboxName() === sFolder ? Cache.getFolderUidNext(sFolder) : '' 'UidNext': Cache.getFolderInboxName() === sFolder ? Cache.getFolderUidNext(sFolder) : ''
}); });
} }
else if (SettingsUserStore.useThreads()) else if (SettingsStore.useThreads())
{ {
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache(); 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 var
ko = require('ko'), ko = require('ko'),
Settings = require('Storage/Settings') Settings = require('Storage/Settings'),
AppStore = require('Stores/App')
; ;
/** /**
@ -14,10 +16,7 @@
*/ */
function AppAdminStore() function AppAdminStore()
{ {
// same AppStore.call(this);
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true);
// ----
this.determineUserLanguage = ko.observable(false); this.determineUserLanguage = ko.observable(false);
this.determineUserDomain = ko.observable(false); this.determineUserDomain = ko.observable(false);
@ -28,8 +27,7 @@
AppAdminStore.prototype.populate = function() AppAdminStore.prototype.populate = function()
{ {
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin')); AppStore.prototype.populate.call(this);
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
this.determineUserLanguage(!!Settings.settingsGet('DetermineUserLanguage')); this.determineUserLanguage(!!Settings.settingsGet('DetermineUserLanguage'));
this.determineUserDomain(!!Settings.settingsGet('DetermineUserDomain')); this.determineUserDomain(!!Settings.settingsGet('DetermineUserDomain'));

View file

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

View file

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

View file

@ -12,9 +12,9 @@
*/ */
function PluginAdminStore() function PluginAdminStore()
{ {
this.collection = ko.observableArray([]); this.plugins = ko.observableArray([]);
this.collection.loading = ko.observable(false).extend({'throttle': 100}); this.plugins.loading = ko.observable(false).extend({'throttle': 100});
this.collection.error = ko.observable(''); this.plugins.error = ko.observable('');
} }
module.exports = new PluginAdminStore(); 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('_'), _ = require('_'),
ko = require('ko'), ko = require('ko'),
Settings = require('Storage/Settings'),
Remote = require('Storage/User/Remote') Remote = require('Storage/User/Remote')
; ;
@ -15,6 +17,15 @@
*/ */
function AccountUserStore() 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 = ko.observableArray([]);
this.accounts.loading = ko.observable(false).extend({'throttle': 100}); this.accounts.loading = ko.observable(false).extend({'throttle': 100});
@ -42,18 +53,30 @@
var iResult = 0; var iResult = 0;
_.each(this.accounts(), function (oItem) { // _.each(this.accounts(), function (oItem) {
if (oItem) // if (oItem)
{ // {
iResult += oItem.count(); // iResult += oItem.count();
} // }
}); // });
return iResult; return iResult;
}, this); }, 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(); module.exports = new AccountUserStore();
}()); }());

View file

@ -6,9 +6,9 @@
var var
ko = require('ko'), 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() function AppUserStore()
{ {
// same AppStore.call(this);
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true); this.projectHash = ko.observable('');
// ---- this.threadsAllowed = ko.observable(false);
this.contactsAutosave = ko.observable(false); this.contactsAutosave = ko.observable(false);
this.useLocalProxyForExternalImages = ko.observable(false); this.useLocalProxyForExternalImages = ko.observable(false);
this.contactsIsAllowed = ko.observable(false); this.contactsIsAllowed = ko.observable(false);
this.interfaceAnimation = ko.observable(true); this.devEmail = '';
this.devPassword = '';
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();
} }
AppUserStore.prototype.populate = function() AppUserStore.prototype.populate = function()
{ {
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin')); AppStore.prototype.populate.call(this);
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
this.projectHash(Settings.settingsGet('ProjectHash'));
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages')); this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed')); this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
this.devEmail = Settings.settingsGet('DevEmail');
this.devPassword = Settings.settingsGet('DevPassword');
}; };
module.exports = new AppUserStore(); module.exports = new AppUserStore();

View file

@ -15,10 +15,10 @@
this.capa = ko.observable(''); this.capa = ko.observable('');
this.modules = ko.observable({}); this.modules = ko.observable({});
this.collection = ko.observableArray([]); this.filters = ko.observableArray([]);
this.collection.loading = ko.observable(false).extend({'throttle': 200}); this.filters.loading = ko.observable(false).extend({'throttle': 200});
this.collection.saving = ko.observable(false).extend({'throttle': 200}); this.filters.saving = ko.observable(false).extend({'throttle': 200});
this.raw = ko.observable(''); 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'; 'use strict';
// var var
// window = require('window') ko = require('ko')
// ; ;
/** /**
* @constructor * @constructor
*/ */
function PgpUserStore() function PgpUserStore()
{ {
this.capaOpenPGP = ko.observable(false);
this.openpgp = null; 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) // PgpUserStore.prototype.sign = function (sText, oPrivateKey)
{ // {
try // try
{ // {
return this.openpgp.signClearMessage([oPrivateKey], sText); // return this.openpgp.signClearMessage([oPrivateKey], sText);
} // }
catch (oExc) {} // catch (oExc) {}
//
return sText; // return sText;
}; // };
//
PgpUserStore.prototype.encrypt = function (sText, aPublicKeys) // PgpUserStore.prototype.encrypt = function (sText, aPublicKeys)
{ // {
try // try
{ // {
return this.openpgp.encryptMessage(aPublicKeys, sText); // return this.openpgp.encryptMessage(aPublicKeys, sText);
} // }
catch (oExc) {} // catch (oExc) {}
//
return sText; // return sText;
}; // };
//
PgpUserStore.prototype.signAndEncrypt = function (sText, aPublicKeys, oPrivateKey) // PgpUserStore.prototype.signAndEncrypt = function (sText, aPublicKeys, oPrivateKey)
{ // {
try // try
{ // {
return this.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, sText); // return this.openpgp.signAndEncryptMessage(aPublicKeys, oPrivateKey, sText);
} // }
catch (oExc) {} // catch (oExc) {}
//
return sText; // return sText;
}; // };
//
/**/ // /**/
//
PgpUserStore.prototype.verify = function (sText, aPublicKeys) // PgpUserStore.prototype.verify = function (sText, aPublicKeys)
{ // {
var // var
mPgpMessage = null // mPgpMessage = null
; // ;
//
try // try
{ // {
mPgpMessage = this.openpgp.cleartext.readArmored(sText); // mPgpMessage = this.openpgp.cleartext.readArmored(sText);
if (mPgpMessage && mPgpMessage.getText) // if (mPgpMessage && mPgpMessage.getText)
{ // {
mPgpMessage.verify(aPublicKeys); // mPgpMessage.verify(aPublicKeys);
} // }
} // }
catch (oExc) {} // catch (oExc) {}
//
return false; // return false;
}; // };
//
PgpUserStore.prototype.decryptAndVerify = function (sEnctyptedText, aPublicKeys, oPivateKey) // PgpUserStore.prototype.decryptAndVerify = function (sEnctyptedText, aPublicKeys, oPivateKey)
{ // {
var // var
mPgpMessageDecrypted = null, // mPgpMessageDecrypted = null,
mPgpMessage = null // mPgpMessage = null
; // ;
//
try // try
{ // {
mPgpMessage = this.openpgp.message.readArmored(sEnctyptedText); // mPgpMessage = this.openpgp.message.readArmored(sEnctyptedText);
if (mPgpMessage && oPivateKey && mPgpMessage.decrypt) // if (mPgpMessage && oPivateKey && mPgpMessage.decrypt)
{ // {
mPgpMessageDecrypted = mPgpMessage.decrypt(oPivateKey); // mPgpMessageDecrypted = mPgpMessage.decrypt(oPivateKey);
if (mPgpMessageDecrypted) // if (mPgpMessageDecrypted)
{ // {
mPgpMessageDecrypted.verify(aPublicKeys); // mPgpMessageDecrypted.verify(aPublicKeys);
} // }
} // }
} // }
catch (oExc) {} // catch (oExc) {}
//
return false; // return false;
}; // };
/** /**
* @return {boolean} * @return {boolean}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,7 +12,7 @@
Translator = require('Common/Translator'), Translator = require('Common/Translator'),
Remote = require('Storage/User/Remote'), Remote = require('Storage/User/Remote'),
Data = require('Storage/User/Data'), AccountStore = require('Stores/User/Account'),
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView') AbstractView = require('Knoin/AbstractView')
@ -147,7 +147,7 @@
this.replyTo(oIdentity.replyTo()); this.replyTo(oIdentity.replyTo());
this.bcc(oIdentity.bcc()); 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'), Utils = require('Common/Utils'),
Data = require('Storage/User/Data'), Data = require('Storage/User/Data'),
PgpStore = require('Stores/User/Pgp'),
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView') AbstractView = require('Knoin/AbstractView')
@ -43,7 +44,7 @@
self = this, self = this,
sUserID = '', sUserID = '',
mKeyPair = null, mKeyPair = null,
oOpenpgpKeyring = Data.openpgpKeyring oOpenpgpKeyring = PgpStore.openpgpKeyring
; ;
this.email.error('' === Utils.trim(this.email())); this.email.error('' === Utils.trim(this.email()));
@ -61,8 +62,7 @@
this.submitRequest(true); this.submitRequest(true);
_.delay(function () { _.delay(function () {
// mKeyPair = Data.openpgp.generateKeyPair(1, Utils.pInt(self.keyBitLength()), sUserID, Utils.trim(self.password())); mKeyPair = PgpStore.openpgp.generateKeyPair({
mKeyPair = Data.openpgp.generateKeyPair({
'userId': sUserID, 'userId': sUserID,
'numBits': Utils.pInt(self.keyBitLength()), 'numBits': Utils.pInt(self.keyBitLength()),
'passphrase': Utils.trim(self.password()) 'passphrase': Utils.trim(self.password())

View file

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

View file

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

View file

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

View file

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

View file

@ -19,7 +19,9 @@
Events = require('Common/Events'), Events = require('Common/Events'),
Translator = require('Common/Translator'), 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'), Local = require('Storage/Client'),
Cache = require('Storage/User/Cache'), Cache = require('Storage/User/Cache'),
@ -62,10 +64,10 @@
this.messageLoading = Data.messageLoading; this.messageLoading = Data.messageLoading;
this.messageLoadingThrottle = Data.messageLoadingThrottle; this.messageLoadingThrottle = Data.messageLoadingThrottle;
this.messagesBodiesDom = Data.messagesBodiesDom; this.messagesBodiesDom = Data.messagesBodiesDom;
this.useThreads = SettingsUserStore.useThreads; this.useThreads = SettingsStore.useThreads;
this.replySameFolder = SettingsUserStore.replySameFolder; this.replySameFolder = SettingsStore.replySameFolder;
this.layout = SettingsUserStore.layout; this.layout = SettingsStore.layout;
this.usePreviewPane = SettingsUserStore.usePreviewPane; this.usePreviewPane = SettingsStore.usePreviewPane;
this.isMessageSelected = Data.isMessageSelected; this.isMessageSelected = Data.isMessageSelected;
this.messageActiveDom = Data.messageActiveDom; this.messageActiveDom = Data.messageActiveDom;
this.messageError = Data.messageError; this.messageError = Data.messageError;
@ -727,7 +729,7 @@
*/ */
MessageViewMailBoxUserView.prototype.isDraftFolder = function () 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 () 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 () 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 () 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 () 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 () 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, Remote.sendReadReceiptMessage(Utils.emptyFunction, oMessage.folderFullNameRaw, oMessage.uid,
oMessage.readReceipt(), oMessage.readReceipt(),
Translator.i18n('READ_RECEIPT/SUBJECT', {'SUBJECT': oMessage.subject()}), 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); oMessage.isReadReceipt(true);

View file

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

View file

@ -2527,7 +2527,7 @@ class Actions
$bComplete = true; $bComplete = true;
$aCounts = array(); $aCounts = array();
if ($this->Config()->Get('webmail', 'allow_additional_accounts', true)) if ($this->Config()->Get('webmail', 'allow_additional_accounts', true))
{ {
$iLimit = 7; $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 * @return string
*/ */
@ -3062,13 +3077,23 @@ class Actions
$iCode = 0; $iCode = 0;
$sContentType = ''; $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, 'RainLoop/'.APP_VERSION, $sContentType, $iCode, $this->Logger(), 10,
$this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''), $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''),
array(), false 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 = ''; $sValue = '';
} }
@ -3425,34 +3450,41 @@ class Actions
} }
} }
try if ($oDomain->UseSieve())
{ {
$oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->Logger()); try
$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))
{ {
$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(); $sSieveErrorDesc = $oException->getMessage();
} }
} }
catch (\Exception $oException) else
{ {
$this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); $bSieveResult = true;
$sSieveErrorDesc = $oException->getMessage();
} }
} }

View file

@ -63,7 +63,7 @@
</p> </p>
</div> </div>
<div data-bind="visible: licensing()"> <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> <h4>
Premium Premium
<span data-bind="visible: licenseIsUnlim()">(Lifetime)</span> <span data-bind="visible: licenseIsUnlim()">(Lifetime)</span>
@ -74,7 +74,7 @@
<span data-bind="text: licenseExpiredMomentValue()"></span> <span data-bind="text: licenseExpiredMomentValue()"></span>
</p> </p>
</div> </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> </div>
</div> </div>

View file

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

View file

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

View file

@ -22,17 +22,6 @@
<strong><span data-bind="text: viewUser"></span></strong> <strong><span data-bind="text: viewUser"></span></strong>
</div> </div>
</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="control-group">
<div class="controls"> <div class="controls">
<a class="btn" data-bind="click: clearTwoFactor, visible: twoFactorStatus"> <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> <p class="muted i18n" style="width: 550px" data-i18n-text="SETTINGS_SECURITY/TWO_FACTOR_SECRET_DESC"></p>
</blockquote> </blockquote>
<!-- ko if: '' !== viewUrl() --> <!-- 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 --> <!-- /ko -->
</div> </div>
</div> </div>

View file

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

View file

@ -57,6 +57,7 @@ Options -Indexes
define('APP_API_PATH', 'http://api.rainloop.net/'); define('APP_API_PATH', 'http://api.rainloop.net/');
define('APP_REP_PATH', 'http://repository.rainloop.net/v1/'); define('APP_REP_PATH', 'http://repository.rainloop.net/v1/');
define('APP_REPO_CORE_FILE', 'http://repository.rainloop.net/v2/core.{{channel}}.json'); 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_PATH', 'rainloop/v/'.APP_VERSION.'/');
define('APP_WEB_STATIC_PATH', APP_WEB_PATH.'static/'); define('APP_WEB_STATIC_PATH', APP_WEB_PATH.'static/');
define('APP_DATA_FOLDER_PATH_UNIX', str_replace('\\', '/', APP_DATA_FOLDER_PATH)); 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-box-shadow: 0px 2px 10px rgba(0,0,0,0.2);
@login-border: none; @login-border: none;
@login-border-radius: 7px; @login-border-radius: 7px;
@powered-color: #ddd; @powered-color: #fff;
@languages-color: #ddd; @languages-color: #fff;
// MENU // MENU
@dropdown-menu-color: #333; @dropdown-menu-color: #333;

File diff suppressed because one or more lines are too long