mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
This version uses Rollup instead of WebPack.
Due to that the code is smaller and has changes to prevent Circular Dependencies
This commit is contained in:
parent
5e63ade9dd
commit
ad8fd8879b
49 changed files with 595 additions and 577 deletions
|
|
@ -13,13 +13,22 @@ import { initOnStartOrLangChange } from 'Common/Translator';
|
|||
import LanguageStore from 'Stores/Language';
|
||||
import ThemeStore from 'Stores/Theme';
|
||||
|
||||
import SaveTriggerComponent from 'Component/SaveTrigger';
|
||||
import InputComponent from 'Component/Input';
|
||||
import SelectComponent from 'Component/Select';
|
||||
import TextAreaComponent from 'Component/TextArea';
|
||||
import CheckboxMaterialDesignComponent from 'Component/MaterialDesign/Checkbox';
|
||||
import CheckboxComponent from 'Component/Checkbox';
|
||||
|
||||
const Settings = rl.settings, doc = document;
|
||||
|
||||
export class AbstractApp {
|
||||
/**
|
||||
* @param {RemoteStorage|AdminRemoteStorage} Remote
|
||||
*/
|
||||
constructor() {
|
||||
constructor(Remote) {
|
||||
this.Remote = Remote;
|
||||
|
||||
const refresh = (()=>dispatchEvent(new CustomEvent('rl.auto-logout-refresh'))).debounce(5000),
|
||||
fn = (ev=>{
|
||||
$htmlCL.toggle('rl-ctrl-key-pressed', ev.ctrlKey);
|
||||
|
|
@ -81,17 +90,15 @@ export class AbstractApp {
|
|||
bootstart() {
|
||||
const mobile = Settings.app('mobile');
|
||||
|
||||
ko.components.register('SaveTrigger', require('Component/SaveTrigger').default);
|
||||
ko.components.register('Input', require('Component/Input').default);
|
||||
ko.components.register('Select', require('Component/Select').default);
|
||||
ko.components.register('TextArea', require('Component/TextArea').default);
|
||||
|
||||
ko.components.register('SaveTrigger', SaveTriggerComponent);
|
||||
ko.components.register('Input', InputComponent);
|
||||
ko.components.register('Select', SelectComponent);
|
||||
ko.components.register('TextArea', TextAreaComponent);
|
||||
ko.components.register('CheckboxSimple', CheckboxComponent);
|
||||
if (Settings.app('materialDesign') && !rl.settings.app('mobile')) {
|
||||
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox').default);
|
||||
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
||||
ko.components.register('Checkbox', CheckboxMaterialDesignComponent);
|
||||
} else {
|
||||
ko.components.register('Checkbox', require('Component/Checkbox').default);
|
||||
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
||||
ko.components.register('Checkbox', CheckboxComponent);
|
||||
}
|
||||
|
||||
initOnStartOrLangChange();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import ko from 'External/User/ko'; // eslint-disable-line no-unused-vars
|
||||
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
import { isPosNumeric, delegateRunOnDestroy, mailToHelper } from 'Common/UtilsUser';
|
||||
|
||||
|
|
@ -67,7 +69,10 @@ import { startScreens, showScreenPopup } from 'Knoin/Knoin';
|
|||
|
||||
import { AbstractApp } from 'App/Abstract';
|
||||
|
||||
require('External/User/ko');
|
||||
import { ComposePopupView } from 'View/Popup/Compose';
|
||||
import { FolderSystemPopupView } from 'View/Popup/FolderSystem';
|
||||
import { AskPopupView } from 'View/Popup/Ask';
|
||||
import { TwoFactorConfigurationPopupView } from 'View/Popup/TwoFactorConfiguration';
|
||||
|
||||
const doc = document,
|
||||
Settings = rl.settings;
|
||||
|
|
@ -329,13 +334,13 @@ class AppUser extends AbstractApp {
|
|||
}
|
||||
|
||||
if (!oMoveFolder && bUseFolder) {
|
||||
showScreenPopup(require('View/Popup/FolderSystem'), [nSetSystemFoldersNotification]);
|
||||
showScreenPopup(FolderSystemPopupView, [nSetSystemFoldersNotification]);
|
||||
} else if (
|
||||
!bUseFolder ||
|
||||
(FolderType.Trash === iDeleteType &&
|
||||
(sFromFolderFullNameRaw === FolderStore.spamFolder() || sFromFolderFullNameRaw === FolderStore.trashFolder()))
|
||||
) {
|
||||
showScreenPopup(require('View/Popup/Ask'), [
|
||||
showScreenPopup(AskPopupView, [
|
||||
i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'),
|
||||
() => {
|
||||
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
|
|
@ -918,7 +923,7 @@ class AppUser extends AbstractApp {
|
|||
Settings.get('RequireTwoFactor')
|
||||
) {
|
||||
this.bootend();
|
||||
showScreenPopup(require('View/Popup/TwoFactorConfiguration'), [true]);
|
||||
showScreenPopup(TwoFactorConfigurationPopupView, [true]);
|
||||
} else {
|
||||
rl.setWindowTitle(i18n('GLOBAL/LOADING'));
|
||||
|
||||
|
|
@ -1022,7 +1027,7 @@ class AppUser extends AbstractApp {
|
|||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (Settings.get('MailToEmail')) {
|
||||
mailToHelper(Settings.get('MailToEmail'), require('View/Popup/Compose'));
|
||||
mailToHelper(Settings.get('MailToEmail'), ComposePopupView);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
|
@ -1047,6 +1052,11 @@ class AppUser extends AbstractApp {
|
|||
|
||||
setInterval(() => dispatchEvent(new CustomEvent('reload-time')), 60000);
|
||||
}
|
||||
|
||||
showComposePopupView(params = [])
|
||||
{
|
||||
showScreenPopup(ComposePopupView, params);
|
||||
}
|
||||
}
|
||||
|
||||
export default new AppUser();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue