Remove Common/Enums Magics.*

This commit is contained in:
djmaze 2020-08-13 22:58:41 +02:00
parent 382aef7ebb
commit 6541a1de7c
38 changed files with 135 additions and 219 deletions

View file

@ -10,7 +10,7 @@ import {
import { isNormal, pString, detectDropdownVisibility, windowResizeCallback } from 'Common/Utils'; import { isNormal, pString, detectDropdownVisibility, windowResizeCallback } from 'Common/Utils';
import { KeyState, Magics } from 'Common/Enums'; import { KeyState } from 'Common/Enums';
import { root, rootAdmin, rootUser, populateAuthSuffix } from 'Common/Links'; import { root, rootAdmin, rootUser, populateAuthSuffix } from 'Common/Links';
import { initOnStartOrLangChange, initNotificationLanguage } from 'Common/Translator'; import { initOnStartOrLangChange, initNotificationLanguage } from 'Common/Translator';
import * as Events from 'Common/Events'; import * as Events from 'Common/Events';
@ -32,9 +32,7 @@ class AbstractApp extends AbstractBoot {
this.isLocalAutocomplete = true; this.isLocalAutocomplete = true;
this.lastErrorTime = 0; this.lastErrorTime = 0;
addEventListener('resize', () => { addEventListener('resize', () => Events.pub('window.resize'));
Events.pub('window.resize');
});
var t; var t;
Events.sub( Events.sub(
@ -53,7 +51,7 @@ class AbstractApp extends AbstractBoot {
Events.pub('window.resize.real'); Events.pub('window.resize.real');
} }
t = 0; t = 0;
}, Magics.Time50ms); }, 50);
} }
} }
); );
@ -84,7 +82,7 @@ class AbstractApp extends AbstractBoot {
const fn = ()=>{ const fn = ()=>{
// debounce // debounce
d && clearTimeout(d); d && clearTimeout(d);
d = setTimeout(()=>Events.pub('rl.auto-logout-refresh'), Magics.Time5s); d = setTimeout(()=>Events.pub('rl.auto-logout-refresh'), 5000);
} }
$doc.addEventListener('mousemove', fn); $doc.addEventListener('mousemove', fn);
@ -141,7 +139,7 @@ class AbstractApp extends AbstractBoot {
redirectToAdminPanel() { redirectToAdminPanel() {
setTimeout(() => { setTimeout(() => {
location.href = rootAdmin(); location.href = rootAdmin();
}, Magics.Time100ms); }, 100);
} }
clearClientSideToken() { clearClientSideToken() {
@ -190,7 +188,7 @@ class AbstractApp extends AbstractBoot {
} }
$win.trigger('rl.tooltips.diactivate'); $win.trigger('rl.tooltips.diactivate');
}, Magics.Time100ms); }, 100);
} else { } else {
routeOff(); routeOff();
setHash(root(), true); setHash(root(), true);
@ -204,7 +202,7 @@ class AbstractApp extends AbstractBoot {
} }
$win.trigger('rl.tooltips.diactivate'); $win.trigger('rl.tooltips.diactivate');
}, Magics.Time100ms); }, 100);
} }
} }
@ -239,15 +237,11 @@ class AbstractApp extends AbstractBoot {
initOnStartOrLangChange(initNotificationLanguage); initOnStartOrLangChange(initNotificationLanguage);
setTimeout(windowResizeCallback, Magics.Time1s); setTimeout(windowResizeCallback, 1000);
Events.sub('ssm.mobile-enter', () => { Events.sub('ssm.mobile-enter', () => leftPanelDisabled(true));
leftPanelDisabled(true);
});
Events.sub('ssm.mobile-leave', () => { Events.sub('ssm.mobile-leave', () => leftPanelDisabled(false));
leftPanelDisabled(false);
});
if (!mobile) { if (!mobile) {
$htmlCL.add('rl-desktop'); $htmlCL.add('rl-desktop');
@ -268,34 +262,22 @@ class AbstractApp extends AbstractBoot {
ssm.addState({ ssm.addState({
id: 'tablet', id: 'tablet',
query: '(min-width: 768px) and (max-width: 999px)', query: '(min-width: 768px) and (max-width: 999px)',
onEnter: () => { onEnter: () => $htmlCL.add('ssm-state-tablet'),
$htmlCL.add('ssm-state-tablet'); onLeave: () => $htmlCL.remove('ssm-state-tablet')
},
onLeave: () => {
$htmlCL.remove('ssm-state-tablet');
}
}); });
ssm.addState({ ssm.addState({
id: 'desktop', id: 'desktop',
query: '(min-width: 1000px) and (max-width: 1400px)', query: '(min-width: 1000px) and (max-width: 1400px)',
onEnter: () => { onEnter: () => $htmlCL.add('ssm-state-desktop'),
$htmlCL.add('ssm-state-desktop'); onLeave: () => $htmlCL.remove('ssm-state-desktop')
},
onLeave: () => {
$htmlCL.remove('ssm-state-desktop');
}
}); });
ssm.addState({ ssm.addState({
id: 'desktop-large', id: 'desktop-large',
query: '(min-width: 1401px)', query: '(min-width: 1401px)',
onEnter: () => { onEnter: () => $htmlCL.add('ssm-state-desktop-large'),
$htmlCL.add('ssm-state-desktop-large'); onLeave: () => $htmlCL.remove('ssm-state-desktop-large')
},
onLeave: () => {
$htmlCL.remove('ssm-state-desktop-large');
}
}); });
} else { } else {
$htmlCL.add('ssm-state-mobile', 'rl-mobile'); $htmlCL.add('ssm-state-mobile', 'rl-mobile');

View file

@ -16,8 +16,7 @@ import {
FolderType, FolderType,
SetSystemFoldersNotification, SetSystemFoldersNotification,
MessageSetAction, MessageSetAction,
ClientSideKeyName, ClientSideKeyName
Magics
} from 'Common/Enums'; } from 'Common/Enums';
import { $htmlCL, leftPanelDisabled, bMobileDevice } from 'Common/Globals'; import { $htmlCL, leftPanelDisabled, bMobileDevice } from 'Common/Globals';
@ -125,29 +124,26 @@ class AppUser extends AbstractApp {
this.quotaDebounce = ()=>{ this.quotaDebounce = ()=>{
// debounce // debounce
qd && clearTimeout(qd); qd && clearTimeout(qd);
qd = setTimeout(o.quota, Magics.Time30s); qd = setTimeout(o.quota, 30000);
}; };
this.moveOrDeleteResponseHelper = this.moveOrDeleteResponseHelper.bind(this); this.moveOrDeleteResponseHelper = this.moveOrDeleteResponseHelper.bind(this);
setInterval(() => Events.pub('interval.30s'), Magics.Time30s); setInterval(() => Events.pub('interval.30s'), 30000);
setInterval(() => Events.pub('interval.1m'), Magics.Time1m); setInterval(() => Events.pub('interval.1m'), 60000);
setInterval(() => Events.pub('interval.2m'), Magics.Time2m); setInterval(() => Events.pub('interval.2m'), 120000);
setInterval(() => Events.pub('interval.3m'), Magics.Time3m); setInterval(() => Events.pub('interval.3m'), 180000);
setInterval(() => Events.pub('interval.5m'), Magics.Time5m); setInterval(() => Events.pub('interval.5m'), 300000);
setInterval(() => Events.pub('interval.10m'), Magics.Time10m); setInterval(() => Events.pub('interval.10m'), 600000);
setInterval(() => Events.pub('interval.15m'), Magics.Time15m); setInterval(() => Events.pub('interval.15m'), 900000);
setInterval(() => Events.pub('interval.20m'), Magics.Time20m); setInterval(() => Events.pub('interval.20m'), 1200000);
setTimeout(() => setInterval(() => Events.pub('interval.2m-after5m'), Magics.Time2m), Magics.Time5m); setTimeout(() => setInterval(() => Events.pub('interval.2m-after5m'), 120000), 300000);
setTimeout(() => setInterval(() => Events.pub('interval.5m-after5m'), Magics.Time5m), Magics.Time5m); setTimeout(() => setInterval(() => Events.pub('interval.5m-after5m'), 300000), 300000);
setTimeout( setTimeout(() => setInterval(() => Events.pub('interval.10m-after5m'), 600000), 300000);
() => setInterval(() => Events.pub('interval.10m-after5m'), Magics.Time10m),
Magics.Time5m
);
// wakeUp // wakeUp
const interval = Magics.Time60m; const interval = 3600000; // 60m
var lastTime = (new Date()).getTime(); var lastTime = (new Date()).getTime();
setInterval(() => { setInterval(() => {
const currentTime = (new Date()).getTime(); const currentTime = (new Date()).getTime();
@ -175,7 +171,7 @@ class AppUser extends AbstractApp {
$htmlCL.add('UserBackground'); $htmlCL.add('UserBackground');
doc.body.style.backgroundImage = "url("+img+")"; doc.body.style.backgroundImage = "url("+img+")";
} }
}, Magics.Time1s); }, 1000);
} }
} }
@ -1145,8 +1141,8 @@ class AppUser extends AbstractApp {
contactsSyncInterval = 5 <= contactsSyncInterval ? contactsSyncInterval : 20; contactsSyncInterval = 5 <= contactsSyncInterval ? contactsSyncInterval : 20;
contactsSyncInterval = 320 >= contactsSyncInterval ? contactsSyncInterval : 320; contactsSyncInterval = 320 >= contactsSyncInterval ? contactsSyncInterval : 320;
setTimeout(() => this.contactsSync(), Magics.Time10s); setTimeout(() => this.contactsSync(), 10000);
setTimeout(() => this.folderInformationMultiply(true), Magics.Time2s); setTimeout(() => this.folderInformationMultiply(true), 2000);
setInterval(() => this.contactsSync(), contactsSyncInterval * 60000 + 5000); setInterval(() => this.contactsSync(), contactsSyncInterval * 60000 + 5000);

View file

@ -455,48 +455,6 @@ export const ContactPropertyType = {
'Custom': 250 'Custom': 250
}; };
/**
* @enum {number}
*/
export const Magics = {
'EventWhichMouseMiddle': 3,
'BitLength2048': 2048,
'BitLength1024': 1024,
'Size350px': 350,
'Size50px': 50,
'Size20px': 20,
'Size1px': 1,
'Time30mInMin': 30,
'Time60m': 60000 * 60,
'Time30m': 60000 * 30,
'Time20m': 60000 * 20,
'Time15m': 60000 * 15,
'Time10m': 60000 * 10,
'Time5m': 60000 * 5,
'Time3m': 60000 * 3,
'Time2m': 60000 * 2,
'Time1m': 60000,
'Time30s': 30000,
'Time10s': 10000,
'Time7s': 7000,
'Time5s': 5000,
'Time3s': 3000,
'Time1s': 1000,
'Time500ms': 500,
'Time350ms': 350,
'Time250ms': 250,
'Time200ms': 200,
'Time100ms': 100,
'Time50ms': 50,
'Time20ms': 20,
'Time10ms': 10,
'Time1ms': 1
};
/** /**
* @enum {number} * @enum {number}
*/ */

View file

@ -1,5 +1,5 @@
import { htmlEditorDefaultConfig, htmlEditorLangsMap } from 'Common/Globals'; import { htmlEditorDefaultConfig, htmlEditorLangsMap } from 'Common/Globals';
import { EventKeyCode, Magics } from 'Common/Enums'; import { EventKeyCode } from 'Common/Enums';
import * as Settings from 'Storage/Settings'; import * as Settings from 'Storage/Settings';
class HtmlEditor { class HtmlEditor {
@ -57,7 +57,7 @@ class HtmlEditor {
clearTimeout(this.blurTimer); clearTimeout(this.blurTimer);
this.blurTimer = setTimeout(() => { this.blurTimer = setTimeout(() => {
this.runOnBlur(); this.runOnBlur();
}, Magics.Time200ms); }, 200);
} }
} }

6
dev/External/ko.js vendored
View file

@ -1,4 +1,4 @@
import { SaveSettingsStep, Magics } from 'Common/Enums'; import { SaveSettingsStep } from 'Common/Enums';
const const
$ = jQuery, $ = jQuery,
@ -152,7 +152,7 @@ ko.bindingHandlers.tooltipErrorTip = {
value = !ko.isObservable(fValue) && isFunction(fValue) ? fValue() : ko.unwrap(fValue); value = !ko.isObservable(fValue) && isFunction(fValue) ? fValue() : ko.unwrap(fValue);
if (value) { if (value) {
setTimeout(() => element.setAttribute('data-rainloopErrorTip', value), Magics.Time100ms); setTimeout(() => element.setAttribute('data-rainloopErrorTip', value), 100);
} else { } else {
element.removeAttribute('data-rainloopErrorTip'); element.removeAttribute('data-rainloopErrorTip');
} }
@ -329,7 +329,7 @@ ko.bindingHandlers.modal = {
Globals.$htmlCL.add('rl-modal-animation'); Globals.$htmlCL.add('rl-modal-animation');
setTimeout(() => { setTimeout(() => {
Globals.$htmlCL.remove('rl-modal-animation'); Globals.$htmlCL.remove('rl-modal-animation');
}, Magics.Time500ms); }, 500);
} }
} }
}; };

View file

@ -1,6 +1,5 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
import { runHook } from 'Common/Plugins'; import { runHook } from 'Common/Plugins';
import { $htmlCL, VIEW_MODELS, popupVisibilityNames } from 'Common/Globals'; import { $htmlCL, VIEW_MODELS, popupVisibilityNames } from 'Common/Globals';
@ -548,7 +547,7 @@ function settingsMenuKeysHandler($items) {
} }
} }
t = 0; t = 0;
}, Magics.Time200ms); }, 200);
} }
}; };
} }

View file

@ -1,4 +1,4 @@
import { Focused, Capa, ClientSideKeyName, Magics } from 'Common/Enums'; import { Focused, Capa, ClientSideKeyName } from 'Common/Enums';
import { $html, leftPanelDisabled, leftPanelType, moveAction, bMobileDevice } from 'Common/Globals'; import { $html, leftPanelDisabled, leftPanelType, moveAction, bMobileDevice } from 'Common/Globals';
import { pString, pInt, windowResizeCallback } from 'Common/Utils'; import { pString, pInt, windowResizeCallback } from 'Common/Utils';
import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache'; import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache';
@ -107,8 +107,8 @@ class MailBoxUserScreen extends AbstractScreen {
MessageStore.messageList.subscribe(windowResizeCallback); MessageStore.messageList.subscribe(windowResizeCallback);
MessageStore.message.subscribe(windowResizeCallback); MessageStore.message.subscribe(windowResizeCallback);
setTimeout(() => SettingsStore.layout.valueHasMutated(), Magics.Time50ms); setTimeout(() => SettingsStore.layout.valueHasMutated(), 50);
setTimeout(() => warmUpScreenPopup(require('View/Popup/Compose')), Magics.Time500ms); setTimeout(() => warmUpScreenPopup(require('View/Popup/Compose')), 500);
Events.sub('mailbox.inbox-unread-count', (count) => { Events.sub('mailbox.inbox-unread-count', (count) => {
FolderStore.foldersInboxUnreadCount(count); FolderStore.foldersInboxUnreadCount(count);

View file

@ -1,6 +1,5 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
import { settingsSaveHelperSimpleFunction } from 'Common/Utils'; import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
import { i18n, trigger as translatorTrigger } from 'Common/Translator'; import { i18n, trigger as translatorTrigger } from 'Common/Translator';
@ -62,7 +61,7 @@ class BrandingAdminSettings {
'FaviconUrl': value.trim() 'FaviconUrl': value.trim()
}); });
}); });
}, Magics.Time50ms); }, 50);
} }
} }

View file

@ -2,7 +2,7 @@ import ko from 'ko';
import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender } from 'Common/Utils'; import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender } from 'Common/Utils';
import { SaveSettingsStep, StorageResultType, Magics } from 'Common/Enums'; import { SaveSettingsStep, StorageResultType } from 'Common/Enums';
import { i18n } from 'Common/Translator'; import { i18n } from 'Common/Translator';
import { settingsGet } from 'Storage/Settings'; import { settingsGet } from 'Storage/Settings';
import Remote from 'Remote/Admin/Ajax'; import Remote from 'Remote/Admin/Ajax';
@ -186,7 +186,7 @@ class ContactsAdminSettings {
}); });
this.contactsType(settingsGet('ContactsPdoType')); this.contactsType(settingsGet('ContactsPdoType'));
}, Magics.Time50ms); }, 50);
} }
} }

View file

@ -8,7 +8,7 @@ import {
convertLangName convertLangName
} from 'Common/Utils'; } from 'Common/Utils';
import { SaveSettingsStep, Magics } from 'Common/Enums'; import { SaveSettingsStep } from 'Common/Enums';
import { reload as translatorReload } from 'Common/Translator'; import { reload as translatorReload } from 'Common/Translator';
import { settingsGet } from 'Storage/Settings'; import { settingsGet } from 'Storage/Settings';
@ -45,7 +45,7 @@ class GeneralAdminSettings {
this.dataFolderAccess = AppAdminStore.dataFolderAccess; this.dataFolderAccess = AppAdminStore.dataFolderAccess;
this.mainAttachmentLimit = ko this.mainAttachmentLimit = ko
.observable(pInt(settingsGet('AttachmentLimit')) / (Magics.BitLength1024 * Magics.BitLength1024)) .observable(pInt(settingsGet('AttachmentLimit')) / (1024 * 1024))
.extend({ posInterer: 25 }); .extend({ posInterer: 25 });
this.uploadData = settingsGet('PhpUploadSizes'); this.uploadData = settingsGet('PhpUploadSizes');
@ -68,7 +68,7 @@ class GeneralAdminSettings {
this.attachmentLimitTrigger = ko.observable(SaveSettingsStep.Idle); this.attachmentLimitTrigger = ko.observable(SaveSettingsStep.Idle);
this.languageTrigger = ko.observable(SaveSettingsStep.Idle); this.languageTrigger = ko.observable(SaveSettingsStep.Idle);
this.languageAdminTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: Magics.Time100ms }); this.languageAdminTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 });
this.themeTrigger = ko.observable(SaveSettingsStep.Idle); this.themeTrigger = ko.observable(SaveSettingsStep.Idle);
} }
@ -79,7 +79,7 @@ class GeneralAdminSettings {
f3 = settingsSaveHelperSimpleFunction(this.themeTrigger, this), f3 = settingsSaveHelperSimpleFunction(this.themeTrigger, this),
fReloadLanguageHelper = (saveSettingsStep) => () => { fReloadLanguageHelper = (saveSettingsStep) => () => {
this.languageAdminTrigger(saveSettingsStep); this.languageAdminTrigger(saveSettingsStep);
setTimeout(() => this.languageAdminTrigger(SaveSettingsStep.Idle), Magics.Time1s); setTimeout(() => this.languageAdminTrigger(SaveSettingsStep.Idle), 1000);
}; };
this.mainAttachmentLimit.subscribe((value) => { this.mainAttachmentLimit.subscribe((value) => {
@ -159,7 +159,7 @@ class GeneralAdminSettings {
'NewMoveToFolder': value ? '1' : '0' 'NewMoveToFolder': value ? '1' : '0'
}); });
}); });
}, Magics.Time50ms); }, 50);
} }
selectLanguage() { selectLanguage() {

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { StorageResultType, Magics } from 'Common/Enums'; import { StorageResultType } from 'Common/Enums';
import { settingsGet } from 'Storage/Settings'; import { settingsGet } from 'Storage/Settings';
@ -105,7 +105,7 @@ class SecurityAdminSettings {
setTimeout(() => { setTimeout(() => {
this.twoFactorDropperUser.focused(true); this.twoFactorDropperUser.focused(true);
}, Magics.Time50ms); }, 50);
} }
onNewAdminPasswordResponse(result, data) { onNewAdminPasswordResponse(result, data) {

View file

@ -1,7 +1,5 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
import AppStore from 'Stores/User/App'; import AppStore from 'Stores/User/App';
import ContactStore from 'Stores/User/Contact'; import ContactStore from 'Stores/User/Contact';
import Remote from 'Remote/User/Ajax'; import Remote from 'Remote/User/Ajax';
@ -25,7 +23,7 @@ class ContactsUserSettings {
this.contactsSyncPass() this.contactsSyncPass()
].join('|') ].join('|')
) )
.extend({ throttle: Magics.Time500ms }); .extend({ throttle: 500 });
} }
onBuild() { onBuild() {

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { ClientSideKeyName, Notification, Magics } from 'Common/Enums'; import { ClientSideKeyName, Notification } from 'Common/Enums';
import { getNotification, i18n } from 'Common/Translator'; import { getNotification, i18n } from 'Common/Translator';
import { removeFolderFromCacheList } from 'Common/Cache'; import { removeFolderFromCacheList } from 'Common/Cache';
@ -22,7 +22,7 @@ class FoldersUserSettings {
this.displaySpecSetting = FolderStore.displaySpecSetting; this.displaySpecSetting = FolderStore.displaySpecSetting;
this.folderList = FolderStore.folderList; this.folderList = FolderStore.folderList;
this.folderListHelp = ko.observable('').extend({ throttle: Magics.Time100ms }); this.folderListHelp = ko.observable('').extend({ throttle: 100 });
this.loading = ko.computed(() => { this.loading = ko.computed(() => {
const loading = FolderStore.foldersLoading(), const loading = FolderStore.foldersLoading(),

View file

@ -2,7 +2,7 @@ import ko from 'ko';
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts'; import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
import { SaveSettingsStep, Magics, EditorDefaultType, Layout } from 'Common/Enums'; import { SaveSettingsStep, EditorDefaultType, Layout } from 'Common/Enums';
import { settingsSaveHelperSimpleFunction, convertLangName, timeOutAction } from 'Common/Utils'; import { settingsSaveHelperSimpleFunction, convertLangName, timeOutAction } from 'Common/Utils';
@ -45,7 +45,7 @@ class GeneralUserSettings {
this.allowLanguagesOnSettings = AppStore.allowLanguagesOnSettings; this.allowLanguagesOnSettings = AppStore.allowLanguagesOnSettings;
this.languageFullName = ko.computed(() => convertLangName(this.language())); this.languageFullName = ko.computed(() => convertLangName(this.language()));
this.languageTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: Magics.Time100ms }); this.languageTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 });
this.mppTrigger = ko.observable(SaveSettingsStep.Idle); this.mppTrigger = ko.observable(SaveSettingsStep.Idle);
this.editorDefaultTypeTrigger = ko.observable(SaveSettingsStep.Idle); this.editorDefaultTypeTrigger = ko.observable(SaveSettingsStep.Idle);
@ -101,7 +101,7 @@ class GeneralUserSettings {
f2 = settingsSaveHelperSimpleFunction(this.layoutTrigger, this), f2 = settingsSaveHelperSimpleFunction(this.layoutTrigger, this),
fReloadLanguageHelper = (saveSettingsStep) => () => { fReloadLanguageHelper = (saveSettingsStep) => () => {
this.languageTrigger(saveSettingsStep); this.languageTrigger(saveSettingsStep);
setTimeout(() => this.languageTrigger(SaveSettingsStep.Idle), Magics.Time1s); setTimeout(() => this.languageTrigger(SaveSettingsStep.Idle), 1000);
}; };
this.language.subscribe((value) => { this.language.subscribe((value) => {
@ -129,7 +129,7 @@ class GeneralUserSettings {
'DesktopNotifications': value ? '1' : '0' 'DesktopNotifications': value ? '1' : '0'
}); });
}, },
Magics.Time3s 3000
); );
}); });
@ -141,7 +141,7 @@ class GeneralUserSettings {
'SoundNotification': value ? '1' : '0' 'SoundNotification': value ? '1' : '0'
}); });
}, },
Magics.Time3s 3000
); );
}); });
@ -153,7 +153,7 @@ class GeneralUserSettings {
'ReplySameFolder': value ? '1' : '0' 'ReplySameFolder': value ? '1' : '0'
}); });
}, },
Magics.Time3s 3000
); );
}); });
@ -170,7 +170,7 @@ class GeneralUserSettings {
'Layout': value 'Layout': value
}); });
}); });
}, Magics.Time50ms); }, 50);
} }
onShow() { onShow() {

View file

@ -1,7 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { delegateRunOnDestroy } from 'Common/Utils'; import { delegateRunOnDestroy } from 'Common/Utils';
import { Magics } from 'Common/Enums';
import PgpStore from 'Stores/User/Pgp'; import PgpStore from 'Stores/User/Pgp';
import SettingsStore from 'Stores/User/Settings'; import SettingsStore from 'Stores/User/Settings';
@ -64,7 +63,7 @@ class OpenPgpUserSettings {
onBuild() { onBuild() {
setTimeout(() => { setTimeout(() => {
this.allowDraftAutosave.subscribe(Remote.saveSettingsHelper('AllowDraftAutosave', v=>v?'1':'0')); this.allowDraftAutosave.subscribe(Remote.saveSettingsHelper('AllowDraftAutosave', v=>v?'1':'0'));
}, Magics.Time50ms); }, 50);
} }
} }

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { SaveSettingsStep, UploadErrorCode, Capa, Magics } from 'Common/Enums'; import { SaveSettingsStep, UploadErrorCode, Capa } from 'Common/Enums';
import { changeTheme, convertThemeName } from 'Common/Utils'; import { changeTheme, convertThemeName } from 'Common/Utils';
import { userBackground, themePreviewLink, uploadBackground } from 'Common/Links'; import { userBackground, themePreviewLink, uploadBackground } from 'Common/Links';
import { i18n } from 'Common/Translator'; import { i18n } from 'Common/Translator';
@ -26,7 +26,7 @@ class ThemesUserSettings {
this.capaUserBackground = ko.observable(capa(Capa.UserBackground)); this.capaUserBackground = ko.observable(capa(Capa.UserBackground));
this.themeTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: Magics.Time100ms }); this.themeTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 });
this.iTimer = 0; this.iTimer = 0;
this.oThemeAjaxRequest = null; this.oThemeAjaxRequest = null;

View file

@ -1,5 +1,4 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
import * as Settings from 'Storage/Settings'; import * as Settings from 'Storage/Settings';
class AccountUserStore { class AccountUserStore {
@ -10,7 +9,7 @@ class AccountUserStore {
this.signature = ko.observable(''); this.signature = ko.observable('');
this.accounts = ko.observableArray([]); this.accounts = ko.observableArray([]);
this.accounts.loading = ko.observable(false).extend({ throttle: Magics.Time100ms }); this.accounts.loading = ko.observable(false).extend({ throttle: 100 });
this.computers(); this.computers();
} }

View file

@ -1,15 +1,14 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
import * as Settings from 'Storage/Settings'; import * as Settings from 'Storage/Settings';
class ContactUserStore { class ContactUserStore {
constructor() { constructor() {
this.contacts = ko.observableArray([]); this.contacts = ko.observableArray([]);
this.contacts.loading = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.contacts.loading = ko.observable(false).extend({ throttle: 200 });
this.contacts.importing = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.contacts.importing = ko.observable(false).extend({ throttle: 200 });
this.contacts.syncing = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.contacts.syncing = ko.observable(false).extend({ throttle: 200 });
this.contacts.exportingVcf = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.contacts.exportingVcf = ko.observable(false).extend({ throttle: 200 });
this.contacts.exportingCsv = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.contacts.exportingCsv = ko.observable(false).extend({ throttle: 200 });
this.allowContactsSync = ko.observable(false); this.allowContactsSync = ko.observable(false);
this.enableContactsSync = ko.observable(false); this.enableContactsSync = ko.observable(false);

View file

@ -1,5 +1,4 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
class FilterUserStore { class FilterUserStore {
constructor() { constructor() {
@ -8,8 +7,8 @@ class FilterUserStore {
this.filters = ko.observableArray([]); this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.filters.loading = ko.observable(false).extend({ throttle: 200 });
this.filters.saving = ko.observable(false).extend({ throttle: Magics.Time200ms }); this.filters.saving = ko.observable(false).extend({ throttle: 200 });
this.raw = ko.observable(''); this.raw = ko.observable('');
} }

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { Magics, Layout, Focused, MessageSetAction, StorageResultType, Notification } from 'Common/Enums'; import { Layout, Focused, MessageSetAction, StorageResultType, Notification } from 'Common/Enums';
import { import {
isNormal, isNormal,
@ -102,7 +102,7 @@ class MessageUserStore {
this.messageCurrentLoading = ko.observable(false); this.messageCurrentLoading = ko.observable(false);
this.messageLoadingThrottle = ko.observable(false).extend({ throttle: Magics.Time50ms }); this.messageLoadingThrottle = ko.observable(false).extend({ throttle: 50 });
this.messageFullScreenMode = ko.observable(false); this.messageFullScreenMode = ko.observable(false);
@ -121,7 +121,7 @@ class MessageUserStore {
t = setTimeout(()=>{ t = setTimeout(()=>{
o.purgeMessageBodyCache(); o.purgeMessageBodyCache();
t = 0; t = 0;
}, Magics.Time30s); }, 30000);
} }
}; };
} }
@ -214,7 +214,7 @@ class MessageUserStore {
if (item && item.newForAnimation()) { if (item && item.newForAnimation()) {
item.newForAnimation(false); item.newForAnimation(false);
} }
}), Magics.Time500ms); }), 500);
} }
); );
@ -265,7 +265,7 @@ class MessageUserStore {
}); });
if (0 < count) { if (0 < count) {
setTimeout(() => messagesDom.find('.rl-cache-purge').remove(), Magics.Time350ms); setTimeout(() => messagesDom.find('.rl-cache-purge').remove(), 350);
} }
} }
} }
@ -388,7 +388,7 @@ class MessageUserStore {
messages.forEach(item => { messages.forEach(item => {
this.messageList.remove(item); this.messageList.remove(item);
}); });
}, Magics.Time350ms); }, 350);
} }
} }

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { DesktopNotification, Magics } from 'Common/Enums'; import { DesktopNotification } from 'Common/Enums';
import * as Events from 'Common/Events'; import * as Events from 'Common/Events';
import Audio from 'Common/Audio'; import Audio from 'Common/Audio';
@ -153,7 +153,7 @@ class NotificationUserStore {
} }
}; };
})(notification), })(notification),
Magics.Time7s 7000
); );
} }
} }

View file

@ -1,7 +1,5 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
class QuotaUserStore { class QuotaUserStore {
constructor() { constructor() {
this.quota = ko.observable(0); this.quota = ko.observable(0);
@ -20,8 +18,8 @@ class QuotaUserStore {
* @param {number} usage * @param {number} usage
*/ */
populateData(quota, usage) { populateData(quota, usage) {
this.quota(quota * Magics.BitLength1024); this.quota(quota * 1024);
this.usage(usage * Magics.BitLength1024); this.usage(usage * 1024);
} }
} }

View file

@ -1,7 +1,7 @@
import ko from 'ko'; import ko from 'ko';
import { MESSAGES_PER_PAGE, MESSAGES_PER_PAGE_VALUES } from 'Common/Consts'; import { MESSAGES_PER_PAGE, MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
import { Layout, EditorDefaultType, Magics } from 'Common/Enums'; import { Layout, EditorDefaultType } from 'Common/Enums';
import { $htmlCL } from 'Common/Globals'; import { $htmlCL } from 'Common/Globals';
import { pInt } from 'Common/Utils'; import { pInt } from 'Common/Utils';
import * as Events from 'Common/Events'; import * as Events from 'Common/Events';
@ -33,7 +33,7 @@ class SettingsUserStore {
this.useThreads = ko.observable(false); this.useThreads = ko.observable(false);
this.replySameFolder = ko.observable(false); this.replySameFolder = ko.observable(false);
this.autoLogout = ko.observable(Magics.Time30mInMin); this.autoLogout = ko.observable(30);
this.computers(); this.computers();
this.subscribers(); this.subscribers();
@ -70,7 +70,7 @@ class SettingsUserStore {
if (0 < this.autoLogout() && !Settings.settingsGet('AccountSignMe')) { if (0 < this.autoLogout() && !Settings.settingsGet('AccountSignMe')) {
this.iAutoLogoutTimer = setTimeout(() => { this.iAutoLogoutTimer = setTimeout(() => {
Events.pub('rl.auto-logout'); Events.pub('rl.auto-logout');
}, this.autoLogout() * Magics.Time1m); }, this.autoLogout() * 60000);
} }
}); });

View file

@ -2,7 +2,7 @@ import ko from 'ko';
import { triggerAutocompleteInputChange } from 'Common/Utils'; import { triggerAutocompleteInputChange } from 'Common/Utils';
import { StorageResultType, Notification, Magics } from 'Common/Enums'; import { StorageResultType, Notification } from 'Common/Enums';
import { getNotification } from 'Common/Translator'; import { getNotification } from 'Common/Translator';
import { $win } from 'Common/Globals'; import { $win } from 'Common/Globals';
@ -104,7 +104,7 @@ class LoginAdminView extends AbstractViewNext {
setTimeout(() => { setTimeout(() => {
this.loginFocus(true); this.loginFocus(true);
}, Magics.Time100ms); }, 100);
} }
onHide() { onHide() {

View file

@ -2,7 +2,6 @@ import ko from 'ko';
import { import {
Capa, Capa,
Magics,
KeyState, KeyState,
ComposeType, ComposeType,
StorageResultType, StorageResultType,
@ -328,7 +327,7 @@ class ComposePopupView extends AbstractViewNext {
var d, fn = this.tryToClosePopup.bind(this); var d, fn = this.tryToClosePopup.bind(this);
this.tryToClosePopup = ()=>{ this.tryToClosePopup = ()=>{
d && clearTimeout(d); d && clearTimeout(d);
d = setTimeout(fn, Magics.Time200ms); d = setTimeout(fn, 200);
}; };
this.emailsSource = this.emailsSource.bind(this); this.emailsSource = this.emailsSource.bind(this);
@ -506,7 +505,7 @@ class ComposePopupView extends AbstractViewNext {
this.skipCommand(); this.skipCommand();
setTimeout(() => { setTimeout(() => {
showScreenPopup(require('View/Popup/Contacts'), [true, this.sLastFocusedField]); showScreenPopup(require('View/Popup/Contacts'), [true, this.sLastFocusedField]);
}, Magics.Time200ms); }, 200);
} }
} }
@ -528,7 +527,7 @@ class ComposePopupView extends AbstractViewNext {
autosaveStart() { autosaveStart() {
clearTimeout(this.iTimer); clearTimeout(this.iTimer);
this.iTimer = setTimeout(this.autosaveFunction, Magics.Time1m); this.iTimer = setTimeout(this.autosaveFunction, 60000);
} }
autosaveStop() { autosaveStop() {
@ -1174,7 +1173,7 @@ class ComposePopupView extends AbstractViewNext {
this.oEditor.focus(); this.oEditor.focus();
} }
} }
}, Magics.Time100ms); }, 100);
} }
} }
@ -1250,14 +1249,14 @@ class ComposePopupView extends AbstractViewNext {
Events.sub('window.resize.real', ()=>{ Events.sub('window.resize.real', ()=>{
// debounce // debounce
d && clearTimeout(d); d && clearTimeout(d);
d = setTimeout(o.resizerTrigger, Magics.Time50ms); d = setTimeout(o.resizerTrigger, 50);
}); });
setInterval(() => { setInterval(() => {
if (this.modalVisibility() && this.oEditor) { if (this.modalVisibility() && this.oEditor) {
this.oEditor.resize(); this.oEditor.resize();
} }
}, Magics.Time5s); }, 5000);
} }
/** /**

View file

@ -2,7 +2,7 @@ import ko from 'ko';
import { pString, defautOptionsAfterRender } from 'Common/Utils'; import { pString, defautOptionsAfterRender } from 'Common/Utils';
import { Magics, KeyState } from 'Common/Enums'; import { KeyState } from 'Common/Enums';
import { i18n } from 'Common/Translator'; import { i18n } from 'Common/Translator';
import PgpStore from 'Stores/User/Pgp'; import PgpStore from 'Stores/User/Pgp';
@ -234,7 +234,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
} }
this.submitRequest(false); this.submitRequest(false);
}, Magics.Time20ms); }, 20);
} else { } else {
this.submitRequest(false); this.submitRequest(false);
} }

View file

@ -5,7 +5,6 @@ import {
ContactPropertyType, ContactPropertyType,
ComposeType, ComposeType,
Capa, Capa,
Magics,
StorageResultType, StorageResultType,
Notification, Notification,
KeyState KeyState
@ -274,7 +273,7 @@ class ContactsPopupView extends AbstractViewNext {
setTimeout(() => { setTimeout(() => {
showScreenPopup(require('View/Popup/Compose'), [ComposeType.Empty, null, toEmails, ccEmails, bccEmails]); showScreenPopup(require('View/Popup/Compose'), [ComposeType.Empty, null, toEmails, ccEmails, bccEmails]);
}, Magics.Time200ms); }, 200);
} }
return true; return true;
@ -325,14 +324,14 @@ class ContactsPopupView extends AbstractViewNext {
setTimeout(() => { setTimeout(() => {
this.viewSaveTrigger(res ? SaveSettingsStep.TrueResult : SaveSettingsStep.FalseResult); this.viewSaveTrigger(res ? SaveSettingsStep.TrueResult : SaveSettingsStep.FalseResult);
}, Magics.Time350ms); }, 350);
if (res) { if (res) {
this.watchDirty(false); this.watchDirty(false);
setTimeout(() => { setTimeout(() => {
this.viewSaveTrigger(SaveSettingsStep.Idle); this.viewSaveTrigger(SaveSettingsStep.Idle);
}, Magics.Time1s); }, 1000);
} }
}, },
requestUid, requestUid,
@ -471,7 +470,7 @@ class ContactsPopupView extends AbstractViewNext {
koContacts.remove(contact); koContacts.remove(contact);
delegateRunOnDestroy(contact); delegateRunOnDestroy(contact);
}); });
}, Magics.Time500ms); }, 500);
} }
} }
@ -488,12 +487,12 @@ class ContactsPopupView extends AbstractViewNext {
* @param {AjaxJsonDefaultResponse} oData * @param {AjaxJsonDefaultResponse} oData
*/ */
deleteResponse(sResult, oData) { deleteResponse(sResult, oData) {
if (Magics.Time500ms < (StorageResultType.Success === sResult && oData && oData.Time ? pInt(oData.Time) : 0)) { if (500 < (StorageResultType.Success === sResult && oData && oData.Time ? pInt(oData.Time) : 0)) {
this.reloadContactList(this.bDropPageAfterDelete); this.reloadContactList(this.bDropPageAfterDelete);
} else { } else {
setTimeout(() => { setTimeout(() => {
this.reloadContactList(this.bDropPageAfterDelete); this.reloadContactList(this.bDropPageAfterDelete);
}, Magics.Time500ms); }, 500);
} }
} }

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { SetSystemFoldersNotification, Magics } from 'Common/Enums'; import { SetSystemFoldersNotification } from 'Common/Enums';
import { UNUSED_OPTION_VALUE } from 'Common/Consts'; import { UNUSED_OPTION_VALUE } from 'Common/Consts';
import { folderListOptionsBuilder, defautOptionsAfterRender } from 'Common/Utils'; import { folderListOptionsBuilder, defautOptionsAfterRender } from 'Common/Utils';
import { initOnStartOrLangChange, i18n } from 'Common/Translator'; import { initOnStartOrLangChange, i18n } from 'Common/Translator';
@ -76,7 +76,7 @@ class FolderSystemPopupView extends AbstractViewNext {
ArchiveFolder: FolderStore.archiveFolder(), ArchiveFolder: FolderStore.archiveFolder(),
NullFolder: 'NullFolder' NullFolder: 'NullFolder'
}); });
}, Magics.Time1s); }, 1000);
}, },
fCallback = () => { fCallback = () => {
fSetSystemFolders(); fSetSystemFolders();

View file

@ -1,4 +1,4 @@
import { KeyState, Magics } from 'Common/Enums'; import { KeyState } from 'Common/Enums';
import { popup } from 'Knoin/Knoin'; import { popup } from 'Knoin/Knoin';
import { AbstractViewNext } from 'Knoin/AbstractViewNext'; import { AbstractViewNext } from 'Knoin/AbstractViewNext';
@ -44,7 +44,7 @@ class KeyboardShortcutsHelpPopupView extends AbstractViewNext {
} }
return true; return true;
}, Magics.Time100ms); }, 100);
} }
} }
); );

View file

@ -1,7 +1,7 @@
import ko from 'ko'; import ko from 'ko';
import { pString } from 'Common/Utils'; import { pString } from 'Common/Utils';
import { KeyState, Magics } from 'Common/Enums'; import { KeyState } from 'Common/Enums';
import { popup, command } from 'Knoin/Knoin'; import { popup, command } from 'Knoin/Knoin';
import { AbstractViewNext } from 'Knoin/AbstractViewNext'; import { AbstractViewNext } from 'Knoin/AbstractViewNext';
@ -65,7 +65,7 @@ class MessageOpenPgpPopupView extends AbstractViewNext {
this.cancelCommand(); this.cancelCommand();
this.resultCallback(privateKey); this.resultCallback(privateKey);
}, Magics.Time100ms); }, 100);
} }
clearPopup() { clearPopup() {

View file

@ -1,6 +1,5 @@
import ko from 'ko'; import ko from 'ko';
import { Magics } from 'Common/Enums';
import { delegateRun, pInt } from 'Common/Utils'; import { delegateRun, pInt } from 'Common/Utils';
import PgpStore from 'Stores/User/Pgp'; import PgpStore from 'Stores/User/Pgp';
@ -24,7 +23,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewNext {
this.name = ko.observable(''); this.name = ko.observable('');
this.password = ko.observable(''); this.password = ko.observable('');
this.keyBitLength = ko.observable(Magics.BitLength2048); this.keyBitLength = ko.observable(2048);
this.submitRequest = ko.observable(false); this.submitRequest = ko.observable(false);
this.submitError = ko.observable(''); this.submitError = ko.observable('');
@ -81,7 +80,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewNext {
this.submitRequest(false); this.submitRequest(false);
this.showError(e); this.showError(e);
} }
}, Magics.Time100ms); }, 100);
return true; return true;
} }
@ -99,7 +98,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewNext {
this.email(''); this.email('');
this.email.error(false); this.email.error(false);
this.keyBitLength(Magics.BitLength2048); this.keyBitLength(2048);
this.submitError(''); this.submitError('');
} }

View file

@ -1,6 +1,6 @@
import ko from 'ko'; import ko from 'ko';
import { KeyState, Magics, StorageResultType, Notification } from 'Common/Enums'; import { KeyState, StorageResultType, Notification } from 'Common/Enums';
import { isNonEmptyArray, delegateRun } from 'Common/Utils'; import { isNonEmptyArray, delegateRun } from 'Common/Utils';
import { getNotification, i18n } from 'Common/Translator'; import { getNotification, i18n } from 'Common/Translator';
@ -45,7 +45,7 @@ class PluginPopupView extends AbstractViewNext {
this.tryToClosePopup = ()=>{ this.tryToClosePopup = ()=>{
// debounce // debounce
d && clearTimeout(d); d && clearTimeout(d);
d = setTimeout(fn, Magics.Time200ms); d = setTimeout(fn, 200);
}; };
} }

View file

@ -4,7 +4,7 @@ import AppStore from 'Stores/User/App';
import AccountStore from 'Stores/User/Account'; import AccountStore from 'Stores/User/Account';
import MessageStore from 'Stores/User/Message'; import MessageStore from 'Stores/User/Message';
import { Capa, Magics, KeyState } from 'Common/Enums'; import { Capa, KeyState } from 'Common/Enums';
import { settings } from 'Common/Links'; import { settings } from 'Common/Links';
import * as Events from 'Common/Events'; import * as Events from 'Common/Events';
@ -51,7 +51,7 @@ class AbstractSystemDropDownUserView extends AbstractViewNext {
accountClick(account, event) { accountClick(account, event) {
if (account && event && undefined !== event.which && 1 === event.which) { if (account && event && undefined !== event.which && 1 === event.which) {
AccountStore.accounts.loading(true); AccountStore.accounts.loading(true);
setTimeout(() => AccountStore.accounts.loading(false), Magics.Time1s); setTimeout(() => AccountStore.accounts.loading(false), 1000);
} }
return true; return true;

View file

@ -5,7 +5,6 @@ import {
LoginSignMeTypeAsString, LoginSignMeTypeAsString,
ClientSideKeyName, ClientSideKeyName,
StorageResultType, StorageResultType,
Magics,
Notification Notification
} from 'Common/Enums'; } from 'Common/Enums';
@ -216,7 +215,7 @@ class LoginUserView extends AbstractViewNext {
this.additionalCode.visibility(true); this.additionalCode.visibility(true);
this.submitRequest(false); this.submitRequest(false);
setTimeout(() => this.additionalCode.focused(true), Magics.Time100ms); setTimeout(() => this.additionalCode.focused(true), 100);
} else if (oData.Admin) { } else if (oData.Admin) {
getApp().redirectToAdminPanel(); getApp().redirectToAdminPanel();
} else { } else {
@ -330,7 +329,7 @@ class LoginUserView extends AbstractViewNext {
} }
); );
}); });
}, Magics.Time50ms); }, 50);
triggerAutocompleteInputChange(true); triggerAutocompleteInputChange(true);
} }
@ -347,7 +346,7 @@ class LoginUserView extends AbstractViewNext {
if (!bShift) { if (!bShift) {
setTimeout(() => { setTimeout(() => {
this.emailFocus(true); this.emailFocus(true);
}, Magics.Time50ms); }, 50);
return false; return false;
} }

View file

@ -1,7 +1,7 @@
import ko from 'ko'; import ko from 'ko';
import { isNormal, windowResize } from 'Common/Utils'; import { isNormal, windowResize } from 'Common/Utils';
import { Capa, Focused, Layout, KeyState, EventKeyCode, Magics } from 'Common/Enums'; import { Capa, Focused, Layout, KeyState, EventKeyCode } from 'Common/Enums';
import { $htmlCL, leftPanelDisabled, moveAction } from 'Common/Globals'; import { $htmlCL, leftPanelDisabled, moveAction } from 'Common/Globals';
import { mailBox, settings } from 'Common/Links'; import { mailBox, settings } from 'Common/Links';
import { setFolderHash } from 'Common/Cache'; import { setFolderHash } from 'Common/Cache';
@ -199,7 +199,7 @@ class FolderListMailBoxUserView extends AbstractViewNext {
folder.collapsed(false); folder.collapsed(false);
getApp().setExpandedFolder(folder.fullNameHash, true); getApp().setExpandedFolder(folder.fullNameHash, true);
windowResize(); windowResize();
}, Magics.Time500ms); }, 500);
} }
} }

View file

@ -6,7 +6,6 @@ import {
Focused, Focused,
ComposeType, ComposeType,
FolderType, FolderType,
Magics,
MessageSetAction, MessageSetAction,
KeyState, KeyState,
StorageResultType StorageResultType
@ -434,7 +433,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
this.selector.unselect(); this.selector.unselect();
this.gotoPage(up ? prev : next); this.gotoPage(up ? prev : next);
} }
}, Magics.Time350ms); }, 350);
return true; return true;
} }
@ -775,11 +774,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
this.initShortcuts(); this.initShortcuts();
if (!bMobileDevice && ifvisible && Settings.capa(Capa.Prefetch)) { if (!bMobileDevice && ifvisible && Settings.capa(Capa.Prefetch)) {
ifvisible.setIdleDuration(Magics.ifvisibleIdle10s); ifvisible.idle(this.prefetchNextTick.bind(this));
ifvisible.idle(() => {
this.prefetchNextTick();
});
} }
} }
@ -949,7 +944,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
if (next) { if (next) {
this.prefetchNextTick(); this.prefetchNextTick();
} }
}, Magics.Time1s); }, 1000);
}, },
message.folderFullNameRaw, message.folderFullNameRaw,
message.uid message.uid

View file

@ -10,7 +10,6 @@ import {
FolderType, FolderType,
Focused, Focused,
Layout, Layout,
Magics,
MessageSetAction MessageSetAction
} from 'Common/Enums'; } from 'Common/Enums';
@ -259,7 +258,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
if (Local.get(ClientSideKeyName.MessageAttachmnetControls)) { if (Local.get(ClientSideKeyName.MessageAttachmnetControls)) {
setTimeout(() => { setTimeout(() => {
this.showAttachmnetControls(true); this.showAttachmnetControls(true);
}, Magics.Time50ms); }, 50);
} }
if (this.viewHash !== message.hash) { if (this.viewHash !== message.hash) {
@ -433,8 +432,8 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
this.viewBodyTopValue( this.viewBodyTopValue(
this.message() this.message()
? this.oHeaderDom.height() + ? this.oHeaderDom.height() +
Magics.Size20px /* padding-(top/bottom): 20px */ + 20 /* padding-(top/bottom): 20px */ +
Magics.Size1px /* borded-bottom: 1px */ 1 /* borded-bottom: 1px */
: 0 : 0
); );
} }
@ -545,17 +544,17 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
if (!t) { if (!t) {
t = setTimeout(()=>{ t = setTimeout(()=>{
setTimeout(fCheckHeaderHeight, 1); setTimeout(fCheckHeaderHeight, 1);
setTimeout(fCheckHeaderHeight, Magics.Time200ms); setTimeout(fCheckHeaderHeight, 200);
setTimeout(fCheckHeaderHeight, Magics.Time500ms); setTimeout(fCheckHeaderHeight, 500);
t = 0; t = 0;
}, Magics.Time50ms); }, 50);
} }
} }
); );
this.showFullInfo.subscribe((value) => { this.showFullInfo.subscribe((value) => {
windowResize(); windowResize();
windowResize(Magics.Time200ms); windowResize(200);
Local.set(ClientSideKeyName.MessageHeaderFullInfo, value ? '1' : '0'); Local.set(ClientSideKeyName.MessageHeaderFullInfo, value ? '1' : '0');
}); });
@ -574,7 +573,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
// setup maito protocol // setup maito protocol
return !( return !(
!!event && !!event &&
Magics.EventWhichMouseMiddle !== event.which && 3 !== event.which &&
mailToHelper( mailToHelper(
jQuery(this).attr('href'), jQuery(this).attr('href'),
Settings.capa(Capa.Composer) ? require('View/Popup/Compose') : null // eslint-disable-line no-invalid-this Settings.capa(Capa.Composer) ? require('View/Popup/Compose') : null // eslint-disable-line no-invalid-this
@ -865,8 +864,8 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
scrollMessageToTop() { scrollMessageToTop() {
if (this.oMessageScrollerDom) { if (this.oMessageScrollerDom) {
if (Magics.Size50px < this.oMessageScrollerDom.scrollTop) { if (50 < this.oMessageScrollerDom.scrollTop) {
this.oMessageScrollerDom.scrollTop = Magics.Size50px; this.oMessageScrollerDom.scrollTop = 50;
} else { } else {
this.oMessageScrollerDom.scrollTop = 0; this.oMessageScrollerDom.scrollTop = 0;
} }

4
dev/bootstrap.js vendored
View file

@ -60,7 +60,7 @@ export default (App) => {
$htmlCL.add('rl-booted'); $htmlCL.add('rl-booted');
App.bootstart(); App.bootstart();
}, Enums.Magics.Time10ms); }, 10);
}; };
window.__APP_BOOT = fErrorCallback => { window.__APP_BOOT = fErrorCallback => {
@ -74,7 +74,7 @@ export default (App) => {
} }
window.__APP_BOOT = null; window.__APP_BOOT = null;
}, Enums.Magics.Time10ms); }, 10);
}); });
}; };
}; };