mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
eslint (additional rules)
This commit is contained in:
parent
77a1d3f3df
commit
8e8a041032
150 changed files with 21911 additions and 23106 deletions
|
|
@ -1,32 +1,25 @@
|
|||
|
||||
(function () {
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
'use strict';
|
||||
AbstractScreen = require('Knoin/AbstractScreen');
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function AboutUserScreen()
|
||||
{
|
||||
AbstractScreen.call(this, 'about', [
|
||||
require('View/User/About')
|
||||
]);
|
||||
}
|
||||
|
||||
AbstractScreen = require('Knoin/AbstractScreen')
|
||||
;
|
||||
_.extend(AboutUserScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function AboutUserScreen()
|
||||
{
|
||||
AbstractScreen.call(this, 'about', [
|
||||
require('View/User/About')
|
||||
]);
|
||||
}
|
||||
AboutUserScreen.prototype.onShow = function()
|
||||
{
|
||||
require('App/User').default.setWindowTitle('RainLoop');
|
||||
};
|
||||
|
||||
_.extend(AboutUserScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
AboutUserScreen.prototype.onShow = function ()
|
||||
{
|
||||
require('App/User').default.setWindowTitle('RainLoop');
|
||||
};
|
||||
|
||||
module.exports = AboutUserScreen;
|
||||
|
||||
}());
|
||||
module.exports = AboutUserScreen;
|
||||
|
|
|
|||
|
|
@ -1,32 +1,25 @@
|
|||
|
||||
(function () {
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
'use strict';
|
||||
AbstractScreen = require('Knoin/AbstractScreen');
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function LoginUserScreen()
|
||||
{
|
||||
AbstractScreen.call(this, 'login', [
|
||||
require('View/User/Login')
|
||||
]);
|
||||
}
|
||||
|
||||
AbstractScreen = require('Knoin/AbstractScreen')
|
||||
;
|
||||
_.extend(LoginUserScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function LoginUserScreen()
|
||||
{
|
||||
AbstractScreen.call(this, 'login', [
|
||||
require('View/User/Login')
|
||||
]);
|
||||
}
|
||||
LoginUserScreen.prototype.onShow = function()
|
||||
{
|
||||
require('App/User').default.setWindowTitle('');
|
||||
};
|
||||
|
||||
_.extend(LoginUserScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
LoginUserScreen.prototype.onShow = function ()
|
||||
{
|
||||
require('App/User').default.setWindowTitle('');
|
||||
};
|
||||
|
||||
module.exports = LoginUserScreen;
|
||||
|
||||
}());
|
||||
module.exports = LoginUserScreen;
|
||||
|
|
|
|||
|
|
@ -1,204 +1,194 @@
|
|||
|
||||
(function () {
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
'use strict';
|
||||
Enums = require('Common/Enums'),
|
||||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
Events = require('Common/Events'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Cache = require('Common/Cache'),
|
||||
|
||||
AppStore = require('Stores/User/App'),
|
||||
AccountStore = require('Stores/User/Account'),
|
||||
SettingsStore = require('Stores/User/Settings'),
|
||||
FolderStore = require('Stores/User/Folder'),
|
||||
MessageStore = require('Stores/User/Message'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
AbstractScreen = require('Knoin/AbstractScreen');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function MailBoxUserScreen()
|
||||
{
|
||||
AbstractScreen.call(this, 'mailbox', [
|
||||
require('View/User/MailBox/SystemDropDown'),
|
||||
require('View/User/MailBox/FolderList'),
|
||||
require('View/User/MailBox/MessageList'),
|
||||
require('View/User/MailBox/MessageView')
|
||||
]);
|
||||
|
||||
this.oLastRoute = {};
|
||||
}
|
||||
|
||||
_.extend(MailBoxUserScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
MailBoxUserScreen.prototype.oLastRoute = {};
|
||||
|
||||
MailBoxUserScreen.prototype.updateWindowTitle = function()
|
||||
{
|
||||
var
|
||||
_ = require('_'),
|
||||
sEmail = AccountStore.email(),
|
||||
nFoldersInboxUnreadCount = FolderStore.foldersInboxUnreadCount();
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
Events = require('Common/Events'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Cache = require('Common/Cache'),
|
||||
|
||||
AppStore = require('Stores/User/App'),
|
||||
AccountStore = require('Stores/User/Account'),
|
||||
SettingsStore = require('Stores/User/Settings'),
|
||||
FolderStore = require('Stores/User/Folder'),
|
||||
MessageStore = require('Stores/User/Message'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
AbstractScreen = require('Knoin/AbstractScreen')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function MailBoxUserScreen()
|
||||
if (Settings.appSettingsGet('listPermanentFiltered'))
|
||||
{
|
||||
AbstractScreen.call(this, 'mailbox', [
|
||||
require('View/User/MailBox/SystemDropDown'),
|
||||
require('View/User/MailBox/FolderList'),
|
||||
require('View/User/MailBox/MessageList'),
|
||||
require('View/User/MailBox/MessageView')
|
||||
]);
|
||||
|
||||
this.oLastRoute = {};
|
||||
nFoldersInboxUnreadCount = 0;
|
||||
}
|
||||
|
||||
_.extend(MailBoxUserScreen.prototype, AbstractScreen.prototype);
|
||||
require('App/User').default.setWindowTitle(('' === sEmail ? '' : '' +
|
||||
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') +
|
||||
sEmail + ' - ') + Translator.i18n('TITLES/MAILBOX'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
MailBoxUserScreen.prototype.oLastRoute = {};
|
||||
MailBoxUserScreen.prototype.onShow = function()
|
||||
{
|
||||
this.updateWindowTitle();
|
||||
|
||||
MailBoxUserScreen.prototype.updateWindowTitle = function ()
|
||||
AppStore.focusedState(Enums.Focused.None);
|
||||
AppStore.focusedState(Enums.Focused.MessageList);
|
||||
|
||||
if (Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
var
|
||||
sEmail = AccountStore.email(),
|
||||
nFoldersInboxUnreadCount = FolderStore.foldersInboxUnreadCount()
|
||||
;
|
||||
Globals.leftPanelDisabled(true);
|
||||
}
|
||||
|
||||
if (Settings.appSettingsGet('listPermanentFiltered'))
|
||||
if (!Settings.capa(Enums.Capa.Folders))
|
||||
{
|
||||
Globals.leftPanelType(
|
||||
Settings.capa(Enums.Capa.Composer) || Settings.capa(Enums.Capa.Contacts) ? 'short' : 'none');
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.leftPanelType('');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} sFolderHash
|
||||
* @param {number} iPage
|
||||
* @param {string} sSearch
|
||||
*/
|
||||
MailBoxUserScreen.prototype.onRoute = function(sFolderHash, iPage, sSearch)
|
||||
{
|
||||
var
|
||||
sThreadUid = sFolderHash.replace(/^(.+)~([\d]+)$/, '$2'),
|
||||
oFolder = Cache.getFolderFromCacheList(Cache.getFolderFullNameRaw(
|
||||
sFolderHash.replace(/~([\d]+)$/, '')));
|
||||
|
||||
if (oFolder)
|
||||
{
|
||||
if (sFolderHash === sThreadUid)
|
||||
{
|
||||
nFoldersInboxUnreadCount = 0;
|
||||
sThreadUid = '';
|
||||
}
|
||||
|
||||
require('App/User').default.setWindowTitle(('' === sEmail ? '' : '' +
|
||||
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') +
|
||||
sEmail + ' - ') + Translator.i18n('TITLES/MAILBOX'));
|
||||
};
|
||||
FolderStore.currentFolder(oFolder);
|
||||
|
||||
MessageStore.messageListPage(iPage);
|
||||
MessageStore.messageListSearch(sSearch);
|
||||
MessageStore.messageListThreadUid(sThreadUid);
|
||||
|
||||
require('App/User').default.reloadMessageList();
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxUserScreen.prototype.onStart = function()
|
||||
{
|
||||
FolderStore.folderList.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
MessageStore.messageList.subscribe(Utils.windowResizeCallback);
|
||||
MessageStore.message.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
_.delay(function() {
|
||||
SettingsStore.layout.valueHasMutated();
|
||||
}, 50);
|
||||
|
||||
Events.sub('mailbox.inbox-unread-count', _.bind(function(iCount) {
|
||||
|
||||
FolderStore.foldersInboxUnreadCount(iCount);
|
||||
|
||||
var sEmail = AccountStore.email();
|
||||
|
||||
_.each(AccountStore.accounts(), function(oItem) {
|
||||
if (oItem && sEmail === oItem.email)
|
||||
{
|
||||
oItem.count(iCount);
|
||||
}
|
||||
});
|
||||
|
||||
MailBoxUserScreen.prototype.onShow = function ()
|
||||
{
|
||||
this.updateWindowTitle();
|
||||
|
||||
AppStore.focusedState(Enums.Focused.None);
|
||||
AppStore.focusedState(Enums.Focused.MessageList);
|
||||
}, this));
|
||||
};
|
||||
|
||||
if (Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
Globals.leftPanelDisabled(true);
|
||||
}
|
||||
|
||||
if (!Settings.capa(Enums.Capa.Folders))
|
||||
{
|
||||
Globals.leftPanelType(
|
||||
Settings.capa(Enums.Capa.Composer) || Settings.capa(Enums.Capa.Contacts) ? 'short' : 'none');
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.leftPanelType('');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} sFolderHash
|
||||
* @param {number} iPage
|
||||
* @param {string} sSearch
|
||||
*/
|
||||
MailBoxUserScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch)
|
||||
MailBoxUserScreen.prototype.onBuild = function()
|
||||
{
|
||||
if (!Globals.bMobileDevice && !Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
var
|
||||
sThreadUid = sFolderHash.replace(/^(.+)~([\d]+)$/, '$2'),
|
||||
oFolder = Cache.getFolderFromCacheList(Cache.getFolderFullNameRaw(
|
||||
sFolderHash.replace(/~([\d]+)$/, '')))
|
||||
;
|
||||
_.defer(function() {
|
||||
require('App/User').default.initHorizontalLayoutResizer(Enums.ClientSideKeyName.MessageListSize);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if (oFolder)
|
||||
{
|
||||
if (sFolderHash === sThreadUid)
|
||||
/**
|
||||
* @returns {Array}
|
||||
*/
|
||||
MailBoxUserScreen.prototype.routes = function()
|
||||
{
|
||||
var
|
||||
sInboxFolderName = Cache.getFolderInboxName(),
|
||||
fNormS = function(oRequest, oVals) {
|
||||
oVals[0] = Utils.pString(oVals[0]);
|
||||
oVals[1] = Utils.pInt(oVals[1]);
|
||||
oVals[1] = 0 >= oVals[1] ? 1 : oVals[1];
|
||||
oVals[2] = Utils.pString(oVals[2]);
|
||||
|
||||
if ('' === oRequest)
|
||||
{
|
||||
sThreadUid = '';
|
||||
oVals[0] = sInboxFolderName;
|
||||
oVals[1] = 1;
|
||||
}
|
||||
|
||||
FolderStore.currentFolder(oFolder);
|
||||
return [decodeURI(oVals[0]), oVals[1], decodeURI(oVals[2])];
|
||||
},
|
||||
fNormD = function(oRequest, oVals) {
|
||||
oVals[0] = Utils.pString(oVals[0]);
|
||||
oVals[1] = Utils.pString(oVals[1]);
|
||||
|
||||
MessageStore.messageListPage(iPage);
|
||||
MessageStore.messageListSearch(sSearch);
|
||||
MessageStore.messageListThreadUid(sThreadUid);
|
||||
|
||||
require('App/User').default.reloadMessageList();
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxUserScreen.prototype.onStart = function ()
|
||||
{
|
||||
FolderStore.folderList.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
MessageStore.messageList.subscribe(Utils.windowResizeCallback);
|
||||
MessageStore.message.subscribe(Utils.windowResizeCallback);
|
||||
|
||||
_.delay(function () {
|
||||
SettingsStore.layout.valueHasMutated();
|
||||
}, 50);
|
||||
|
||||
Events.sub('mailbox.inbox-unread-count', _.bind(function (iCount) {
|
||||
|
||||
FolderStore.foldersInboxUnreadCount(iCount);
|
||||
|
||||
var sEmail = AccountStore.email();
|
||||
|
||||
_.each(AccountStore.accounts(), function (oItem) {
|
||||
if (oItem && sEmail === oItem.email)
|
||||
{
|
||||
oItem.count(iCount);
|
||||
}
|
||||
});
|
||||
|
||||
this.updateWindowTitle();
|
||||
|
||||
}, this));
|
||||
};
|
||||
|
||||
MailBoxUserScreen.prototype.onBuild = function ()
|
||||
{
|
||||
if (!Globals.bMobileDevice && !Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
_.defer(function () {
|
||||
require('App/User').default.initHorizontalLayoutResizer(Enums.ClientSideKeyName.MessageListSize);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {Array}
|
||||
*/
|
||||
MailBoxUserScreen.prototype.routes = function ()
|
||||
{
|
||||
var
|
||||
sInboxFolderName = Cache.getFolderInboxName(),
|
||||
fNormS = function (oRequest, oVals) {
|
||||
oVals[0] = Utils.pString(oVals[0]);
|
||||
oVals[1] = Utils.pInt(oVals[1]);
|
||||
oVals[1] = 0 >= oVals[1] ? 1 : oVals[1];
|
||||
oVals[2] = Utils.pString(oVals[2]);
|
||||
|
||||
if ('' === oRequest)
|
||||
{
|
||||
oVals[0] = sInboxFolderName;
|
||||
oVals[1] = 1;
|
||||
}
|
||||
|
||||
return [decodeURI(oVals[0]), oVals[1], decodeURI(oVals[2])];
|
||||
},
|
||||
fNormD = function (oRequest, oVals) {
|
||||
oVals[0] = Utils.pString(oVals[0]);
|
||||
oVals[1] = Utils.pString(oVals[1]);
|
||||
|
||||
if ('' === oRequest)
|
||||
{
|
||||
oVals[0] = sInboxFolderName;
|
||||
}
|
||||
|
||||
return [decodeURI(oVals[0]), 1, decodeURI(oVals[1])];
|
||||
if ('' === oRequest)
|
||||
{
|
||||
oVals[0] = sInboxFolderName;
|
||||
}
|
||||
;
|
||||
|
||||
return [
|
||||
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}],
|
||||
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}],
|
||||
[/^([a-zA-Z0-9~]+)\/(.+)\/?$/, {'normalize_': fNormD}],
|
||||
[/^([^\/]*)$/, {'normalize_': fNormS}]
|
||||
];
|
||||
};
|
||||
return [decodeURI(oVals[0]), 1, decodeURI(oVals[1])];
|
||||
};
|
||||
|
||||
module.exports = MailBoxUserScreen;
|
||||
return [
|
||||
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}],
|
||||
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}],
|
||||
[/^([a-zA-Z0-9~]+)\/(.+)\/?$/, {'normalize_': fNormD}],
|
||||
[/^([^\/]*)$/, {'normalize_': fNormS}]
|
||||
];
|
||||
};
|
||||
|
||||
}());
|
||||
module.exports = MailBoxUserScreen;
|
||||
|
|
|
|||
|
|
@ -1,157 +1,150 @@
|
|||
|
||||
(function () {
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
'use strict';
|
||||
Enums = require('Common/Enums'),
|
||||
Globals = require('Common/Globals'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
Plugins = require('Common/Plugins'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Globals = require('Common/Globals'),
|
||||
Translator = require('Common/Translator'),
|
||||
AppStore = require('Stores/User/App'),
|
||||
AccountStore = require('Stores/User/Account'),
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
Plugins = require('Common/Plugins'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
AppStore = require('Stores/User/App'),
|
||||
AccountStore = require('Stores/User/Account'),
|
||||
Settings = require('Storage/Settings'),
|
||||
AbstractSettingsScreen = require('Screen/AbstractSettings');
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSettingsScreen
|
||||
*/
|
||||
function SettingsUserScreen()
|
||||
{
|
||||
AbstractSettingsScreen.call(this, [
|
||||
require('View/User/Settings/SystemDropDown'),
|
||||
require('View/User/Settings/Menu'),
|
||||
require('View/User/Settings/Pane')
|
||||
]);
|
||||
|
||||
AbstractSettingsScreen = require('Screen/AbstractSettings')
|
||||
;
|
||||
Translator.initOnStartOrLangChange(function() {
|
||||
this.sSettingsTitle = Translator.i18n('TITLES/SETTINGS');
|
||||
}, this, function() {
|
||||
this.setSettingsTitle();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSettingsScreen
|
||||
*/
|
||||
function SettingsUserScreen()
|
||||
_.extend(SettingsUserScreen.prototype, AbstractSettingsScreen.prototype);
|
||||
|
||||
/**
|
||||
* @param {Function=} fCallback
|
||||
*/
|
||||
SettingsUserScreen.prototype.setupSettings = function(fCallback)
|
||||
{
|
||||
if (!Settings.capa(Enums.Capa.Settings))
|
||||
{
|
||||
AbstractSettingsScreen.call(this, [
|
||||
require('View/User/Settings/SystemDropDown'),
|
||||
require('View/User/Settings/Menu'),
|
||||
require('View/User/Settings/Pane')
|
||||
]);
|
||||
|
||||
Translator.initOnStartOrLangChange(function () {
|
||||
this.sSettingsTitle = Translator.i18n('TITLES/SETTINGS');
|
||||
}, this, function () {
|
||||
this.setSettingsTitle();
|
||||
});
|
||||
}
|
||||
|
||||
_.extend(SettingsUserScreen.prototype, AbstractSettingsScreen.prototype);
|
||||
|
||||
/**
|
||||
* @param {Function=} fCallback
|
||||
*/
|
||||
SettingsUserScreen.prototype.setupSettings = function (fCallback)
|
||||
{
|
||||
if (!Settings.capa(Enums.Capa.Settings))
|
||||
{
|
||||
if (fCallback)
|
||||
{
|
||||
fCallback();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
kn.addSettingsViewModel(require('Settings/User/General'),
|
||||
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
|
||||
if (AppStore.contactsIsAllowed())
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Contacts'),
|
||||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.Identities))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Accounts'), 'SettingsAccounts',
|
||||
Settings.capa(Enums.Capa.AdditionalAccounts) ?
|
||||
'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME' : 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'accounts');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Sieve))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Filters'),
|
||||
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.AutoLogout) || Settings.capa(Enums.Capa.TwoFactor))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Security'),
|
||||
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
}
|
||||
|
||||
if (AccountStore.isRootAccount() && (
|
||||
(Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) ||
|
||||
Settings.settingsGet('AllowFacebookSocial') ||
|
||||
Settings.settingsGet('AllowTwitterSocial')))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Social'),
|
||||
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
}
|
||||
|
||||
if (Settings.settingsGet('ChangePasswordIsAllowed'))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/ChangePassword'),
|
||||
'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Templates))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Templates'),
|
||||
'SettingsTemplates', 'SETTINGS_LABELS/LABEL_TEMPLATES_NAME', 'templates');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Folders))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Folders'),
|
||||
'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Themes))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Themes'),
|
||||
'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/OpenPgp'),
|
||||
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||
}
|
||||
|
||||
Plugins.runSettingsViewModelHooks(false);
|
||||
|
||||
if (fCallback)
|
||||
{
|
||||
fCallback();
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
||||
SettingsUserScreen.prototype.onShow = function ()
|
||||
kn.addSettingsViewModel(require('Settings/User/General'),
|
||||
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
|
||||
if (AppStore.contactsIsAllowed())
|
||||
{
|
||||
this.setSettingsTitle();
|
||||
Globals.keyScope(Enums.KeyState.Settings);
|
||||
Globals.leftPanelType('');
|
||||
kn.addSettingsViewModel(require('Settings/User/Contacts'),
|
||||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
}
|
||||
|
||||
if (Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
Globals.leftPanelDisabled(true);
|
||||
}
|
||||
};
|
||||
|
||||
SettingsUserScreen.prototype.setSettingsTitle = function ()
|
||||
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.Identities))
|
||||
{
|
||||
var sEmail = AccountStore.email();
|
||||
require('App/User').default.setWindowTitle(('' === sEmail ? '' : sEmail + ' - ') + this.sSettingsTitle);
|
||||
};
|
||||
kn.addSettingsViewModel(require('Settings/User/Accounts'), 'SettingsAccounts',
|
||||
Settings.capa(Enums.Capa.AdditionalAccounts) ?
|
||||
'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME' : 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'accounts');
|
||||
}
|
||||
|
||||
module.exports = SettingsUserScreen;
|
||||
if (Settings.capa(Enums.Capa.Sieve))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Filters'),
|
||||
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||
}
|
||||
|
||||
}());
|
||||
if (Settings.capa(Enums.Capa.AutoLogout) || Settings.capa(Enums.Capa.TwoFactor))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Security'),
|
||||
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
}
|
||||
|
||||
if (AccountStore.isRootAccount() && (
|
||||
(Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) ||
|
||||
Settings.settingsGet('AllowFacebookSocial') ||
|
||||
Settings.settingsGet('AllowTwitterSocial')))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Social'),
|
||||
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
}
|
||||
|
||||
if (Settings.settingsGet('ChangePasswordIsAllowed'))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/ChangePassword'),
|
||||
'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Templates))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Templates'),
|
||||
'SettingsTemplates', 'SETTINGS_LABELS/LABEL_TEMPLATES_NAME', 'templates');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Folders))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Folders'),
|
||||
'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Themes))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Themes'),
|
||||
'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/OpenPgp'),
|
||||
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||
}
|
||||
|
||||
Plugins.runSettingsViewModelHooks(false);
|
||||
|
||||
if (fCallback)
|
||||
{
|
||||
fCallback();
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
SettingsUserScreen.prototype.onShow = function()
|
||||
{
|
||||
this.setSettingsTitle();
|
||||
Globals.keyScope(Enums.KeyState.Settings);
|
||||
Globals.leftPanelType('');
|
||||
|
||||
if (Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
Globals.leftPanelDisabled(true);
|
||||
}
|
||||
};
|
||||
|
||||
SettingsUserScreen.prototype.setSettingsTitle = function()
|
||||
{
|
||||
var sEmail = AccountStore.email();
|
||||
require('App/User').default.setWindowTitle(('' === sEmail ? '' : sEmail + ' - ') + this.sSettingsTitle);
|
||||
};
|
||||
|
||||
module.exports = SettingsUserScreen;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue