mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Sound notification
Additional code refactoring
This commit is contained in:
parent
b42ce01e7e
commit
aa84077ac4
87 changed files with 1573 additions and 574 deletions
|
|
@ -314,6 +314,10 @@
|
|||
});
|
||||
|
||||
ssm.ready();
|
||||
|
||||
require('Stores/Language').populate();
|
||||
require('Stores/Theme').populate();
|
||||
require('Stores/Social').populate();
|
||||
};
|
||||
|
||||
module.exports = AbstractApp;
|
||||
|
|
|
|||
115
dev/App/Admin.js
115
dev/App/Admin.js
|
|
@ -15,7 +15,11 @@
|
|||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
DomainStore = require('Stores/Admin/Domain'),
|
||||
PluginStore = require('Stores/Admin/Plugin'),
|
||||
LicenseStore = require('Stores/Admin/License'),
|
||||
PackageStore = require('Stores/Admin/Package'),
|
||||
CoreStore = require('Stores/Admin/Core'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
|
@ -38,17 +42,12 @@
|
|||
return Remote;
|
||||
};
|
||||
|
||||
AdminApp.prototype.data = function ()
|
||||
{
|
||||
return Data;
|
||||
};
|
||||
|
||||
AdminApp.prototype.reloadDomainList = function ()
|
||||
{
|
||||
Data.domains.loading(true);
|
||||
DomainStore.collection.loading(true);
|
||||
|
||||
Remote.domainList(function (sResult, oData) {
|
||||
Data.domains.loading(false);
|
||||
DomainStore.collection.loading(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
var aList = _.map(oData.Result, function (bEnabled, sName) {
|
||||
|
|
@ -59,17 +58,18 @@
|
|||
};
|
||||
}, this);
|
||||
|
||||
Data.domains(aList);
|
||||
DomainStore.collection(aList);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
AdminApp.prototype.reloadPluginList = function ()
|
||||
{
|
||||
Data.plugins.loading(true);
|
||||
PluginStore.collection.loading(true);
|
||||
|
||||
Remote.pluginList(function (sResult, oData) {
|
||||
|
||||
Data.plugins.loading(false);
|
||||
PluginStore.collection.loading(false);
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
|
|
@ -81,31 +81,31 @@
|
|||
};
|
||||
}, this);
|
||||
|
||||
Data.plugins(aList);
|
||||
PluginStore.collection(aList);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
AdminApp.prototype.reloadPackagesList = function ()
|
||||
{
|
||||
Data.packages.loading(true);
|
||||
Data.packagesReal(true);
|
||||
PackageStore.collection.loading(true);
|
||||
PackageStore.packagesReal(true);
|
||||
|
||||
Remote.packagesList(function (sResult, oData) {
|
||||
|
||||
Data.packages.loading(false);
|
||||
PackageStore.collection.loading(false);
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
Data.packagesReal(!!oData.Result.Real);
|
||||
Data.packagesMainUpdatable(!!oData.Result.MainUpdatable);
|
||||
PackageStore.packagesReal(!!oData.Result.Real);
|
||||
PackageStore.packagesMainUpdatable(!!oData.Result.MainUpdatable);
|
||||
|
||||
var
|
||||
aList = [],
|
||||
aLoading = {}
|
||||
;
|
||||
|
||||
_.each(Data.packages(), function (oItem) {
|
||||
_.each(PackageStore.collection(), function (oItem) {
|
||||
if (oItem && oItem['loading']())
|
||||
{
|
||||
aLoading[oItem['file']] = oItem;
|
||||
|
|
@ -124,33 +124,33 @@
|
|||
}));
|
||||
}
|
||||
|
||||
Data.packages(aList);
|
||||
PackageStore.collection(aList);
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.packagesReal(false);
|
||||
PackageStore.packagesReal(false);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
AdminApp.prototype.updateCoreData = function ()
|
||||
{
|
||||
Data.coreUpdating(true);
|
||||
CoreStore.coreUpdating(true);
|
||||
Remote.updateCoreData(function (sResult, oData) {
|
||||
|
||||
Data.coreUpdating(false);
|
||||
Data.coreRemoteVersion('');
|
||||
Data.coreRemoteRelease('');
|
||||
Data.coreVersionCompare(-2);
|
||||
CoreStore.coreUpdating(false);
|
||||
CoreStore.coreRemoteVersion('');
|
||||
CoreStore.coreRemoteRelease('');
|
||||
CoreStore.coreVersionCompare(-2);
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
Data.coreReal(true);
|
||||
CoreStore.coreReal(true);
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.coreReal(false);
|
||||
CoreStore.coreReal(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -158,32 +158,32 @@
|
|||
|
||||
AdminApp.prototype.reloadCoreData = function ()
|
||||
{
|
||||
Data.coreChecking(true);
|
||||
Data.coreReal(true);
|
||||
CoreStore.coreChecking(true);
|
||||
CoreStore.coreReal(true);
|
||||
|
||||
Remote.coreData(function (sResult, oData) {
|
||||
|
||||
Data.coreChecking(false);
|
||||
CoreStore.coreChecking(false);
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
Data.coreReal(!!oData.Result.Real);
|
||||
Data.coreChannel(oData.Result.Channel || 'stable');
|
||||
Data.coreType(oData.Result.Type || 'stable');
|
||||
Data.coreUpdatable(!!oData.Result.Updatable);
|
||||
Data.coreAccess(!!oData.Result.Access);
|
||||
Data.coreRemoteVersion(oData.Result.RemoteVersion || '');
|
||||
Data.coreRemoteRelease(oData.Result.RemoteRelease || '');
|
||||
Data.coreVersionCompare(Utils.pInt(oData.Result.VersionCompare));
|
||||
CoreStore.coreReal(!!oData.Result.Real);
|
||||
CoreStore.coreChannel(oData.Result.Channel || 'stable');
|
||||
CoreStore.coreType(oData.Result.Type || 'stable');
|
||||
CoreStore.coreUpdatable(!!oData.Result.Updatable);
|
||||
CoreStore.coreAccess(!!oData.Result.Access);
|
||||
CoreStore.coreRemoteVersion(oData.Result.RemoteVersion || '');
|
||||
CoreStore.coreRemoteRelease(oData.Result.RemoteRelease || '');
|
||||
CoreStore.coreVersionCompare(Utils.pInt(oData.Result.VersionCompare));
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.coreReal(false);
|
||||
Data.coreChannel('stable');
|
||||
Data.coreType('stable');
|
||||
Data.coreRemoteVersion('');
|
||||
Data.coreRemoteRelease('');
|
||||
Data.coreVersionCompare(-2);
|
||||
CoreStore.coreReal(false);
|
||||
CoreStore.coreChannel('stable');
|
||||
CoreStore.coreType('stable');
|
||||
CoreStore.coreRemoteVersion('');
|
||||
CoreStore.coreRemoteRelease('');
|
||||
CoreStore.coreVersionCompare(-2);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -196,18 +196,18 @@
|
|||
{
|
||||
bForce = Utils.isUnd(bForce) ? false : !!bForce;
|
||||
|
||||
Data.licensingProcess(true);
|
||||
Data.licenseError('');
|
||||
LicenseStore.licensingProcess(true);
|
||||
LicenseStore.licenseError('');
|
||||
|
||||
Remote.licensing(function (sResult, oData) {
|
||||
Data.licensingProcess(false);
|
||||
LicenseStore.licensingProcess(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && Utils.isNormal(oData.Result['Expired']))
|
||||
{
|
||||
Data.licenseValid(true);
|
||||
Data.licenseExpired(Utils.pInt(oData.Result['Expired']));
|
||||
Data.licenseError('');
|
||||
LicenseStore.licenseValid(true);
|
||||
LicenseStore.licenseExpired(Utils.pInt(oData.Result['Expired']));
|
||||
LicenseStore.licenseError('');
|
||||
|
||||
Data.licensing(true);
|
||||
LicenseStore.licensing(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -216,19 +216,19 @@
|
|||
Enums.Notification.LicensingExpired
|
||||
]))
|
||||
{
|
||||
Data.licenseError(Translator.getNotification(Utils.pInt(oData.ErrorCode)));
|
||||
Data.licensing(true);
|
||||
LicenseStore.licenseError(Translator.getNotification(Utils.pInt(oData.ErrorCode)));
|
||||
LicenseStore.licensing(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Enums.StorageResultType.Abort === sResult)
|
||||
{
|
||||
Data.licenseError(Translator.getNotification(Enums.Notification.LicensingServerIsUnavailable));
|
||||
Data.licensing(true);
|
||||
LicenseStore.licenseError(Translator.getNotification(Enums.Notification.LicensingServerIsUnavailable));
|
||||
LicenseStore.licensing(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.licensing(false);
|
||||
LicenseStore.licensing(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -239,7 +239,8 @@
|
|||
{
|
||||
AbstractApp.prototype.bootstart.call(this);
|
||||
|
||||
Data.populateDataOnStart();
|
||||
require('Stores/Admin/App').populate();
|
||||
require('Stores/Admin/Capa').populate();
|
||||
|
||||
kn.hideLoading();
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
kn = require('Knoin/Knoin'),
|
||||
|
||||
SocialStore = require('Stores/Social'),
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Local = require('Storage/Local'),
|
||||
Local = require('Storage/Client'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/User/Data'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
|
@ -136,11 +136,6 @@
|
|||
return Remote;
|
||||
};
|
||||
|
||||
AppUser.prototype.data = function ()
|
||||
{
|
||||
return Data;
|
||||
};
|
||||
|
||||
AppUser.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function ()
|
||||
{
|
||||
_.each(Data.messageList(), function (oMessage) {
|
||||
|
|
@ -158,7 +153,7 @@
|
|||
{
|
||||
var
|
||||
self = this,
|
||||
iOffset = (Data.messageListPage() - 1) * UserSettingsStore.messagesPerPage()
|
||||
iOffset = (Data.messageListPage() - 1) * SettingsUserStore.messagesPerPage()
|
||||
;
|
||||
|
||||
if (Utils.isUnd(bDropCurrenFolderCache) ? false : !!bDropCurrenFolderCache)
|
||||
|
|
@ -195,12 +190,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
}, Data.currentFolderFullNameRaw(), iOffset, UserSettingsStore.messagesPerPage(), Data.messageListSearch());
|
||||
}, Data.currentFolderFullNameRaw(), iOffset, SettingsUserStore.messagesPerPage(), Data.messageListSearch());
|
||||
};
|
||||
|
||||
AppUser.prototype.recacheInboxMessageList = function ()
|
||||
{
|
||||
Remote.messageList(Utils.emptyFunction, Cache.getFolderInboxName(), 0, UserSettingsStore.messagesPerPage(), '', true);
|
||||
Remote.messageList(Utils.emptyFunction, Cache.getFolderInboxName(), 0, SettingsUserStore.messagesPerPage(), '', true);
|
||||
};
|
||||
|
||||
AppUser.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||
|
|
@ -585,7 +580,7 @@
|
|||
Utils.isArray(oData.Result) && 1 < oData.Result.length &&
|
||||
Utils.isPosNumeric(oData.Result[0], true) && Utils.isPosNumeric(oData.Result[1], true))
|
||||
{
|
||||
require('Stores/Quota').populateData(
|
||||
require('Stores/User/Quota').populateData(
|
||||
Utils.pInt(oData.Result[1]), Utils.pInt(oData.Result[0]));
|
||||
}
|
||||
});
|
||||
|
|
@ -999,7 +994,7 @@
|
|||
|
||||
Data.messageListCount(iCount);
|
||||
Data.messageListSearch(Utils.isNormal(oData.Result.Search) ? oData.Result.Search : '');
|
||||
Data.messageListPage(window.Math.ceil((iOffset / UserSettingsStore.messagesPerPage()) + 1));
|
||||
Data.messageListPage(window.Math.ceil((iOffset / SettingsUserStore.messagesPerPage()) + 1));
|
||||
Data.messageListEndFolder(Utils.isNormal(oData.Result.Folder) ? oData.Result.Folder : '');
|
||||
Data.messageListEndSearch(Utils.isNormal(oData.Result.Search) ? oData.Result.Search : '');
|
||||
Data.messageListEndPage(Data.messageListPage());
|
||||
|
|
@ -1014,7 +1009,7 @@
|
|||
|
||||
Cache.clearNewMessageCache();
|
||||
|
||||
if (oFolder && (bCached || bUnreadCountChange || Data.useThreads()))
|
||||
if (oFolder && (bCached || bUnreadCountChange || SettingsUserStore.useThreads()))
|
||||
{
|
||||
this.folderInformation(oFolder.fullNameRaw, aList);
|
||||
}
|
||||
|
|
@ -1384,6 +1379,10 @@
|
|||
{
|
||||
AbstractApp.prototype.bootstart.call(this);
|
||||
|
||||
require('Stores/User/App').populate();
|
||||
require('Stores/User/Settings').populate();
|
||||
require('Stores/User/Notification').populate();
|
||||
|
||||
Data.populateDataOnStart();
|
||||
|
||||
var
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function CookieLocalDriver()
|
||||
function CookieDriver()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* @static
|
||||
* @return {boolean}
|
||||
*/
|
||||
CookieLocalDriver.supported = function ()
|
||||
CookieDriver.supported = function ()
|
||||
{
|
||||
return !!(window.navigator && window.navigator.cookieEnabled);
|
||||
};
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
* @param {*} mData
|
||||
* @return {boolean}
|
||||
*/
|
||||
CookieLocalDriver.prototype.set = function (sKey, mData)
|
||||
CookieDriver.prototype.set = function (sKey, mData)
|
||||
{
|
||||
var
|
||||
mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName),
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
* @param {string} sKey
|
||||
* @return {*}
|
||||
*/
|
||||
CookieLocalDriver.prototype.get = function (sKey)
|
||||
CookieDriver.prototype.get = function (sKey)
|
||||
{
|
||||
var
|
||||
mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName),
|
||||
|
|
@ -94,6 +94,6 @@
|
|||
return mResult;
|
||||
};
|
||||
|
||||
module.exports = CookieLocalDriver;
|
||||
module.exports = CookieDriver;
|
||||
|
||||
}());
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function LocalStorageLocalDriver()
|
||||
function LocalStorageDriver()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* @static
|
||||
* @return {boolean}
|
||||
*/
|
||||
LocalStorageLocalDriver.supported = function ()
|
||||
LocalStorageDriver.supported = function ()
|
||||
{
|
||||
return !!window.localStorage;
|
||||
};
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
* @param {*} mData
|
||||
* @return {boolean}
|
||||
*/
|
||||
LocalStorageLocalDriver.prototype.set = function (sKey, mData)
|
||||
LocalStorageDriver.prototype.set = function (sKey, mData)
|
||||
{
|
||||
var
|
||||
mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null,
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
* @param {string} sKey
|
||||
* @return {*}
|
||||
*/
|
||||
LocalStorageLocalDriver.prototype.get = function (sKey)
|
||||
LocalStorageDriver.prototype.get = function (sKey)
|
||||
{
|
||||
var
|
||||
mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null,
|
||||
|
|
@ -92,6 +92,6 @@
|
|||
return mResult;
|
||||
};
|
||||
|
||||
module.exports = LocalStorageLocalDriver;
|
||||
module.exports = LocalStorageDriver;
|
||||
|
||||
}());
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
return sValue;
|
||||
};
|
||||
|
||||
Utils.rsaEncode.supported = !!(window.crypto && window.crypto.getRandomValues && JSEncrypt);
|
||||
Utils.rsaEncode.supported = !!(window.crypto && window.crypto.getRandomValues && false && JSEncrypt);
|
||||
|
||||
/**
|
||||
* @param {string} sText
|
||||
|
|
@ -623,52 +623,6 @@
|
|||
return fResult;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} oData
|
||||
*/
|
||||
Utils.initDataConstructorBySettings = function (oData)
|
||||
{
|
||||
oData.showImages = ko.observable(false);
|
||||
oData.contactsAutosave = ko.observable(false);
|
||||
oData.interfaceAnimation = ko.observable(true);
|
||||
|
||||
oData.capaThemes = ko.observable(true);
|
||||
oData.capaUserBackground = ko.observable(false);
|
||||
oData.allowLanguagesOnSettings = ko.observable(true);
|
||||
oData.allowLanguagesOnLogin = ko.observable(true);
|
||||
|
||||
oData.useLocalProxyForExternalImages = ko.observable(false);
|
||||
|
||||
oData.useThreads = ko.observable(true);
|
||||
oData.replySameFolder = ko.observable(true);
|
||||
oData.useCheckboxesInList = ko.observable(true);
|
||||
|
||||
oData.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');
|
||||
}
|
||||
});
|
||||
|
||||
oData.interfaceAnimation.valueHasMutated();
|
||||
|
||||
oData.capaAdditionalAccounts = ko.observable(false);
|
||||
oData.capaAdditionalIdentities = ko.observable(false);
|
||||
oData.capaGravatar = ko.observable(false);
|
||||
oData.capaSieve = ko.observable(false);
|
||||
oData.capaAttachmentThumbnails = ko.observable(false);
|
||||
oData.determineUserLanguage = ko.observable(false);
|
||||
oData.determineUserDomain = ko.observable(false);
|
||||
|
||||
oData.weakPassword = ko.observable(false);
|
||||
|
||||
oData.contactsIsAllowed = ko.observable(false);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{moment:Function}} oObject
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
Events = require('Common/Events'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
{
|
||||
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
||||
{
|
||||
if (Enums.Layout.NoPreview === UserSettingsStore.layout() && !Data.message())
|
||||
if (Enums.Layout.NoPreview === SettingsUserStore.layout() && !Data.message())
|
||||
{
|
||||
require('App/User').historyBack();
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
.messageListSearch(sSearch)
|
||||
;
|
||||
|
||||
if (Enums.Layout.NoPreview === UserSettingsStore.layout() && Data.message())
|
||||
if (Enums.Layout.NoPreview === SettingsUserStore.layout() && Data.message())
|
||||
{
|
||||
Data.message(null);
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
Data.messageList.subscribe(Utils.windowResizeCallback);
|
||||
Data.message.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
UserSettingsStore.layout.subscribe(function (nValue) {
|
||||
SettingsUserStore.layout.subscribe(function (nValue) {
|
||||
|
||||
Globals.$html.toggleClass('rl-no-preview-pane', Enums.Layout.NoPreview === nValue);
|
||||
Globals.$html.toggleClass('rl-side-preview-pane', Enums.Layout.SidePreview === nValue);
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
Events.pub('layout', [nValue]);
|
||||
});
|
||||
|
||||
UserSettingsStore.layout.valueHasMutated();
|
||||
SettingsUserStore.layout.valueHasMutated();
|
||||
|
||||
Events.sub('mailbox.inbox-unread-count', function (nCount) {
|
||||
Data.foldersInboxUnreadCount(nCount);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
AppStore = require('Stores/User/App'),
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
|
@ -46,7 +47,7 @@
|
|||
kn.addSettingsViewModel(require('Settings/User/General'),
|
||||
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
|
||||
if (Settings.settingsGet('ContactsIsAllowed'))
|
||||
if (AppStore.contactsIsAllowed())
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Contacts'),
|
||||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@
|
|||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
ko = require('ko'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
CoreStore = require('Stores/Admin/Core')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -12,25 +15,20 @@
|
|||
*/
|
||||
function AboutAdminSettings()
|
||||
{
|
||||
var
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
this.version = ko.observable(Settings.settingsGet('Version'));
|
||||
this.access = ko.observable(!!Settings.settingsGet('CoreAccess'));
|
||||
this.errorDesc = ko.observable('');
|
||||
|
||||
this.coreReal = Data.coreReal;
|
||||
this.coreChannel = Data.coreChannel;
|
||||
this.coreType = Data.coreType;
|
||||
this.coreUpdatable = Data.coreUpdatable;
|
||||
this.coreAccess = Data.coreAccess;
|
||||
this.coreChecking = Data.coreChecking;
|
||||
this.coreUpdating = Data.coreUpdating;
|
||||
this.coreRemoteVersion = Data.coreRemoteVersion;
|
||||
this.coreRemoteRelease = Data.coreRemoteRelease;
|
||||
this.coreVersionCompare = Data.coreVersionCompare;
|
||||
this.coreReal = CoreStore.coreReal;
|
||||
this.coreChannel = CoreStore.coreChannel;
|
||||
this.coreType = CoreStore.coreType;
|
||||
this.coreUpdatable = CoreStore.coreUpdatable;
|
||||
this.coreAccess = CoreStore.coreAccess;
|
||||
this.coreChecking = CoreStore.coreChecking;
|
||||
this.coreUpdating = CoreStore.coreUpdating;
|
||||
this.coreRemoteVersion = CoreStore.coreRemoteVersion;
|
||||
this.coreRemoteRelease = CoreStore.coreRemoteRelease;
|
||||
this.coreVersionCompare = CoreStore.coreVersionCompare;
|
||||
|
||||
this.statusType = ko.computed(function () {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
PopupsDomainViewModel = require('View/Popup/Domain'),
|
||||
|
||||
Data = require('Storage/Admin/Data'),
|
||||
DomainStore = require('Stores/Admin/Domain'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
|
|
@ -21,12 +21,12 @@
|
|||
*/
|
||||
function DomainsAdminSettings()
|
||||
{
|
||||
this.domains = Data.domains;
|
||||
this.domains = DomainStore.collection;
|
||||
|
||||
this.iDomainForDeletionTimeout = 0;
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return Data.domains.loading() ? 'visible' : 'hidden';
|
||||
return this.domains.loading() ? 'visible' : 'hidden';
|
||||
}, this);
|
||||
|
||||
this.domainForDeletion = ko.observable(null).extend({'toggleSubscribe': [this,
|
||||
|
|
|
|||
|
|
@ -11,10 +11,12 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
ThemeStore = require('Stores/Theme'),
|
||||
LanguageStore = require('Stores/Language'),
|
||||
AppAdminStore = require('Stores/Admin/App'),
|
||||
CapaAdminStore = require('Stores/Admin/Capa'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -22,20 +24,20 @@
|
|||
*/
|
||||
function GeneralAdminSettings()
|
||||
{
|
||||
this.language = UserSettingsStore.language;
|
||||
this.languages = UserSettingsStore.languages;
|
||||
this.theme = UserSettingsStore.theme;
|
||||
this.themes = UserSettingsStore.themes;
|
||||
this.language = LanguageStore.language;
|
||||
this.languages = LanguageStore.languages;
|
||||
this.theme = ThemeStore.theme;
|
||||
this.themes = ThemeStore.themes;
|
||||
|
||||
this.capaThemes = Data.capaThemes;
|
||||
this.capaUserBackground = Data.capaUserBackground;
|
||||
this.allowLanguagesOnSettings = Data.allowLanguagesOnSettings;
|
||||
this.capaGravatar = Data.capaGravatar;
|
||||
this.capaAdditionalAccounts = Data.capaAdditionalAccounts;
|
||||
this.capaAdditionalIdentities = Data.capaAdditionalIdentities;
|
||||
this.capaAttachmentThumbnails = Data.capaAttachmentThumbnails;
|
||||
this.capaThemes = CapaAdminStore.themes;
|
||||
this.capaUserBackground = CapaAdminStore.userBackground;
|
||||
this.capaGravatar = CapaAdminStore.gravatar;
|
||||
this.capaAdditionalAccounts = CapaAdminStore.additionalAccounts;
|
||||
this.capaAdditionalIdentities = CapaAdminStore.additionalIdentities;
|
||||
this.capaAttachmentThumbnails = CapaAdminStore.attachmentThumbnails;
|
||||
|
||||
this.weakPassword = Data.weakPassword;
|
||||
this.allowLanguagesOnSettings = AppAdminStore.allowLanguagesOnSettings;
|
||||
this.weakPassword = AppAdminStore.weakPassword;
|
||||
|
||||
this.mainAttachmentLimit = ko.observable(Utils.pInt(Settings.settingsGet('AttachmentLimit')) / (1024 * 1024)).extend({'posInterer': 25});
|
||||
this.uploadData = Settings.settingsGet('PhpUploadSizes');
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
moment = require('moment'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
LicenseStore = require('Stores/Admin/License')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -16,12 +16,12 @@
|
|||
*/
|
||||
function LicensingAdminSettings()
|
||||
{
|
||||
this.licensing = Data.licensing;
|
||||
this.licensingProcess = Data.licensingProcess;
|
||||
this.licenseValid = Data.licenseValid;
|
||||
this.licenseExpired = Data.licenseExpired;
|
||||
this.licenseError = Data.licenseError;
|
||||
this.licenseTrigger = Data.licenseTrigger;
|
||||
this.licensing = LicenseStore.licensing;
|
||||
this.licensingProcess = LicenseStore.licensingProcess;
|
||||
this.licenseValid = LicenseStore.licenseValid;
|
||||
this.licenseExpired = LicenseStore.licenseExpired;
|
||||
this.licenseError = LicenseStore.licenseError;
|
||||
this.licenseTrigger = LicenseStore.licenseTrigger;
|
||||
|
||||
this.adminDomain = ko.observable('');
|
||||
this.subscriptionEnabled = ko.observable(!!Settings.settingsGet('SubscriptionEnabled'));
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
AppAdminStore = require('Stores/Admin/App'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -19,12 +20,12 @@
|
|||
*/
|
||||
function LoginAdminSettings()
|
||||
{
|
||||
this.determineUserLanguage = Data.determineUserLanguage;
|
||||
this.determineUserDomain = Data.determineUserDomain;
|
||||
this.determineUserLanguage = AppAdminStore.determineUserLanguage;
|
||||
this.determineUserDomain = AppAdminStore.determineUserDomain;
|
||||
|
||||
this.defaultDomain = ko.observable(Settings.settingsGet('LoginDefaultDomain'));
|
||||
|
||||
this.allowLanguagesOnLogin = Data.allowLanguagesOnLogin;
|
||||
this.allowLanguagesOnLogin = AppAdminStore.allowLanguagesOnLogin;
|
||||
this.defaultDomainTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
||||
this.dummy = ko.observable(false);
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@
|
|||
|
||||
var
|
||||
window = require('window'),
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Data = require('Storage/Admin/Data'),
|
||||
PackageStore = require('Stores/Admin/Package'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
|
|
@ -21,9 +22,9 @@
|
|||
{
|
||||
this.packagesError = ko.observable('');
|
||||
|
||||
this.packages = Data.packages;
|
||||
this.packagesReal = Data.packagesReal;
|
||||
this.packagesMainUpdatable = Data.packagesMainUpdatable;
|
||||
this.packages = PackageStore.collection;
|
||||
this.packagesReal = PackageStore.packagesReal;
|
||||
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
|
||||
|
||||
this.packagesCurrent = this.packages.filter(function (oItem) {
|
||||
return oItem && '' !== oItem['installed'] && !oItem['compare'];
|
||||
|
|
@ -38,7 +39,7 @@
|
|||
});
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return Data.packages.loading() ? 'visible' : 'hidden';
|
||||
return PackageStore.collection.loading() ? 'visible' : 'hidden';
|
||||
}, this);
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +71,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
_.each(Data.packages(), function (oItem) {
|
||||
_.each(self.packages(), function (oItem) {
|
||||
if (oItem && oPackage && oItem['loading']() && oPackage['file'] === oItem['file'])
|
||||
{
|
||||
oPackage['loading'](false);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
PluginStore = require('Stores/Admin/Plugin'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
|
|
@ -23,12 +23,11 @@
|
|||
{
|
||||
this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins'));
|
||||
|
||||
this.pluginsError = ko.observable('');
|
||||
|
||||
this.plugins = Data.plugins;
|
||||
this.plugins = PluginStore.collection;
|
||||
this.pluginsError = PluginStore.collection.error;
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return Data.plugins.loading() ? 'visible' : 'hidden';
|
||||
return PluginStore.collection.loading() ? 'visible' : 'hidden';
|
||||
}, this);
|
||||
|
||||
this.onPluginLoadRequest = _.bind(this.onPluginLoadRequest, this);
|
||||
|
|
@ -76,7 +75,7 @@
|
|||
|
||||
PluginsAdminSettings.prototype.onShow = function ()
|
||||
{
|
||||
this.pluginsError('');
|
||||
PluginStore.collection.error('');
|
||||
require('App/Admin').reloadPluginList();
|
||||
};
|
||||
|
||||
|
|
@ -96,11 +95,11 @@
|
|||
{
|
||||
if (Enums.Notification.UnsupportedPluginPackage === oData.ErrorCode && oData.ErrorMessage && '' !== oData.ErrorMessage)
|
||||
{
|
||||
this.pluginsError(oData.ErrorMessage);
|
||||
PluginStore.collection.error(oData.ErrorMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pluginsError(Translator.getNotification(oData.ErrorCode));
|
||||
PluginStore.collection.error(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
AppAdminStore = require('Stores/Admin/App'),
|
||||
CapaAdminStore = require('Stores/Admin/Capa'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
|
|
@ -21,12 +23,12 @@
|
|||
*/
|
||||
function SecurityAdminSettings()
|
||||
{
|
||||
this.useLocalProxyForExternalImages = Data.useLocalProxyForExternalImages;
|
||||
this.useLocalProxyForExternalImages = AppAdminStore.useLocalProxyForExternalImages;
|
||||
|
||||
this.weakPassword = Data.weakPassword;
|
||||
this.weakPassword = AppAdminStore.weakPassword;
|
||||
|
||||
this.capaOpenPGP = ko.observable(Settings.capa(Enums.Capa.OpenPGP));
|
||||
this.capaTwoFactorAuth = ko.observable(Settings.capa(Enums.Capa.TwoFactor));
|
||||
this.capaOpenPGP = CapaAdminStore.openPGP;
|
||||
this.capaTwoFactorAuth = CapaAdminStore.twoFactorAuth;
|
||||
|
||||
this.verifySslCertificate = ko.observable(!!Settings.settingsGet('VerifySslCertificate'));
|
||||
this.allowSelfSigned = ko.observable(!!Settings.settingsGet('AllowSelfSigned'));
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
var
|
||||
ko = require('ko'),
|
||||
|
||||
AppStore = require('Stores/User/App'),
|
||||
|
||||
Remote = require('Storage/User/Remote'),
|
||||
Data = require('Storage/User/Data')
|
||||
;
|
||||
|
|
@ -15,7 +17,7 @@
|
|||
*/
|
||||
function ContactsUserSettings()
|
||||
{
|
||||
this.contactsAutosave = Data.contactsAutosave;
|
||||
this.contactsAutosave = AppStore.contactsAutosave;
|
||||
|
||||
this.allowContactsSync = Data.allowContactsSync;
|
||||
this.enableContactsSync = Data.enableContactsSync;
|
||||
|
|
@ -35,7 +37,7 @@
|
|||
|
||||
ContactsUserSettings.prototype.onBuild = function ()
|
||||
{
|
||||
Data.contactsAutosave.subscribe(function (bValue) {
|
||||
this.contactsAutosave.subscribe(function (bValue) {
|
||||
Remote.saveSettings(null, {
|
||||
'ContactsAutosave': bValue ? '1' : '0'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
FilterStore = require('Stores/Filter'),
|
||||
FilterStore = require('Stores/User/Filter'),
|
||||
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
Data = require('Storage/User/Data'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
Local = require('Storage/Local')
|
||||
Local = require('Storage/Client')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
NotificationSettingsStore = require('Stores/NotificationSettings'),
|
||||
AppStore = require('Stores/User/App'),
|
||||
LanguageStore = require('Stores/Language'),
|
||||
SettingsStore = require('Stores/User/Settings'),
|
||||
NotificationStore = require('Stores/User/Notification'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
|
|
@ -25,25 +27,27 @@
|
|||
*/
|
||||
function GeneralUserSettings()
|
||||
{
|
||||
this.language = UserSettingsStore.language;
|
||||
this.messagesPerPage = UserSettingsStore.messagesPerPage;
|
||||
this.language = LanguageStore.language;
|
||||
this.messagesPerPage = SettingsStore.messagesPerPage;
|
||||
this.messagesPerPageArray = Consts.Defaults.MessagesPerPageArray;
|
||||
|
||||
this.editorDefaultType = UserSettingsStore.editorDefaultType;
|
||||
this.layout = UserSettingsStore.layout;
|
||||
this.usePreviewPane = UserSettingsStore.usePreviewPane;
|
||||
this.editorDefaultType = SettingsStore.editorDefaultType;
|
||||
this.layout = SettingsStore.layout;
|
||||
this.usePreviewPane = SettingsStore.usePreviewPane;
|
||||
|
||||
this.showImages = Data.showImages;
|
||||
this.soundNotificationIsSupported = NotificationStore.soundNotificationIsSupported;
|
||||
this.enableSoundNotification = NotificationStore.enableSoundNotification;
|
||||
|
||||
this.enableDesktopNotification = NotificationSettingsStore.enableDesktopNotification;
|
||||
this.isDesktopNotificationSupported = NotificationSettingsStore.isDesktopNotificationSupported;
|
||||
this.isDesktopNotificationDenied = NotificationSettingsStore.isDesktopNotificationDenied;
|
||||
this.enableDesktopNotification = NotificationStore.enableDesktopNotification;
|
||||
this.isDesktopNotificationSupported = NotificationStore.isDesktopNotificationSupported;
|
||||
this.isDesktopNotificationDenied = NotificationStore.isDesktopNotificationDenied;
|
||||
|
||||
this.showImages = SettingsStore.showImages;
|
||||
this.useCheckboxesInList = SettingsStore.useCheckboxesInList;
|
||||
this.threading = Data.threading;
|
||||
this.useThreads = Data.useThreads;
|
||||
this.replySameFolder = Data.replySameFolder;
|
||||
this.useCheckboxesInList = Data.useCheckboxesInList;
|
||||
this.allowLanguagesOnSettings = Data.allowLanguagesOnSettings;
|
||||
this.useThreads = SettingsStore.useThreads;
|
||||
this.replySameFolder = SettingsStore.replySameFolder;
|
||||
this.allowLanguagesOnSettings = AppStore.allowLanguagesOnSettings;
|
||||
|
||||
this.languageFullName = ko.computed(function () {
|
||||
return Utils.convertLangName(this.language());
|
||||
|
|
@ -77,6 +81,11 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
GeneralUserSettings.prototype.testSoundNotification = function ()
|
||||
{
|
||||
NotificationStore.playSoundNotification(true);
|
||||
};
|
||||
|
||||
GeneralUserSettings.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
|
@ -122,7 +131,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
Data.showImages.subscribe(function (bValue) {
|
||||
self.showImages.subscribe(function (bValue) {
|
||||
Remote.saveSettings(null, {
|
||||
'ShowImages': bValue ? '1' : '0'
|
||||
});
|
||||
|
|
@ -136,7 +145,15 @@
|
|||
}, 3000);
|
||||
});
|
||||
|
||||
Data.replySameFolder.subscribe(function (bValue) {
|
||||
self.enableSoundNotification.subscribe(function (bValue) {
|
||||
Utils.timeOutAction('SaveSoundNotification', function () {
|
||||
Remote.saveSettings(null, {
|
||||
'SoundNotification': bValue ? '1' : '0'
|
||||
});
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
self.replySameFolder.subscribe(function (bValue) {
|
||||
Utils.timeOutAction('SaveReplySameFolder', function () {
|
||||
Remote.saveSettings(null, {
|
||||
'ReplySameFolder': bValue ? '1' : '0'
|
||||
|
|
@ -144,7 +161,7 @@
|
|||
}, 3000);
|
||||
});
|
||||
|
||||
Data.useThreads.subscribe(function (bValue) {
|
||||
self.useThreads.subscribe(function (bValue) {
|
||||
|
||||
Data.messageList([]);
|
||||
|
||||
|
|
@ -162,7 +179,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
Data.useCheckboxesInList.subscribe(function (bValue) {
|
||||
self.useCheckboxesInList.subscribe(function (bValue) {
|
||||
Remote.saveSettings(null, {
|
||||
'UseCheckboxesInList': bValue ? '1' : '0'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
Links = require('Common/Links'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
ThemeStore = require('Stores/Theme'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
|
|
@ -25,18 +25,18 @@
|
|||
*/
|
||||
function ThemesUserSettings()
|
||||
{
|
||||
this.theme = UserSettingsStore.theme;
|
||||
this.themes = UserSettingsStore.themes;
|
||||
this.theme = ThemeStore.theme;
|
||||
this.themes = ThemeStore.themes;
|
||||
this.themesObjects = ko.observableArray([]);
|
||||
|
||||
this.background = {};
|
||||
this.background.name = UserSettingsStore.themeBackgroundName;
|
||||
this.background.hash = UserSettingsStore.themeBackgroundHash;
|
||||
this.background.name = ThemeStore.themeBackgroundName;
|
||||
this.background.hash = ThemeStore.themeBackgroundHash;
|
||||
this.background.uploaderButton = ko.observable(null);
|
||||
this.background.loading = ko.observable(false);
|
||||
this.background.error = ko.observable('');
|
||||
|
||||
this.capaUserBackground = Data.capaUserBackground;
|
||||
this.capaUserBackground = ko.observable(Settings.capa(Enums.Capa.UserBackground));
|
||||
|
||||
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle).extend({'throttle': 100});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AbstractDataStorate()
|
||||
{
|
||||
Utils.initDataConstructorBySettings(this);
|
||||
}
|
||||
|
||||
AbstractDataStorate.prototype.populateDataOnStart = function()
|
||||
{
|
||||
this.capaAdditionalAccounts(Settings.capa(Enums.Capa.AdditionalAccounts));
|
||||
this.capaAdditionalIdentities(Settings.capa(Enums.Capa.AdditionalIdentities));
|
||||
this.capaGravatar(Settings.capa(Enums.Capa.Gravatar));
|
||||
this.capaAttachmentThumbnails(Settings.capa(Enums.Capa.AttachmentThumbnails));
|
||||
this.capaSieve(Settings.capa(Enums.Capa.Sieve));
|
||||
this.determineUserLanguage(!!Settings.settingsGet('DetermineUserLanguage'));
|
||||
this.determineUserDomain(!!Settings.settingsGet('DetermineUserDomain'));
|
||||
|
||||
this.weakPassword(!!Settings.settingsGet('WeakPassword'));
|
||||
|
||||
this.capaThemes(Settings.capa(Enums.Capa.Themes));
|
||||
this.capaUserBackground(Settings.capa(Enums.Capa.UserBackground));
|
||||
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
||||
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.showImages(!!Settings.settingsGet('ShowImages'));
|
||||
this.contactsAutosave(!!Settings.settingsGet('ContactsAutosave'));
|
||||
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
||||
|
||||
this.useThreads(!!Settings.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!Settings.settingsGet('ReplySameFolder'));
|
||||
this.useCheckboxesInList(!!Settings.settingsGet('UseCheckboxesInList'));
|
||||
|
||||
require('Stores/Social').populate();
|
||||
require('Stores/UserSettings').populate();
|
||||
require('Stores/NotificationSettings').populate();
|
||||
|
||||
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
||||
};
|
||||
|
||||
module.exports = AbstractDataStorate;
|
||||
|
||||
}());
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
AbstractData = require('Storage/AbstractData')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractData
|
||||
*/
|
||||
function DataAdminStorage()
|
||||
{
|
||||
AbstractData.call(this);
|
||||
|
||||
this.domains = ko.observableArray([]);
|
||||
this.domains.loading = ko.observable(false).extend({'throttle': 100});
|
||||
|
||||
this.plugins = ko.observableArray([]);
|
||||
this.plugins.loading = ko.observable(false).extend({'throttle': 100});
|
||||
|
||||
this.packagesReal = ko.observable(true);
|
||||
this.packagesMainUpdatable = ko.observable(true);
|
||||
this.packages = ko.observableArray([]);
|
||||
this.packages.loading = ko.observable(false).extend({'throttle': 100});
|
||||
|
||||
this.coreReal = ko.observable(true);
|
||||
this.coreChannel = ko.observable('stable');
|
||||
this.coreType = ko.observable('stable');
|
||||
this.coreUpdatable = ko.observable(true);
|
||||
this.coreAccess = ko.observable(true);
|
||||
this.coreChecking = ko.observable(false).extend({'throttle': 100});
|
||||
this.coreUpdating = ko.observable(false).extend({'throttle': 100});
|
||||
this.coreRemoteVersion = ko.observable('');
|
||||
this.coreRemoteRelease = ko.observable('');
|
||||
this.coreVersionCompare = ko.observable(-2);
|
||||
|
||||
this.licensing = ko.observable(false);
|
||||
this.licensingProcess = ko.observable(false);
|
||||
this.licenseValid = ko.observable(false);
|
||||
this.licenseExpired = ko.observable(0);
|
||||
this.licenseError = ko.observable('');
|
||||
|
||||
this.licenseTrigger = ko.observable(false);
|
||||
|
||||
this.adminManLoading = ko.computed(function () {
|
||||
return '000' !== [this.domains.loading() ? '1' : '0', this.plugins.loading() ? '1' : '0', this.packages.loading() ? '1' : '0'].join('');
|
||||
}, this);
|
||||
|
||||
this.adminManLoadingVisibility = ko.computed(function () {
|
||||
return this.adminManLoading() ? 'visible' : 'hidden';
|
||||
}, this).extend({'rateLimit': 300});
|
||||
}
|
||||
|
||||
_.extend(DataAdminStorage.prototype, AbstractData.prototype);
|
||||
|
||||
DataAdminStorage.prototype.populateDataOnStart = function()
|
||||
{
|
||||
AbstractData.prototype.populateDataOnStart.call(this);
|
||||
};
|
||||
|
||||
module.exports = new DataAdminStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -6,12 +6,12 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function LocalStorage()
|
||||
function ClientStorage()
|
||||
{
|
||||
var
|
||||
NextStorageDriver = require('_').find([
|
||||
require('Storage/LocalDriver/LocalStorage'),
|
||||
require('Storage/LocalDriver/Cookie')
|
||||
require('Common/ClientStorageDriver/LocalStorage'),
|
||||
require('Common/ClientStorageDriver/Cookie')
|
||||
], function (NextStorageDriver) {
|
||||
return NextStorageDriver && NextStorageDriver.supported();
|
||||
})
|
||||
|
|
@ -28,14 +28,14 @@
|
|||
/**
|
||||
* @type {LocalStorageDriver|CookieDriver|null}
|
||||
*/
|
||||
LocalStorage.prototype.oDriver = null;
|
||||
ClientStorage.prototype.oDriver = null;
|
||||
|
||||
/**
|
||||
* @param {number} iKey
|
||||
* @param {*} mData
|
||||
* @return {boolean}
|
||||
*/
|
||||
LocalStorage.prototype.set = function (iKey, mData)
|
||||
ClientStorage.prototype.set = function (iKey, mData)
|
||||
{
|
||||
return this.oDriver ? this.oDriver.set('p' + iKey, mData) : false;
|
||||
};
|
||||
|
|
@ -44,11 +44,11 @@
|
|||
* @param {number} iKey
|
||||
* @return {*}
|
||||
*/
|
||||
LocalStorage.prototype.get = function (iKey)
|
||||
ClientStorage.prototype.get = function (iKey)
|
||||
{
|
||||
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
|
||||
};
|
||||
|
||||
module.exports = new LocalStorage();
|
||||
module.exports = new ClientStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -17,6 +17,8 @@
|
|||
Links = require('Common/Links'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
||||
|
|
@ -24,18 +26,14 @@
|
|||
|
||||
MessageModel = require('Model/Message'),
|
||||
|
||||
Local = require('Storage/Local'),
|
||||
AbstractData = require('Storage/AbstractData')
|
||||
Local = require('Storage/Client')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractData
|
||||
*/
|
||||
function DataUserStorage()
|
||||
{
|
||||
AbstractData.call(this);
|
||||
|
||||
var
|
||||
fRemoveSystemFolderType = function (observable) {
|
||||
return function () {
|
||||
|
|
@ -272,7 +270,7 @@
|
|||
|
||||
this.messageListPageCount = ko.computed(function () {
|
||||
var iPage = window.Math.ceil(this.messageListCount() /
|
||||
require('Stores/UserSettings').messagesPerPage());
|
||||
SettingsUserStore.messagesPerPage());
|
||||
return 0 >= iPage ? 1 : iPage;
|
||||
}, this);
|
||||
|
||||
|
|
@ -328,13 +326,13 @@
|
|||
this.messageFullScreenMode(false);
|
||||
this.hideMessageBodies();
|
||||
|
||||
if (Enums.Layout.NoPreview === require('Stores/UserSettings').layout() &&
|
||||
if (Enums.Layout.NoPreview === SettingsUserStore.layout() &&
|
||||
-1 < window.location.hash.indexOf('message-preview'))
|
||||
{
|
||||
require('App/User').historyBack();
|
||||
}
|
||||
}
|
||||
else if (Enums.Layout.NoPreview === require('Stores/UserSettings').layout())
|
||||
else if (Enums.Layout.NoPreview === SettingsUserStore.layout())
|
||||
{
|
||||
this.message.focused(true);
|
||||
}
|
||||
|
|
@ -348,7 +346,7 @@
|
|||
}
|
||||
else if (Enums.KeyState.MessageView === Globals.keyScope())
|
||||
{
|
||||
if (Enums.Layout.NoPreview === require('Stores/UserSettings').layout() && this.message())
|
||||
if (Enums.Layout.NoPreview === SettingsUserStore.layout() && this.message())
|
||||
{
|
||||
Globals.keyScope(Enums.KeyState.MessageView);
|
||||
}
|
||||
|
|
@ -451,8 +449,6 @@
|
|||
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
|
||||
}
|
||||
|
||||
_.extend(DataUserStorage.prototype, AbstractData.prototype);
|
||||
|
||||
DataUserStorage.prototype.purgeMessageBodyCache = function()
|
||||
{
|
||||
var
|
||||
|
|
@ -487,8 +483,6 @@
|
|||
|
||||
DataUserStorage.prototype.populateDataOnStart = function()
|
||||
{
|
||||
AbstractData.prototype.populateDataOnStart.call(this);
|
||||
|
||||
this.accountEmail(Settings.settingsGet('Email'));
|
||||
this.accountIncLogin(Settings.settingsGet('IncLogin'));
|
||||
this.accountOutLogin(Settings.settingsGet('OutLogin'));
|
||||
|
|
@ -519,52 +513,18 @@
|
|||
var
|
||||
iIndex = 0,
|
||||
iLen = aNewMessages.length,
|
||||
fNotificationHelper = function (sImageSrc, sTitle, sText)
|
||||
{
|
||||
var
|
||||
NotificationSettingsStore = require('Stores/NotificationSettings'),
|
||||
NotificationClass = NotificationSettingsStore.notificationClass(),
|
||||
oNotification = null
|
||||
;
|
||||
|
||||
if (NotificationClass && NotificationSettingsStore.enableDesktopNotification())
|
||||
{
|
||||
oNotification = new NotificationClass(sTitle, {
|
||||
'body': sText,
|
||||
'icon': sImageSrc
|
||||
});
|
||||
|
||||
if (oNotification)
|
||||
{
|
||||
if (oNotification.show)
|
||||
{
|
||||
oNotification.show();
|
||||
}
|
||||
|
||||
window.setTimeout((function (oLocalNotifications) {
|
||||
return function () {
|
||||
if (oLocalNotifications.cancel)
|
||||
{
|
||||
oLocalNotifications.cancel();
|
||||
}
|
||||
else if (oLocalNotifications.close)
|
||||
{
|
||||
oLocalNotifications.close();
|
||||
}
|
||||
};
|
||||
}(oNotification)), 7000);
|
||||
}
|
||||
}
|
||||
}
|
||||
NotificationStore = require('Stores/User/Notification')
|
||||
;
|
||||
|
||||
_.each(aNewMessages, function (oItem) {
|
||||
Cache.addNewMessageCache(sFolder, oItem.Uid);
|
||||
});
|
||||
|
||||
NotificationStore.playSoundNotification();
|
||||
|
||||
if (3 < iLen)
|
||||
{
|
||||
fNotificationHelper(
|
||||
NotificationStore.displayDesktopNotification(
|
||||
Links.notificationMailIcon(),
|
||||
this.accountEmail(),
|
||||
Translator.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', {
|
||||
|
|
@ -576,7 +536,7 @@
|
|||
{
|
||||
for (; iIndex < iLen; iIndex++)
|
||||
{
|
||||
fNotificationHelper(
|
||||
NotificationStore.displayDesktopNotification(
|
||||
Links.notificationMailIcon(),
|
||||
MessageModel.emailsToLine(MessageModel.initEmailsFromJson(aNewMessages[iIndex].From), false),
|
||||
aNewMessages[iIndex].Subject
|
||||
|
|
@ -907,7 +867,7 @@
|
|||
oMessage.showInternalImages(true);
|
||||
}
|
||||
|
||||
if (oMessage.hasImages() && this.showImages())
|
||||
if (oMessage.hasImages() && SettingsUserStore.showImages())
|
||||
{
|
||||
oMessage.showExternalImages(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
Consts = require('Common/Consts'),
|
||||
Base64 = require('Common/Base64'),
|
||||
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -285,7 +287,7 @@
|
|||
Data.projectHash(),
|
||||
sFolderHash,
|
||||
Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
|
||||
Data.threading() && Data.useThreads() ? '1' : '0',
|
||||
Data.threading() && SettingsUserStore.useThreads() ? '1' : '0',
|
||||
Data.threading() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
|
||||
].join(String.fromCharCode(0))), bSilent ? [] : ['MessageList']);
|
||||
}
|
||||
|
|
@ -297,7 +299,7 @@
|
|||
'Limit': iLimit,
|
||||
'Search': sSearch,
|
||||
'UidNext': Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
|
||||
'UseThreads': Data.threading() && Data.useThreads() ? '1' : '0',
|
||||
'UseThreads': Data.threading() && SettingsUserStore.useThreads() ? '1' : '0',
|
||||
'ExpandedThreadUid': Data.threading() && sFolderFullNameRaw === Data.messageListThreadFolder() ? Data.messageListThreadUids().join(',') : ''
|
||||
}, '' === sSearch ? Consts.Defaults.DefaultAjaxTimeout : Consts.Defaults.SearchAjaxTimeout, '', bSilent ? [] : ['MessageList']);
|
||||
}
|
||||
|
|
@ -332,7 +334,7 @@
|
|||
sFolderFullNameRaw,
|
||||
iUid,
|
||||
Data.projectHash(),
|
||||
Data.threading() && Data.useThreads() ? '1' : '0'
|
||||
Data.threading() && SettingsUserStore.useThreads() ? '1' : '0'
|
||||
].join(String.fromCharCode(0))), ['Message']);
|
||||
|
||||
return true;
|
||||
|
|
@ -411,7 +413,7 @@
|
|||
'UidNext': Cache.getFolderInboxName() === sFolder ? Cache.getFolderUidNext(sFolder) : ''
|
||||
});
|
||||
}
|
||||
else if (Data.useThreads())
|
||||
else if (SettingsUserStore.useThreads())
|
||||
{
|
||||
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
|
|
|
|||
43
dev/Stores/Admin/App.js
Normal file
43
dev/Stores/Admin/App.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AppAdminStore()
|
||||
{
|
||||
// same
|
||||
this.allowLanguagesOnSettings = ko.observable(true);
|
||||
this.allowLanguagesOnLogin = ko.observable(true);
|
||||
// ----
|
||||
|
||||
this.determineUserLanguage = ko.observable(false);
|
||||
this.determineUserDomain = ko.observable(false);
|
||||
|
||||
this.weakPassword = ko.observable(false);
|
||||
this.useLocalProxyForExternalImages = ko.observable(false);
|
||||
}
|
||||
|
||||
AppAdminStore.prototype.populate = function()
|
||||
{
|
||||
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
||||
|
||||
this.determineUserLanguage(!!Settings.settingsGet('DetermineUserLanguage'));
|
||||
this.determineUserDomain(!!Settings.settingsGet('DetermineUserDomain'));
|
||||
|
||||
this.weakPassword(!!Settings.settingsGet('WeakPassword'));
|
||||
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
||||
};
|
||||
|
||||
module.exports = new AppAdminStore();
|
||||
|
||||
}());
|
||||
45
dev/Stores/Admin/Capa.js
Normal file
45
dev/Stores/Admin/Capa.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function CapaAdminStore()
|
||||
{
|
||||
this.additionalAccounts = ko.observable(false);
|
||||
this.additionalIdentities = ko.observable(false);
|
||||
this.gravatar = ko.observable(false);
|
||||
this.attachmentThumbnails = ko.observable(false);
|
||||
this.sieve = ko.observable(false);
|
||||
this.themes = ko.observable(true);
|
||||
this.userBackground = ko.observable(false);
|
||||
this.openPGP = ko.observable(false);
|
||||
this.twoFactorAuth = ko.observable(false);
|
||||
}
|
||||
|
||||
CapaAdminStore.prototype.populate = function()
|
||||
{
|
||||
this.additionalAccounts(Settings.capa(Enums.Capa.AdditionalAccounts));
|
||||
this.additionalIdentities(Settings.capa(Enums.Capa.AdditionalIdentities));
|
||||
this.gravatar(Settings.capa(Enums.Capa.Gravatar));
|
||||
this.attachmentThumbnails(Settings.capa(Enums.Capa.AttachmentThumbnails));
|
||||
this.sieve(Settings.capa(Enums.Capa.Sieve));
|
||||
this.themes(Settings.capa(Enums.Capa.Themes));
|
||||
this.userBackground(Settings.capa(Enums.Capa.UserBackground));
|
||||
this.openPGP(Settings.capa(Enums.Capa.OpenPGP));
|
||||
this.twoFactorAuth(Settings.capa(Enums.Capa.TwoFactor));
|
||||
};
|
||||
|
||||
module.exports = new CapaAdminStore();
|
||||
|
||||
}());
|
||||
29
dev/Stores/Admin/Core.js
Normal file
29
dev/Stores/Admin/Core.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function CoreAdminStore()
|
||||
{
|
||||
this.coreReal = ko.observable(true);
|
||||
this.coreChannel = ko.observable('stable');
|
||||
this.coreType = ko.observable('stable');
|
||||
this.coreUpdatable = ko.observable(true);
|
||||
this.coreAccess = ko.observable(true);
|
||||
this.coreChecking = ko.observable(false).extend({'throttle': 100});
|
||||
this.coreUpdating = ko.observable(false).extend({'throttle': 100});
|
||||
this.coreRemoteVersion = ko.observable('');
|
||||
this.coreRemoteRelease = ko.observable('');
|
||||
this.coreVersionCompare = ko.observable(-2);
|
||||
}
|
||||
|
||||
module.exports = new CoreAdminStore();
|
||||
|
||||
}());
|
||||
21
dev/Stores/Admin/Domain.js
Normal file
21
dev/Stores/Admin/Domain.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function DomainAdminStore()
|
||||
{
|
||||
this.collection = ko.observableArray([]);
|
||||
this.collection.loading = ko.observable(false).extend({'throttle': 100});
|
||||
}
|
||||
|
||||
module.exports = new DomainAdminStore();
|
||||
|
||||
}());
|
||||
26
dev/Stores/Admin/License.js
Normal file
26
dev/Stores/Admin/License.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function LicenseAdminStore()
|
||||
{
|
||||
this.licensing = ko.observable(false);
|
||||
this.licensingProcess = ko.observable(false);
|
||||
this.licenseValid = ko.observable(false);
|
||||
this.licenseExpired = ko.observable(0);
|
||||
this.licenseError = ko.observable('');
|
||||
|
||||
this.licenseTrigger = ko.observable(false);
|
||||
}
|
||||
|
||||
module.exports = new LicenseAdminStore();
|
||||
|
||||
}());
|
||||
24
dev/Stores/Admin/Package.js
Normal file
24
dev/Stores/Admin/Package.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function PluginAdminStore()
|
||||
{
|
||||
this.collection = ko.observableArray([]);
|
||||
this.collection.loading = ko.observable(false).extend({'throttle': 100});
|
||||
|
||||
this.packagesReal = ko.observable(true);
|
||||
this.packagesMainUpdatable = ko.observable(true);
|
||||
}
|
||||
|
||||
module.exports = new PluginAdminStore();
|
||||
|
||||
}());
|
||||
22
dev/Stores/Admin/Plugin.js
Normal file
22
dev/Stores/Admin/Plugin.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function PluginAdminStore()
|
||||
{
|
||||
this.collection = ko.observableArray([]);
|
||||
this.collection.loading = ko.observable(false).extend({'throttle': 100});
|
||||
this.collection.error = ko.observable('');
|
||||
}
|
||||
|
||||
module.exports = new PluginAdminStore();
|
||||
|
||||
}());
|
||||
35
dev/Stores/Language.js
Normal file
35
dev/Stores/Language.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function LanguageStore()
|
||||
{
|
||||
this.languages = ko.observableArray([]);
|
||||
|
||||
this.language = ko.observable('')
|
||||
.extend({'limitedList': this.languages});
|
||||
}
|
||||
|
||||
LanguageStore.prototype.populate = function ()
|
||||
{
|
||||
var aLanguages = Settings.settingsGet('Languages');
|
||||
|
||||
this.languages(Utils.isArray(aLanguages) ? aLanguages : []);
|
||||
this.language(Settings.settingsGet('Language'));
|
||||
};
|
||||
|
||||
module.exports = new LanguageStore();
|
||||
|
||||
}());
|
||||
|
|
@ -12,7 +12,6 @@
|
|||
*/
|
||||
function SocialStore()
|
||||
{
|
||||
// TODO
|
||||
this.google = {};
|
||||
this.twitter = {};
|
||||
this.facebook = {};
|
||||
|
|
|
|||
39
dev/Stores/Theme.js
Normal file
39
dev/Stores/Theme.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function ThemeStore()
|
||||
{
|
||||
this.themes = ko.observableArray([]);
|
||||
this.themeBackgroundName = ko.observable('');
|
||||
this.themeBackgroundHash = ko.observable('');
|
||||
|
||||
this.theme = ko.observable('')
|
||||
.extend({'limitedList': this.themes});
|
||||
}
|
||||
|
||||
ThemeStore.prototype.populate = function ()
|
||||
{
|
||||
var aThemes = Settings.settingsGet('Themes');
|
||||
|
||||
this.themes(Utils.isArray(aThemes) ? aThemes : []);
|
||||
this.theme(Settings.settingsGet('Theme'));
|
||||
this.themeBackgroundName(Settings.settingsGet('UserBackgroundName'));
|
||||
this.themeBackgroundHash(Settings.settingsGet('UserBackgroundHash'));
|
||||
};
|
||||
|
||||
module.exports = new ThemeStore();
|
||||
|
||||
}());
|
||||
57
dev/Stores/User/App.js
Normal file
57
dev/Stores/User/App.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Globals = require('Common/Globals'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AppUserStore()
|
||||
{
|
||||
// same
|
||||
this.allowLanguagesOnSettings = ko.observable(true);
|
||||
this.allowLanguagesOnLogin = ko.observable(true);
|
||||
// ----
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
AppUserStore.prototype.populate = function()
|
||||
{
|
||||
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
||||
|
||||
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
||||
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
||||
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
||||
};
|
||||
|
||||
module.exports = new AppUserStore();
|
||||
|
||||
}());
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function FilterStore()
|
||||
function FilterUserStore()
|
||||
{
|
||||
this.capa = ko.observable('');
|
||||
this.modules = ko.observable({});
|
||||
|
|
@ -23,6 +23,6 @@
|
|||
this.raw = ko.observable('');
|
||||
}
|
||||
|
||||
module.exports = new FilterStore();
|
||||
module.exports = new FilterUserStore();
|
||||
|
||||
}());
|
||||
|
|
@ -6,8 +6,10 @@
|
|||
var
|
||||
window = require('window'),
|
||||
ko = require('ko'),
|
||||
buzz = require('buzz'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
|
@ -15,10 +17,15 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function NotificationSettings()
|
||||
function NotificationUserStore()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
this.buzz = null;
|
||||
|
||||
this.enableSoundNotification = ko.observable(true);
|
||||
this.soundNotificationIsSupported = ko.observable(false);
|
||||
|
||||
this.allowDesktopNotification = ko.observable(false);
|
||||
|
||||
this.desktopNotificationPermisions = ko.computed(function () {
|
||||
|
|
@ -120,9 +127,11 @@
|
|||
}
|
||||
|
||||
this.computedProperies();
|
||||
|
||||
this.initNotificationPlayer();
|
||||
}
|
||||
|
||||
NotificationSettings.prototype.computedProperies = function ()
|
||||
NotificationUserStore.prototype.computedProperies = function ()
|
||||
{
|
||||
this.isDesktopNotificationSupported = ko.computed(function () {
|
||||
return Enums.DesktopNotification.NotSupported !== this.desktopNotificationPermisions();
|
||||
|
|
@ -134,19 +143,80 @@
|
|||
}, this);
|
||||
};
|
||||
|
||||
NotificationSettings.prototype.populate = function ()
|
||||
NotificationUserStore.prototype.initNotificationPlayer = function ()
|
||||
{
|
||||
if (buzz && buzz.isSupported() && (buzz.isOGGSupported() || buzz.isMP3Supported()))
|
||||
{
|
||||
this.soundNotificationIsSupported(true);
|
||||
|
||||
this.buzz = new buzz.sound(Links.sound('new-mail'), {
|
||||
formats: ['ogg', 'mp3']
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.enableSoundNotification(false);
|
||||
this.soundNotificationIsSupported(false);
|
||||
}
|
||||
};
|
||||
|
||||
NotificationUserStore.prototype.playSoundNotification = function (bSkipSetting)
|
||||
{
|
||||
if (this.buzz && (bSkipSetting ? true : this.enableSoundNotification()))
|
||||
{
|
||||
this.buzz.play();
|
||||
}
|
||||
};
|
||||
|
||||
NotificationUserStore.prototype.displayDesktopNotification = function (sImageSrc, sTitle, sText)
|
||||
{
|
||||
if (this.enableDesktopNotification())
|
||||
{
|
||||
var
|
||||
NotificationClass = this.notificationClass(),
|
||||
oNotification = NotificationClass ? new NotificationClass(sTitle, {
|
||||
'body': sText,
|
||||
'icon': sImageSrc
|
||||
}) : null
|
||||
;
|
||||
|
||||
if (oNotification)
|
||||
{
|
||||
if (oNotification.show)
|
||||
{
|
||||
oNotification.show();
|
||||
}
|
||||
|
||||
window.setTimeout((function (oLocalNotifications) {
|
||||
return function () {
|
||||
if (oLocalNotifications.cancel)
|
||||
{
|
||||
oLocalNotifications.cancel();
|
||||
}
|
||||
else if (oLocalNotifications.close)
|
||||
{
|
||||
oLocalNotifications.close();
|
||||
}
|
||||
};
|
||||
}(oNotification)), 7000);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
NotificationUserStore.prototype.populate = function ()
|
||||
{
|
||||
this.enableSoundNotification(!!Settings.settingsGet('SoundNotification'));
|
||||
this.enableDesktopNotification(!!Settings.settingsGet('DesktopNotifications'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {*|null}
|
||||
*/
|
||||
NotificationSettings.prototype.notificationClass = function ()
|
||||
NotificationUserStore.prototype.notificationClass = function ()
|
||||
{
|
||||
return window.Notification && window.Notification.requestPermission ? window.Notification : null;
|
||||
};
|
||||
|
||||
module.exports = new NotificationSettings();
|
||||
module.exports = new NotificationUserStore();
|
||||
|
||||
}());
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function QuotaStore()
|
||||
function QuotaUserStore()
|
||||
{
|
||||
this.quota = ko.observable(0);
|
||||
this.usage = ko.observable(0);
|
||||
|
|
@ -32,12 +32,12 @@
|
|||
* @param {number} iQuota
|
||||
* @param {number} iUsage
|
||||
*/
|
||||
QuotaStore.prototype.populateData = function(iQuota, iUsage)
|
||||
QuotaUserStore.prototype.populateData = function(iQuota, iUsage)
|
||||
{
|
||||
this.quota(iQuota * 1024);
|
||||
this.usage(iUsage * 1024);
|
||||
};
|
||||
|
||||
module.exports = new QuotaStore();
|
||||
module.exports = new QuotaUserStore();
|
||||
|
||||
}());
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function UserSettingsStore()
|
||||
function SettingsUserStore()
|
||||
{
|
||||
this.layout = ko.observable(Enums.Layout.SidePreview)
|
||||
.extend({'limitedList': [
|
||||
|
|
@ -29,52 +29,37 @@
|
|||
Enums.EditorDefaultType.HtmlForced, Enums.EditorDefaultType.PlainForced
|
||||
]});
|
||||
|
||||
this.languages = ko.observableArray([]);
|
||||
|
||||
this.language = ko.observable('')
|
||||
.extend({'limitedList': this.languages});
|
||||
|
||||
this.themes = ko.observableArray([]);
|
||||
this.themeBackgroundName = ko.observable('');
|
||||
this.themeBackgroundHash = ko.observable('');
|
||||
|
||||
this.theme = ko.observable('')
|
||||
.extend({'limitedList': this.themes});
|
||||
|
||||
this.messagesPerPage = ko.observable(Consts.Defaults.MessagesPerPage)
|
||||
.extend({'limitedList': Consts.Defaults.MessagesPerPageArray});
|
||||
|
||||
this.showImages = ko.observable(false);
|
||||
this.useCheckboxesInList = ko.observable(true);
|
||||
this.useThreads = ko.observable(false);
|
||||
this.replySameFolder = ko.observable(false);
|
||||
|
||||
this.computedProperies();
|
||||
}
|
||||
|
||||
UserSettingsStore.prototype.computedProperies = function ()
|
||||
SettingsUserStore.prototype.computedProperies = function ()
|
||||
{
|
||||
this.usePreviewPane = ko.computed(function () {
|
||||
return Enums.Layout.NoPreview !== this.layout();
|
||||
}, this);
|
||||
};
|
||||
|
||||
UserSettingsStore.prototype.populate = function ()
|
||||
SettingsUserStore.prototype.populate = function ()
|
||||
{
|
||||
var
|
||||
aLanguages = Settings.settingsGet('Languages'),
|
||||
aThemes = Settings.settingsGet('Themes')
|
||||
;
|
||||
|
||||
this.layout(Utils.pInt(Settings.settingsGet('Layout')));
|
||||
this.editorDefaultType(Settings.settingsGet('EditorDefaultType'));
|
||||
|
||||
this.languages(Utils.isArray(aLanguages) ? aLanguages : []);
|
||||
this.language(Settings.settingsGet('Language'));
|
||||
|
||||
this.themes(Utils.isArray(aThemes) ? aThemes : []);
|
||||
this.theme(Settings.settingsGet('Theme'));
|
||||
this.themeBackgroundName(Settings.settingsGet('UserBackgroundName'));
|
||||
this.themeBackgroundHash(Settings.settingsGet('UserBackgroundHash'));
|
||||
|
||||
this.messagesPerPage(Settings.settingsGet('MPP'));
|
||||
|
||||
this.showImages(!!Settings.settingsGet('ShowImages'));
|
||||
this.useCheckboxesInList(!!Settings.settingsGet('UseCheckboxesInList'));
|
||||
this.useThreads(!!Settings.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!Settings.settingsGet('ReplySameFolder'));
|
||||
};
|
||||
|
||||
module.exports = new UserSettingsStore();
|
||||
module.exports = new SettingsUserStore();
|
||||
|
||||
}());
|
||||
|
|
@ -22,6 +22,11 @@
|
|||
font-size: 24px;
|
||||
}
|
||||
|
||||
.iconsize24 {
|
||||
line-height: 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
/* White icons with optional class, or on hover/active states of certain elements */
|
||||
.icon-white,
|
||||
.nav > .active > a > [class^="icon-"],
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
ko = require('ko'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
|
@ -26,9 +25,20 @@
|
|||
this.adminDomain = ko.observable(Settings.settingsGet('AdminDomain'));
|
||||
this.version = ko.observable(Settings.settingsGet('Version'));
|
||||
|
||||
this.adminManLoadingVisibility = Data.adminManLoadingVisibility;
|
||||
this.capa = !!Settings.settingsGet('PremType');
|
||||
|
||||
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'
|
||||
].join('');
|
||||
}, this);
|
||||
|
||||
this.adminManLoadingVisibility = ko.computed(function () {
|
||||
return this.adminManLoading() ? 'visible' : 'hidden';
|
||||
}, this).extend({'rateLimit': 300});
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
LicenseStore = require('Stores/Admin/License'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
this.key.focus = ko.observable(false);
|
||||
this.activationSuccessed = ko.observable(false);
|
||||
|
||||
this.licenseTrigger = Data.licenseTrigger;
|
||||
this.licenseTrigger = LicenseStore.licenseTrigger;
|
||||
|
||||
this.activateProcess = ko.observable(false);
|
||||
this.activateText = ko.observable('');
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@
|
|||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
AppStore = require('Stores/User/App'),
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
SocialStore = require('Stores/Social'),
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
|
||||
this.bCapaAdditionalIdentities = Settings.capa(Enums.Capa.AdditionalIdentities);
|
||||
|
||||
this.allowContacts = !!Settings.settingsGet('ContactsIsAllowed');
|
||||
this.allowContacts = !!AppStore.contactsIsAllowed();
|
||||
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -65,7 +66,7 @@
|
|||
|
||||
this.bSkipNextHide = false;
|
||||
this.composeInEdit = Data.composeInEdit;
|
||||
this.editorDefaultType = UserSettingsStore.editorDefaultType;
|
||||
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
||||
|
||||
this.capaOpenPGP = Data.capaOpenPGP;
|
||||
|
||||
|
|
@ -280,7 +281,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Data.replySameFolder())
|
||||
if (SettingsUserStore.replySameFolder())
|
||||
{
|
||||
if (Utils.isArray(this.aDraftInfo) && 3 === this.aDraftInfo.length && Utils.isNormal(this.aDraftInfo[2]) && 0 < this.aDraftInfo[2].length)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
Links = require('Common/Links'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
|
||||
|
|
@ -173,7 +175,7 @@
|
|||
|
||||
this.viewSaving = ko.observable(false);
|
||||
|
||||
this.useCheckboxesInList = Data.useCheckboxesInList;
|
||||
this.useCheckboxesInList = SettingsUserStore.useCheckboxesInList;
|
||||
|
||||
this.search.subscribe(function () {
|
||||
this.reloadContactList();
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@
|
|||
Consts = require('Common/Consts'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
CapaAdminStore = require('Stores/Admin/Capa'),
|
||||
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
|
|
@ -63,7 +64,7 @@
|
|||
this.name = ko.observable('');
|
||||
this.name.focused = ko.observable(false);
|
||||
|
||||
this.allowSieve = ko.observable(Settings.capa(Enums.Capa.Sieve));
|
||||
this.allowSieve = CapaAdminStore.sieve;
|
||||
|
||||
this.imapServer = ko.observable('');
|
||||
this.imapPort = ko.observable('' + Consts.Values.ImapDefaulPort);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
Data = require('Storage/User/Data'),
|
||||
|
||||
FilterStore = require('Stores/Filter'),
|
||||
FilterStore = require('Stores/User/Filter'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@
|
|||
{
|
||||
AbstractView.call(this, 'Popups', 'PopupsLanguages');
|
||||
|
||||
this.UserSettingsStore = require('Stores/UserSettings');
|
||||
this.LanguageStore = require('Stores/Language');
|
||||
|
||||
this.exp = ko.observable(false);
|
||||
|
||||
this.languages = ko.computed(function () {
|
||||
return _.map(this.UserSettingsStore.languages(), function (sLanguage) {
|
||||
return _.map(this.LanguageStore.languages(), function (sLanguage) {
|
||||
return {
|
||||
'key': sLanguage,
|
||||
'selected': ko.observable(false),
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
});
|
||||
}, this);
|
||||
|
||||
this.UserSettingsStore.language.subscribe(function () {
|
||||
this.LanguageStore.language.subscribe(function () {
|
||||
this.resetMainLanguage();
|
||||
}, this);
|
||||
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
LanguagesPopupView.prototype.resetMainLanguage = function ()
|
||||
{
|
||||
var sCurrent = this.UserSettingsStore.language();
|
||||
var sCurrent = this.LanguageStore.language();
|
||||
_.each(this.languages(), function (oItem) {
|
||||
oItem['selected'](oItem['key'] === sCurrent);
|
||||
});
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
LanguagesPopupView.prototype.changeLanguage = function (sLang)
|
||||
{
|
||||
this.UserSettingsStore.language(sLang);
|
||||
this.LanguageStore.language(sLang);
|
||||
this.cancelCommand();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
|
||||
Plugins = require('Common/Plugins'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
LanguageStore = require('Stores/Language'),
|
||||
AppStore = require('Stores/User/App'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
|
@ -88,10 +89,10 @@
|
|||
}
|
||||
}, this);
|
||||
|
||||
this.allowLanguagesOnLogin = Data.allowLanguagesOnLogin;
|
||||
this.allowLanguagesOnLogin = AppStore.allowLanguagesOnLogin;
|
||||
|
||||
this.langRequest = ko.observable(false);
|
||||
this.language = UserSettingsStore.language;
|
||||
this.language = LanguageStore.language;
|
||||
|
||||
this.bSendLanguage = false;
|
||||
|
||||
|
|
@ -307,7 +308,7 @@
|
|||
|
||||
if (Settings.settingsGet('UserLanguage'))
|
||||
{
|
||||
$.cookie('rllang', UserSettingsStore.language(), {'expires': 30});
|
||||
$.cookie('rllang', LanguageStore.language(), {'expires': 30});
|
||||
}
|
||||
|
||||
}, this), 100);
|
||||
|
|
@ -376,7 +377,7 @@
|
|||
}
|
||||
|
||||
_.delay(function () {
|
||||
UserSettingsStore.language.subscribe(function (sValue) {
|
||||
LanguageStore.language.subscribe(function (sValue) {
|
||||
|
||||
self.langRequest(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
AppStore = require('Stores/User/App'),
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
Data = require('Storage/User/Data'),
|
||||
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
this.iDropOverTimer = 0;
|
||||
|
||||
this.allowContacts = !!Settings.settingsGet('ContactsIsAllowed');
|
||||
this.allowContacts = !!AppStore.contactsIsAllowed();
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
|
||||
if (oFolder)
|
||||
{
|
||||
if (Enums.Layout.NoPreview === UserSettingsStore.layout())
|
||||
if (Enums.Layout.NoPreview === SettingsUserStore.layout())
|
||||
{
|
||||
Data.message(null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
Selector = require('Common/Selector'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
QuotaStore = require('Stores/Quota'),
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
QuotaStore = require('Stores/User/Quota'),
|
||||
SettingsStore = require('Stores/User/Settings'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
this.messageListError = Data.messageListError;
|
||||
this.folderMenuForMove = Data.folderMenuForMove;
|
||||
|
||||
this.useCheckboxesInList = Data.useCheckboxesInList;
|
||||
this.useCheckboxesInList = SettingsStore.useCheckboxesInList;
|
||||
|
||||
this.mainMessageListSearch = Data.mainMessageListSearch;
|
||||
this.messageListEndFolder = Data.messageListEndFolder;
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
this.dragOverBodyArea = ko.observable(null);
|
||||
|
||||
this.messageListItemTemplate = ko.computed(function () {
|
||||
return Enums.Layout.SidePreview === UserSettingsStore.layout() ?
|
||||
return Enums.Layout.SidePreview === SettingsStore.layout() ?
|
||||
'MailMessageListItem' : 'MailMessageListItemNoPreviewPane';
|
||||
});
|
||||
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
Data.message(Data.staticMessageList.populateByMessageListItem(oMessage));
|
||||
this.populateMessageBody(Data.message());
|
||||
|
||||
if (Enums.Layout.NoPreview === UserSettingsStore.layout())
|
||||
if (Enums.Layout.NoPreview === SettingsStore.layout())
|
||||
{
|
||||
kn.setHash(Links.messagePreview(), true);
|
||||
Data.message.focused(true);
|
||||
|
|
@ -251,11 +251,11 @@
|
|||
this.selector.scrollToTop();
|
||||
}, this);
|
||||
|
||||
UserSettingsStore.layout.subscribe(function (mValue) {
|
||||
SettingsStore.layout.subscribe(function (mValue) {
|
||||
this.selector.autoSelect(Enums.Layout.NoPreview !== mValue);
|
||||
}, this);
|
||||
|
||||
UserSettingsStore.layout.valueHasMutated();
|
||||
SettingsStore.layout.valueHasMutated();
|
||||
|
||||
Events
|
||||
.sub('mailbox.message-list.selector.go-down', function () {
|
||||
|
|
@ -815,14 +815,12 @@
|
|||
return false;
|
||||
});
|
||||
|
||||
// TODO
|
||||
key('ctrl+left, command+left', Enums.KeyState.MessageView, function () {
|
||||
return false;
|
||||
return false; // TODO
|
||||
});
|
||||
|
||||
// TODO
|
||||
key('ctrl+right, command+right', Enums.KeyState.MessageView, function () {
|
||||
return false;
|
||||
return false; // TODO
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
Events = require('Common/Events'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
UserSettingsStore = require('Stores/UserSettings'),
|
||||
SettingsUserStore = require('Stores/User/Settings'),
|
||||
|
||||
Local = require('Storage/Local'),
|
||||
Local = require('Storage/Client'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
|
|
@ -62,10 +62,10 @@
|
|||
this.messageLoading = Data.messageLoading;
|
||||
this.messageLoadingThrottle = Data.messageLoadingThrottle;
|
||||
this.messagesBodiesDom = Data.messagesBodiesDom;
|
||||
this.useThreads = Data.useThreads;
|
||||
this.replySameFolder = Data.replySameFolder;
|
||||
this.layout = UserSettingsStore.layout;
|
||||
this.usePreviewPane = UserSettingsStore.usePreviewPane;
|
||||
this.useThreads = SettingsUserStore.useThreads;
|
||||
this.replySameFolder = SettingsUserStore.replySameFolder;
|
||||
this.layout = SettingsUserStore.layout;
|
||||
this.usePreviewPane = SettingsUserStore.usePreviewPane;
|
||||
this.isMessageSelected = Data.isMessageSelected;
|
||||
this.messageActiveDom = Data.messageActiveDom;
|
||||
this.messageError = Data.messageError;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue