mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
prettier --write
This commit is contained in:
parent
450528ff00
commit
8a0be3212d
164 changed files with 7053 additions and 9008 deletions
|
|
@ -1,12 +1,10 @@
|
|||
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||
|
||||
import {AbstractScreen} from 'Knoin/AbstractScreen';
|
||||
import { AboutUserView } from 'View/User/About';
|
||||
|
||||
import {AboutUserView} from 'View/User/About';
|
||||
import { getApp } from 'Helper/Apps/User';
|
||||
|
||||
import {getApp} from 'Helper/Apps/User';
|
||||
|
||||
class AboutUserScreen extends AbstractScreen
|
||||
{
|
||||
class AboutUserScreen extends AbstractScreen {
|
||||
constructor() {
|
||||
super('about', [AboutUserView]);
|
||||
}
|
||||
|
|
@ -16,4 +14,4 @@ class AboutUserScreen extends AbstractScreen
|
|||
}
|
||||
}
|
||||
|
||||
export {AboutUserScreen, AboutUserScreen as default};
|
||||
export { AboutUserScreen, AboutUserScreen as default };
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||
|
||||
import {AbstractScreen} from 'Knoin/AbstractScreen';
|
||||
import { LoginUserView } from 'View/User/Login';
|
||||
|
||||
import {LoginUserView} from 'View/User/Login';
|
||||
import { getApp } from 'Helper/Apps/User';
|
||||
|
||||
import {getApp} from 'Helper/Apps/User';
|
||||
|
||||
class LoginUserScreen extends AbstractScreen
|
||||
{
|
||||
class LoginUserScreen extends AbstractScreen {
|
||||
constructor() {
|
||||
super('login', [LoginUserView]);
|
||||
}
|
||||
|
|
@ -16,4 +14,4 @@ class LoginUserScreen extends AbstractScreen
|
|||
}
|
||||
}
|
||||
|
||||
export {LoginUserScreen, LoginUserScreen as default};
|
||||
export { LoginUserScreen, LoginUserScreen as default };
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
import _ from '_';
|
||||
|
||||
import {Focused, Capa, ClientSideKeyName, Magics} from 'Common/Enums';
|
||||
import {$html, leftPanelDisabled, leftPanelType, moveAction, bMobileDevice} from 'Common/Globals';
|
||||
import {pString, pInt, decodeURI, windowResizeCallback} from 'Common/Utils';
|
||||
import {getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName} from 'Common/Cache';
|
||||
import {i18n} from 'Common/Translator';
|
||||
import { Focused, Capa, ClientSideKeyName, Magics } from 'Common/Enums';
|
||||
import { $html, leftPanelDisabled, leftPanelType, moveAction, bMobileDevice } from 'Common/Globals';
|
||||
import { pString, pInt, decodeURI, windowResizeCallback } from 'Common/Utils';
|
||||
import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
||||
import * as Events from 'Common/Events';
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
|
@ -16,19 +15,18 @@ import SettingsStore from 'Stores/User/Settings';
|
|||
import FolderStore from 'Stores/User/Folder';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
import {SystemDropDownMailBoxUserView} from 'View/User/MailBox/SystemDropDown';
|
||||
import {FolderListMailBoxUserView} from 'View/User/MailBox/FolderList';
|
||||
import {MessageListMailBoxUserView} from 'View/User/MailBox/MessageList';
|
||||
import {MessageViewMailBoxUserView} from 'View/User/MailBox/MessageView';
|
||||
import { SystemDropDownMailBoxUserView } from 'View/User/MailBox/SystemDropDown';
|
||||
import { FolderListMailBoxUserView } from 'View/User/MailBox/FolderList';
|
||||
import { MessageListMailBoxUserView } from 'View/User/MailBox/MessageList';
|
||||
import { MessageViewMailBoxUserView } from 'View/User/MailBox/MessageView';
|
||||
|
||||
import {getApp} from 'Helper/Apps/User';
|
||||
import { getApp } from 'Helper/Apps/User';
|
||||
|
||||
import {warmUpScreenPopup} from 'Knoin/Knoin';
|
||||
import { warmUpScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import {AbstractScreen} from 'Knoin/AbstractScreen';
|
||||
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||
|
||||
class MailBoxUserScreen extends AbstractScreen
|
||||
{
|
||||
class MailBoxUserScreen extends AbstractScreen {
|
||||
constructor() {
|
||||
super('mailbox', [
|
||||
SystemDropDownMailBoxUserView,
|
||||
|
|
@ -45,12 +43,16 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
let foldersInboxUnreadCount = FolderStore.foldersInboxUnreadCount();
|
||||
const email = AccountStore.email();
|
||||
|
||||
if (Settings.appSettingsGet('listPermanentFiltered'))
|
||||
{
|
||||
if (Settings.appSettingsGet('listPermanentFiltered')) {
|
||||
foldersInboxUnreadCount = 0;
|
||||
}
|
||||
|
||||
getApp().setWindowTitle(('' === email ? '' : '' + (0 < foldersInboxUnreadCount ? '(' + foldersInboxUnreadCount + ') ' : ' ') + email + ' - ') + i18n('TITLES/MAILBOX'));
|
||||
getApp().setWindowTitle(
|
||||
('' === email
|
||||
? ''
|
||||
: '' + (0 < foldersInboxUnreadCount ? '(' + foldersInboxUnreadCount + ') ' : ' ') + email + ' - ') +
|
||||
i18n('TITLES/MAILBOX')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -62,17 +64,13 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
AppStore.focusedState(Focused.None);
|
||||
AppStore.focusedState(Focused.MessageList);
|
||||
|
||||
if (Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
if (Settings.appSettingsGet('mobile')) {
|
||||
leftPanelDisabled(true);
|
||||
}
|
||||
|
||||
if (!Settings.capa(Capa.Folders))
|
||||
{
|
||||
if (!Settings.capa(Capa.Folders)) {
|
||||
leftPanelType(Settings.capa(Capa.Composer) || Settings.capa(Capa.Contacts) ? 'short' : 'none');
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
leftPanelType('');
|
||||
}
|
||||
}
|
||||
|
|
@ -87,10 +85,8 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
let threadUid = folderHash.replace(/^(.+)~([\d]+)$/, '$2');
|
||||
const folder = getFolderFromCacheList(getFolderFullNameRaw(folderHash.replace(/~([\d]+)$/, '')));
|
||||
|
||||
if (folder)
|
||||
{
|
||||
if (folderHash === threadUid)
|
||||
{
|
||||
if (folder) {
|
||||
if (folderHash === threadUid) {
|
||||
threadUid = '';
|
||||
}
|
||||
|
||||
|
|
@ -121,8 +117,7 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
|
||||
const email = AccountStore.email();
|
||||
_.each(AccountStore.accounts(), (item) => {
|
||||
if (item && email === item.email)
|
||||
{
|
||||
if (item && email === item.email) {
|
||||
item.count(count);
|
||||
}
|
||||
});
|
||||
|
|
@ -135,8 +130,7 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
* @returns {void}
|
||||
*/
|
||||
onBuild() {
|
||||
if (!bMobileDevice && !Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
if (!bMobileDevice && !Settings.appSettingsGet('mobile')) {
|
||||
_.defer(() => {
|
||||
getApp().initHorizontalLayoutResizer(ClientSideKeyName.MessageListSize);
|
||||
});
|
||||
|
|
@ -151,16 +145,14 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
* @returns {Array}
|
||||
*/
|
||||
routes() {
|
||||
const
|
||||
inboxFolderName = getFolderInboxName(),
|
||||
const inboxFolderName = getFolderInboxName(),
|
||||
fNormS = (request, vals) => {
|
||||
vals[0] = pString(vals[0]);
|
||||
vals[1] = pInt(vals[1]);
|
||||
vals[1] = 0 >= vals[1] ? 1 : vals[1];
|
||||
vals[2] = pString(vals[2]);
|
||||
|
||||
if ('' === request)
|
||||
{
|
||||
if ('' === request) {
|
||||
vals[0] = inboxFolderName;
|
||||
vals[1] = 1;
|
||||
}
|
||||
|
|
@ -171,8 +163,7 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
vals[0] = pString(vals[0]);
|
||||
vals[1] = pString(vals[1]);
|
||||
|
||||
if ('' === request)
|
||||
{
|
||||
if ('' === request) {
|
||||
vals[0] = inboxFolderName;
|
||||
}
|
||||
|
||||
|
|
@ -180,12 +171,12 @@ class MailBoxUserScreen extends AbstractScreen
|
|||
};
|
||||
|
||||
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}]
|
||||
[/^([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 }]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export {MailBoxUserScreen, MailBoxUserScreen as default};
|
||||
export { MailBoxUserScreen, MailBoxUserScreen as default };
|
||||
|
|
|
|||
|
|
@ -1,135 +1,127 @@
|
|||
|
||||
import {Capa, KeyState} from 'Common/Enums';
|
||||
import {keyScope, leftPanelType, leftPanelDisabled} from 'Common/Globals';
|
||||
import {runSettingsViewModelHooks} from 'Common/Plugins';
|
||||
import {initOnStartOrLangChange, i18n} from 'Common/Translator';
|
||||
import { Capa, KeyState } from 'Common/Enums';
|
||||
import { keyScope, leftPanelType, leftPanelDisabled } from 'Common/Globals';
|
||||
import { runSettingsViewModelHooks } from 'Common/Plugins';
|
||||
import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||
|
||||
import AppStore from 'Stores/User/App';
|
||||
import AccountStore from 'Stores/User/Account';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
import {addSettingsViewModel} from 'Knoin/Knoin';
|
||||
import { addSettingsViewModel } from 'Knoin/Knoin';
|
||||
|
||||
import {AbstractSettingsScreen} from 'Screen/AbstractSettings';
|
||||
import { AbstractSettingsScreen } from 'Screen/AbstractSettings';
|
||||
|
||||
import {GeneralUserSettings} from 'Settings/User/General';
|
||||
import {ContactsUserSettings} from 'Settings/User/Contacts';
|
||||
import {AccountsUserSettings} from 'Settings/User/Accounts';
|
||||
import {FiltersUserSettings} from 'Settings/User/Filters';
|
||||
import {SecurityUserSettings} from 'Settings/User/Security';
|
||||
import {SocialUserSettings} from 'Settings/User/Social';
|
||||
import {ChangePasswordUserSettings} from 'Settings/User/ChangePassword';
|
||||
import {TemplatesUserSettings} from 'Settings/User/Templates';
|
||||
import {FoldersUserSettings} from 'Settings/User/Folders';
|
||||
import {ThemesUserSettings} from 'Settings/User/Themes';
|
||||
import {OpenPgpUserSettings} from 'Settings/User/OpenPgp';
|
||||
import { GeneralUserSettings } from 'Settings/User/General';
|
||||
import { ContactsUserSettings } from 'Settings/User/Contacts';
|
||||
import { AccountsUserSettings } from 'Settings/User/Accounts';
|
||||
import { FiltersUserSettings } from 'Settings/User/Filters';
|
||||
import { SecurityUserSettings } from 'Settings/User/Security';
|
||||
import { SocialUserSettings } from 'Settings/User/Social';
|
||||
import { ChangePasswordUserSettings } from 'Settings/User/ChangePassword';
|
||||
import { TemplatesUserSettings } from 'Settings/User/Templates';
|
||||
import { FoldersUserSettings } from 'Settings/User/Folders';
|
||||
import { ThemesUserSettings } from 'Settings/User/Themes';
|
||||
import { OpenPgpUserSettings } from 'Settings/User/OpenPgp';
|
||||
|
||||
import {SystemDropDownSettingsUserView} from 'View/User/Settings/SystemDropDown';
|
||||
import {MenuSettingsUserView} from 'View/User/Settings/Menu';
|
||||
import {PaneSettingsUserView} from 'View/User/Settings/Pane';
|
||||
import { SystemDropDownSettingsUserView } from 'View/User/Settings/SystemDropDown';
|
||||
import { MenuSettingsUserView } from 'View/User/Settings/Menu';
|
||||
import { PaneSettingsUserView } from 'View/User/Settings/Pane';
|
||||
|
||||
import {getApp} from 'Helper/Apps/User';
|
||||
import { getApp } from 'Helper/Apps/User';
|
||||
|
||||
class SettingsUserScreen extends AbstractSettingsScreen
|
||||
{
|
||||
class SettingsUserScreen extends AbstractSettingsScreen {
|
||||
constructor() {
|
||||
super([
|
||||
SystemDropDownSettingsUserView,
|
||||
MenuSettingsUserView,
|
||||
PaneSettingsUserView
|
||||
]);
|
||||
super([SystemDropDownSettingsUserView, MenuSettingsUserView, PaneSettingsUserView]);
|
||||
|
||||
initOnStartOrLangChange(() => {
|
||||
this.sSettingsTitle = i18n('TITLES/SETTINGS');
|
||||
}, () => {
|
||||
this.setSettingsTitle();
|
||||
});
|
||||
initOnStartOrLangChange(
|
||||
() => {
|
||||
this.sSettingsTitle = i18n('TITLES/SETTINGS');
|
||||
},
|
||||
() => {
|
||||
this.setSettingsTitle();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Function=} fCallback
|
||||
*/
|
||||
setupSettings(fCallback = null) {
|
||||
if (!Settings.capa(Capa.Settings))
|
||||
{
|
||||
if (fCallback)
|
||||
{
|
||||
if (!Settings.capa(Capa.Settings)) {
|
||||
if (fCallback) {
|
||||
fCallback();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
addSettingsViewModel(GeneralUserSettings,
|
||||
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
addSettingsViewModel(GeneralUserSettings, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
|
||||
if (AppStore.contactsIsAllowed())
|
||||
{
|
||||
addSettingsViewModel(ContactsUserSettings,
|
||||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
if (AppStore.contactsIsAllowed()) {
|
||||
addSettingsViewModel(ContactsUserSettings, 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.AdditionalAccounts) || Settings.capa(Capa.Identities))
|
||||
{
|
||||
addSettingsViewModel(AccountsUserSettings, 'SettingsAccounts',
|
||||
Settings.capa(Capa.AdditionalAccounts) ? 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME' : 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'accounts');
|
||||
if (Settings.capa(Capa.AdditionalAccounts) || Settings.capa(Capa.Identities)) {
|
||||
addSettingsViewModel(
|
||||
AccountsUserSettings,
|
||||
'SettingsAccounts',
|
||||
Settings.capa(Capa.AdditionalAccounts)
|
||||
? 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME'
|
||||
: 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME',
|
||||
'accounts'
|
||||
);
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.Sieve))
|
||||
{
|
||||
addSettingsViewModel(FiltersUserSettings,
|
||||
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||
if (Settings.capa(Capa.Sieve)) {
|
||||
addSettingsViewModel(FiltersUserSettings, 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.AutoLogout) || Settings.capa(Capa.TwoFactor))
|
||||
{
|
||||
addSettingsViewModel(SecurityUserSettings,
|
||||
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
if (Settings.capa(Capa.AutoLogout) || Settings.capa(Capa.TwoFactor)) {
|
||||
addSettingsViewModel(SecurityUserSettings, 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
}
|
||||
|
||||
if (AccountStore.isRootAccount() && (
|
||||
(Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) ||
|
||||
Settings.settingsGet('AllowFacebookSocial') ||
|
||||
Settings.settingsGet('AllowTwitterSocial')))
|
||||
{
|
||||
addSettingsViewModel(SocialUserSettings,
|
||||
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
if (
|
||||
AccountStore.isRootAccount() &&
|
||||
((Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) ||
|
||||
Settings.settingsGet('AllowFacebookSocial') ||
|
||||
Settings.settingsGet('AllowTwitterSocial'))
|
||||
) {
|
||||
addSettingsViewModel(SocialUserSettings, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
}
|
||||
|
||||
if (Settings.settingsGet('ChangePasswordIsAllowed'))
|
||||
{
|
||||
addSettingsViewModel(ChangePasswordUserSettings,
|
||||
'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password');
|
||||
if (Settings.settingsGet('ChangePasswordIsAllowed')) {
|
||||
addSettingsViewModel(
|
||||
ChangePasswordUserSettings,
|
||||
'SettingsChangePassword',
|
||||
'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME',
|
||||
'change-password'
|
||||
);
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.Templates))
|
||||
{
|
||||
addSettingsViewModel(TemplatesUserSettings,
|
||||
'SettingsTemplates', 'SETTINGS_LABELS/LABEL_TEMPLATES_NAME', 'templates');
|
||||
if (Settings.capa(Capa.Templates)) {
|
||||
addSettingsViewModel(
|
||||
TemplatesUserSettings,
|
||||
'SettingsTemplates',
|
||||
'SETTINGS_LABELS/LABEL_TEMPLATES_NAME',
|
||||
'templates'
|
||||
);
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.Folders))
|
||||
{
|
||||
addSettingsViewModel(FoldersUserSettings,
|
||||
'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||
if (Settings.capa(Capa.Folders)) {
|
||||
addSettingsViewModel(FoldersUserSettings, 'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.Themes))
|
||||
{
|
||||
addSettingsViewModel(ThemesUserSettings,
|
||||
'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
if (Settings.capa(Capa.Themes)) {
|
||||
addSettingsViewModel(ThemesUserSettings, 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.OpenPGP))
|
||||
{
|
||||
addSettingsViewModel(OpenPgpUserSettings,
|
||||
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||
if (Settings.capa(Capa.OpenPGP)) {
|
||||
addSettingsViewModel(OpenPgpUserSettings, 'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||
}
|
||||
|
||||
runSettingsViewModelHooks(false);
|
||||
|
||||
if (fCallback)
|
||||
{
|
||||
if (fCallback) {
|
||||
fCallback();
|
||||
}
|
||||
|
||||
|
|
@ -141,8 +133,7 @@ class SettingsUserScreen extends AbstractSettingsScreen
|
|||
keyScope(KeyState.Settings);
|
||||
leftPanelType('');
|
||||
|
||||
if (Settings.appSettingsGet('mobile'))
|
||||
{
|
||||
if (Settings.appSettingsGet('mobile')) {
|
||||
leftPanelDisabled(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -153,4 +144,4 @@ class SettingsUserScreen extends AbstractSettingsScreen
|
|||
}
|
||||
}
|
||||
|
||||
export {SettingsUserScreen, SettingsUserScreen as default};
|
||||
export { SettingsUserScreen, SettingsUserScreen as default };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue