mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
js -> jsx
This commit is contained in:
parent
3bcf23f8fa
commit
08ccf55577
43 changed files with 2342 additions and 2347 deletions
|
|
@ -1,8 +1,14 @@
|
|||
|
||||
import {window, _, $, key} from 'common';
|
||||
import Globals from 'Common/Globals';
|
||||
import * as Enums from 'Common/Enums';
|
||||
import Utils from 'Common/Utils';
|
||||
|
||||
import {
|
||||
$win, $html, $doc,
|
||||
startMicrotime, leftPanelDisabled, leftPanelType,
|
||||
sUserAgent, bMobileDevice, bAnimationSupported
|
||||
} from 'Common/Globals';
|
||||
|
||||
import {KeyState} from 'Common/Enums';
|
||||
import {noop, isNormal, pString, inArray, microtime, timestamp, detectDropdownVisibility, windowResizeCallback} from 'Common/Utils';
|
||||
import Links from 'Common/Links';
|
||||
import Events from 'Common/Events';
|
||||
import Translator from 'Common/Translator';
|
||||
|
|
@ -15,6 +21,7 @@ class AbstractApp extends AbstractBoot
|
|||
googlePreviewSupportedCache = null;
|
||||
isLocalAutocomplete = true;
|
||||
iframe = null;
|
||||
lastErrorTime = 0;
|
||||
|
||||
/**
|
||||
* @param {RemoteStorage|AdminRemoteStorage} Remote
|
||||
|
|
@ -25,39 +32,47 @@ class AbstractApp extends AbstractBoot
|
|||
|
||||
this.iframe = $('<iframe class="internal-hiddden" />').appendTo('body');
|
||||
|
||||
Globals.$win.on('error', function (oEvent) {
|
||||
if (oEvent && oEvent.originalEvent && oEvent.originalEvent.message &&
|
||||
-1 === Utils.inArray(oEvent.originalEvent.message, [
|
||||
$win.on('error', (event) => {
|
||||
if (event && event.originalEvent && event.originalEvent.message &&
|
||||
-1 === inArray(event.originalEvent.message, [
|
||||
'Script error.', 'Uncaught Error: Error calling method on NPObject.'
|
||||
]))
|
||||
{
|
||||
const time = timestamp();
|
||||
if (this.lastErrorTime >= time)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.lastErrorTime = time;
|
||||
|
||||
Remote.jsError(
|
||||
Utils.emptyFunction,
|
||||
oEvent.originalEvent.message,
|
||||
oEvent.originalEvent.filename,
|
||||
oEvent.originalEvent.lineno,
|
||||
noop,
|
||||
event.originalEvent.message,
|
||||
event.originalEvent.filename,
|
||||
event.originalEvent.lineno,
|
||||
window.location && window.location.toString ? window.location.toString() : '',
|
||||
Globals.$html.attr('class'),
|
||||
Utils.microtime() - Globals.startMicrotime
|
||||
$html.attr('class'),
|
||||
microtime() - startMicrotime
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Globals.$win.on('resize', function () {
|
||||
$win.on('resize', function () {
|
||||
Events.pub('window.resize');
|
||||
});
|
||||
|
||||
Events.sub('window.resize', _.throttle(function () {
|
||||
|
||||
var
|
||||
iH = Globals.$win.height(),
|
||||
iW = Globals.$win.height()
|
||||
iH = $win.height(),
|
||||
iW = $win.height()
|
||||
;
|
||||
|
||||
if (Globals.$win.__sizes[0] !== iH || Globals.$win.__sizes[1] !== iW)
|
||||
if ($win.__sizes[0] !== iH || $win.__sizes[1] !== iW)
|
||||
{
|
||||
Globals.$win.__sizes[0] = iH;
|
||||
Globals.$win.__sizes[1] = iW;
|
||||
$win.__sizes[0] = iH;
|
||||
$win.__sizes[1] = iW;
|
||||
|
||||
Events.pub('window.resize.real');
|
||||
}
|
||||
|
|
@ -74,24 +89,24 @@ class AbstractApp extends AbstractBoot
|
|||
// }
|
||||
// });
|
||||
|
||||
Globals.$doc.on('keydown', function (oEvent) {
|
||||
$doc.on('keydown', function (oEvent) {
|
||||
if (oEvent && oEvent.ctrlKey)
|
||||
{
|
||||
Globals.$html.addClass('rl-ctrl-key-pressed');
|
||||
$html.addClass('rl-ctrl-key-pressed');
|
||||
}
|
||||
}).on('keyup', function (oEvent) {
|
||||
if (oEvent && !oEvent.ctrlKey)
|
||||
{
|
||||
Globals.$html.removeClass('rl-ctrl-key-pressed');
|
||||
$html.removeClass('rl-ctrl-key-pressed');
|
||||
}
|
||||
});
|
||||
|
||||
Globals.$doc.on('mousemove keypress click', _.debounce(function () {
|
||||
$doc.on('mousemove keypress click', _.debounce(function () {
|
||||
Events.pub('rl.auto-logout-refresh');
|
||||
}, 5000));
|
||||
|
||||
key('esc, enter', Enums.KeyState.All, _.bind(function () {
|
||||
Utils.detectDropdownVisibility();
|
||||
key('esc, enter', KeyState.All, _.bind(function () {
|
||||
detectDropdownVisibility();
|
||||
}, this));
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +128,7 @@ class AbstractApp extends AbstractBoot
|
|||
*/
|
||||
download(link) {
|
||||
|
||||
if (Globals.sUserAgent && (Globals.sUserAgent.indexOf('chrome') > -1 || Globals.sUserAgent.indexOf('chrome') > -1))
|
||||
if (sUserAgent && (sUserAgent.indexOf('chrome') > -1 || sUserAgent.indexOf('chrome') > -1))
|
||||
{
|
||||
const oLink = window.document.createElement('a');
|
||||
oLink.href = link;
|
||||
|
|
@ -130,7 +145,7 @@ class AbstractApp extends AbstractBoot
|
|||
}
|
||||
}
|
||||
|
||||
if (Globals.bMobileDevice)
|
||||
if (bMobileDevice)
|
||||
{
|
||||
window.open(link, '_self');
|
||||
window.focus();
|
||||
|
|
@ -161,7 +176,7 @@ class AbstractApp extends AbstractBoot
|
|||
* @param {string} title
|
||||
*/
|
||||
setWindowTitle(title) {
|
||||
title = ((Utils.isNormal(title) && 0 < title.length) ? '' + title : '');
|
||||
title = ((isNormal(title) && 0 < title.length) ? '' + title : '');
|
||||
if (Settings.settingsGet('Title'))
|
||||
{
|
||||
title += (title ? ' - ' : '') + Settings.settingsGet('Title');
|
||||
|
|
@ -208,7 +223,7 @@ class AbstractApp extends AbstractBoot
|
|||
inIframe = !!Settings.appSettingsGet('inIframe')
|
||||
;
|
||||
|
||||
let customLogoutLink = Utils.pString(Settings.appSettingsGet('customLogoutLink'));
|
||||
let customLogoutLink = pString(Settings.appSettingsGet('customLogoutLink'));
|
||||
|
||||
if (logout)
|
||||
{
|
||||
|
|
@ -260,7 +275,7 @@ class AbstractApp extends AbstractBoot
|
|||
|
||||
bootstart() {
|
||||
|
||||
// Utils.log('Ps' + 'ss, hac' + 'kers! The' + 're\'s not' + 'hing inte' + 'resting :' + ')');
|
||||
// log('Ps' + 'ss, hac' + 'kers! The' + 're\'s not' + 'hing inte' + 'resting :' + ')');
|
||||
|
||||
Events.pub('rl.bootstart');
|
||||
|
||||
|
|
@ -279,7 +294,7 @@ class AbstractApp extends AbstractBoot
|
|||
ko.components.register('x-script', require('Component/Script'));
|
||||
// ko.components.register('svg-icon', require('Component/SvgIcon'));
|
||||
|
||||
if (Settings.appSettingsGet('materialDesign') && Globals.bAnimationSupported)
|
||||
if (Settings.appSettingsGet('materialDesign') && bAnimationSupported)
|
||||
{
|
||||
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox'));
|
||||
ko.components.register('CheckboxSimple', require('Component/Checkbox'));
|
||||
|
|
@ -294,14 +309,14 @@ class AbstractApp extends AbstractBoot
|
|||
|
||||
Translator.initOnStartOrLangChange(Translator.initNotificationLanguage, Translator);
|
||||
|
||||
_.delay(Utils.windowResizeCallback, 1000);
|
||||
_.delay(windowResizeCallback, 1000);
|
||||
|
||||
Events.sub('ssm.mobile-enter', () => {
|
||||
Globals.leftPanelDisabled(true);
|
||||
leftPanelDisabled(true);
|
||||
});
|
||||
|
||||
Events.sub('ssm.mobile-leave', () => {
|
||||
Globals.leftPanelDisabled(false);
|
||||
leftPanelDisabled(false);
|
||||
});
|
||||
|
||||
if (!mobile)
|
||||
|
|
@ -310,11 +325,11 @@ class AbstractApp extends AbstractBoot
|
|||
id: 'mobile',
|
||||
maxWidth: 767,
|
||||
onEnter: () => {
|
||||
Globals.$html.addClass('ssm-state-mobile');
|
||||
$html.addClass('ssm-state-mobile');
|
||||
Events.pub('ssm.mobile-enter');
|
||||
},
|
||||
onLeave: () => {
|
||||
Globals.$html.removeClass('ssm-state-mobile');
|
||||
$html.removeClass('ssm-state-mobile');
|
||||
Events.pub('ssm.mobile-leave');
|
||||
}
|
||||
});
|
||||
|
|
@ -324,10 +339,10 @@ class AbstractApp extends AbstractBoot
|
|||
minWidth: 768,
|
||||
maxWidth: 999,
|
||||
onEnter: function() {
|
||||
Globals.$html.addClass('ssm-state-tablet');
|
||||
$html.addClass('ssm-state-tablet');
|
||||
},
|
||||
onLeave: function() {
|
||||
Globals.$html.removeClass('ssm-state-tablet');
|
||||
$html.removeClass('ssm-state-tablet');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -336,10 +351,10 @@ class AbstractApp extends AbstractBoot
|
|||
minWidth: 1000,
|
||||
maxWidth: 1400,
|
||||
onEnter: () => {
|
||||
Globals.$html.addClass('ssm-state-desktop');
|
||||
$html.addClass('ssm-state-desktop');
|
||||
},
|
||||
onLeave: () => {
|
||||
Globals.$html.removeClass('ssm-state-desktop');
|
||||
$html.removeClass('ssm-state-desktop');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -347,30 +362,30 @@ class AbstractApp extends AbstractBoot
|
|||
id: 'desktop-large',
|
||||
minWidth: 1400,
|
||||
onEnter: () => {
|
||||
Globals.$html.addClass('ssm-state-desktop-large');
|
||||
$html.addClass('ssm-state-desktop-large');
|
||||
},
|
||||
onLeave: () => {
|
||||
Globals.$html.removeClass('ssm-state-desktop-large');
|
||||
$html.removeClass('ssm-state-desktop-large');
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.$html.addClass('ssm-state-mobile').addClass('rl-mobile');
|
||||
$html.addClass('ssm-state-mobile').addClass('rl-mobile');
|
||||
Events.pub('ssm.mobile-enter');
|
||||
}
|
||||
|
||||
Globals.leftPanelDisabled.subscribe((bValue) => {
|
||||
Globals.$html.toggleClass('rl-left-panel-disabled', bValue);
|
||||
Globals.$html.toggleClass('rl-left-panel-enabled', !bValue);
|
||||
leftPanelDisabled.subscribe((bValue) => {
|
||||
$html.toggleClass('rl-left-panel-disabled', bValue);
|
||||
$html.toggleClass('rl-left-panel-enabled', !bValue);
|
||||
});
|
||||
|
||||
Globals.leftPanelType.subscribe((sValue) => {
|
||||
Globals.$html.toggleClass('rl-left-panel-none', 'none' === sValue);
|
||||
Globals.$html.toggleClass('rl-left-panel-short', 'short' === sValue);
|
||||
leftPanelType.subscribe((sValue) => {
|
||||
$html.toggleClass('rl-left-panel-none', 'none' === sValue);
|
||||
$html.toggleClass('rl-left-panel-short', 'short' === sValue);
|
||||
});
|
||||
|
||||
Globals.leftPanelDisabled.valueHasMutated();
|
||||
leftPanelDisabled.valueHasMutated();
|
||||
|
||||
ssm.ready();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import {window, _} from 'common';
|
|||
import ko from 'ko';
|
||||
import progressJs from 'progressJs';
|
||||
|
||||
import * as Enums from 'Common/Enums';
|
||||
import Utils from 'Common/Utils';
|
||||
import Links from 'Common/Links';
|
||||
import Translator from 'Common/Translator';
|
||||
import {StorageResultType, Notification} from 'Common/Enums';
|
||||
import {pInt, isNormal, isArray, inArray, isUnd} from 'Common/Utils';
|
||||
|
||||
import Settings from 'Storage/Settings';
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class AdminApp extends AbstractApp
|
|||
DomainStore.domains.loading(true);
|
||||
Remote.domainList((result, data) => {
|
||||
DomainStore.domains.loading(false);
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result)
|
||||
if (StorageResultType.Success === result && data && data.Result)
|
||||
{
|
||||
DomainStore.domains(_.map(data.Result, (enabled, name) => {
|
||||
return {
|
||||
|
|
@ -54,7 +54,7 @@ class AdminApp extends AbstractApp
|
|||
PluginStore.plugins.loading(true);
|
||||
Remote.pluginList((result, data) => {
|
||||
PluginStore.plugins.loading(false);
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result)
|
||||
if (StorageResultType.Success === result && data && data.Result)
|
||||
{
|
||||
PluginStore.plugins(_.map(data.Result, (item) => {
|
||||
return {
|
||||
|
|
@ -72,7 +72,7 @@ class AdminApp extends AbstractApp
|
|||
PackageStore.packagesReal(true);
|
||||
Remote.packagesList((result, data) => {
|
||||
PackageStore.packages.loading(false);
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result)
|
||||
if (StorageResultType.Success === result && data && data.Result)
|
||||
{
|
||||
PackageStore.packagesReal(!!data.Result.Real);
|
||||
PackageStore.packagesMainUpdatable(!!data.Result.MainUpdatable);
|
||||
|
|
@ -89,12 +89,12 @@ class AdminApp extends AbstractApp
|
|||
}
|
||||
});
|
||||
|
||||
if (Utils.isArray(data.Result.List))
|
||||
if (isArray(data.Result.List))
|
||||
{
|
||||
list = _.compact(_.map(data.Result.List, (item) => {
|
||||
if (item)
|
||||
{
|
||||
item.loading = ko.observable(!Utils.isUnd(loading[item.file]));
|
||||
item.loading = ko.observable(!isUnd(loading[item.file]));
|
||||
return 'core' === item.type && !item.canBeInstalled ? null : item;
|
||||
}
|
||||
return null;
|
||||
|
|
@ -118,7 +118,7 @@ class AdminApp extends AbstractApp
|
|||
CoreStore.coreRemoteVersion('');
|
||||
CoreStore.coreRemoteRelease('');
|
||||
CoreStore.coreVersionCompare(-2);
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result)
|
||||
if (StorageResultType.Success === result && data && data.Result)
|
||||
{
|
||||
CoreStore.coreReal(true);
|
||||
window.location.reload();
|
||||
|
|
@ -135,7 +135,7 @@ class AdminApp extends AbstractApp
|
|||
CoreStore.coreReal(true);
|
||||
Remote.coreData((result, data) => {
|
||||
CoreStore.coreChecking(false);
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result)
|
||||
if (StorageResultType.Success === result && data && data.Result)
|
||||
{
|
||||
CoreStore.coreReal(!!data.Result.Real);
|
||||
CoreStore.coreChannel(data.Result.Channel || 'stable');
|
||||
|
|
@ -146,7 +146,7 @@ class AdminApp extends AbstractApp
|
|||
CoreStore.coreVersion(data.Result.Version || '');
|
||||
CoreStore.coreRemoteVersion(data.Result.RemoteVersion || '');
|
||||
CoreStore.coreRemoteRelease(data.Result.RemoteRelease || '');
|
||||
CoreStore.coreVersionCompare(Utils.pInt(data.Result.VersionCompare));
|
||||
CoreStore.coreVersionCompare(pInt(data.Result.VersionCompare));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -170,29 +170,29 @@ class AdminApp extends AbstractApp
|
|||
LicenseStore.licenseError('');
|
||||
Remote.licensing((result, data) => {
|
||||
LicenseStore.licensingProcess(false);
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result && Utils.isNormal(data.Result.Expired))
|
||||
if (StorageResultType.Success === result && data && data.Result && isNormal(data.Result.Expired))
|
||||
{
|
||||
LicenseStore.licenseValid(true);
|
||||
LicenseStore.licenseExpired(Utils.pInt(data.Result.Expired));
|
||||
LicenseStore.licenseExpired(pInt(data.Result.Expired));
|
||||
LicenseStore.licenseError('');
|
||||
LicenseStore.licensing(true);
|
||||
AppStore.prem(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data && data.ErrorCode && -1 < Utils.inArray(Utils.pInt(data.ErrorCode), [
|
||||
Enums.Notification.LicensingServerIsUnavailable,
|
||||
Enums.Notification.LicensingExpired
|
||||
if (data && data.ErrorCode && -1 < inArray(pInt(data.ErrorCode), [
|
||||
Notification.LicensingServerIsUnavailable,
|
||||
Notification.LicensingExpired
|
||||
]))
|
||||
{
|
||||
LicenseStore.licenseError(Translator.getNotification(Utils.pInt(data.ErrorCode)));
|
||||
LicenseStore.licenseError(Translator.getNotification(pInt(data.ErrorCode)));
|
||||
LicenseStore.licensing(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Enums.StorageResultType.Abort === result)
|
||||
if (StorageResultType.Abort === result)
|
||||
{
|
||||
LicenseStore.licenseError(Translator.getNotification(Enums.Notification.LicensingServerIsUnavailable));
|
||||
LicenseStore.licenseError(Translator.getNotification(Notification.LicensingServerIsUnavailable));
|
||||
LicenseStore.licensing(true);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
235
dev/App/User.jsx
235
dev/App/User.jsx
|
|
@ -3,11 +3,24 @@ import {window, _, $} from 'common';
|
|||
import progressJs from 'progressJs';
|
||||
import Tinycon from 'Tinycon';
|
||||
|
||||
import * as Enums from 'Common/Enums';
|
||||
import * as Consts from 'Common/Consts';
|
||||
import Globals from 'Common/Globals';
|
||||
import {
|
||||
noop, trim, log, isArray, inArray, isUnd, isNormal, isPosNumeric, isNonEmptyArray,
|
||||
pInt, pString, delegateRunOnDestroy, mailToHelper, windowResize
|
||||
} from 'Common/Utils';
|
||||
|
||||
import {
|
||||
Layout, Capa, StorageResultType, Notification, FolderType,
|
||||
SetSystemFoldersNotification, MessageSetAction, ClientSideKeyName
|
||||
} from 'Common/Enums';
|
||||
|
||||
import {
|
||||
$html,
|
||||
leftPanelWidth, leftPanelDisabled,
|
||||
bAnimationSupported, bMobileDevice
|
||||
} from 'Common/Globals';
|
||||
|
||||
import {UNUSED_OPTION_VALUE} from 'Common/Consts';
|
||||
import Plugins from 'Common/Plugins';
|
||||
import Utils from 'Common/Utils';
|
||||
import Links from 'Common/Links';
|
||||
import Events from 'Common/Events';
|
||||
import Translator from 'Common/Translator';
|
||||
|
|
@ -74,7 +87,7 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
|
||||
Remote.jsVersion((sResult, oData) => {
|
||||
if (Enums.StorageResultType.Success === sResult && oData && !oData.Result)
|
||||
if (StorageResultType.Success === sResult && oData && !oData.Result)
|
||||
{
|
||||
this.reload();
|
||||
}
|
||||
|
|
@ -93,7 +106,7 @@ class AppUser extends AbstractApp
|
|||
$('#rl-bg')
|
||||
.attr('style', 'background-image: none !important;')
|
||||
.backstretch(Links.userBackground(Settings.settingsGet('UserBackgroundHash')), {
|
||||
fade: Globals.bAnimationSupported ? 1000 : 0,
|
||||
fade: bAnimationSupported ? 1000 : 0,
|
||||
centeredX: true,
|
||||
centeredY: true
|
||||
})
|
||||
|
|
@ -159,19 +172,19 @@ class AppUser extends AbstractApp
|
|||
MessageStore.messageListLoading(true);
|
||||
Remote.messageList((sResult, oData, bCached) => {
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
MessageStore.messageListError('');
|
||||
MessageStore.messageListLoading(false);
|
||||
|
||||
MessageStore.setMessageList(oData, bCached);
|
||||
}
|
||||
else if (Enums.StorageResultType.Unload === sResult)
|
||||
else if (StorageResultType.Unload === sResult)
|
||||
{
|
||||
MessageStore.messageListError('');
|
||||
MessageStore.messageListLoading(false);
|
||||
}
|
||||
else if (Enums.StorageResultType.Abort !== sResult)
|
||||
else if (StorageResultType.Abort !== sResult)
|
||||
{
|
||||
MessageStore.messageList([]);
|
||||
MessageStore.messageListLoading(false);
|
||||
|
|
@ -185,7 +198,7 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
|
||||
recacheInboxMessageList() {
|
||||
Remote.messageList(Utils.emptyFunction, Cache.getFolderInboxName(), 0, SettingsStore.messagesPerPage(), '', '', true);
|
||||
Remote.messageList(noop, Cache.getFolderInboxName(), 0, SettingsStore.messagesPerPage(), '', '', true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -272,9 +285,9 @@ class AppUser extends AbstractApp
|
|||
|
||||
moveOrDeleteResponseHelper(sResult, oData) {
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && FolderStore.currentFolder())
|
||||
if (StorageResultType.Success === sResult && FolderStore.currentFolder())
|
||||
{
|
||||
if (oData && Utils.isArray(oData.Result) && 2 === oData.Result.length)
|
||||
if (oData && isArray(oData.Result) && 2 === oData.Result.length)
|
||||
{
|
||||
Cache.setFolderHash(oData.Result[0], oData.Result[1]);
|
||||
}
|
||||
|
|
@ -282,8 +295,8 @@ class AppUser extends AbstractApp
|
|||
{
|
||||
Cache.setFolderHash(FolderStore.currentFolderFullNameRaw(), '');
|
||||
|
||||
if (oData && -1 < Utils.inArray(oData.ErrorCode,
|
||||
[Enums.Notification.CantMoveMessage, Enums.Notification.CantCopyMessage]))
|
||||
if (oData && -1 < inArray(oData.ErrorCode,
|
||||
[Notification.CantMoveMessage, Notification.CantCopyMessage]))
|
||||
{
|
||||
window.alert(Translator.getNotification(oData.ErrorCode));
|
||||
}
|
||||
|
|
@ -318,29 +331,29 @@ class AppUser extends AbstractApp
|
|||
|
||||
switch (iDeleteType)
|
||||
{
|
||||
case Enums.FolderType.Spam:
|
||||
case FolderType.Spam:
|
||||
oMoveFolder = Cache.getFolderFromCacheList(FolderStore.spamFolder());
|
||||
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Spam;
|
||||
nSetSystemFoldersNotification = SetSystemFoldersNotification.Spam;
|
||||
break;
|
||||
case Enums.FolderType.NotSpam:
|
||||
case FolderType.NotSpam:
|
||||
oMoveFolder = Cache.getFolderFromCacheList(Cache.getFolderInboxName());
|
||||
break;
|
||||
case Enums.FolderType.Trash:
|
||||
case FolderType.Trash:
|
||||
oMoveFolder = Cache.getFolderFromCacheList(FolderStore.trashFolder());
|
||||
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Trash;
|
||||
nSetSystemFoldersNotification = SetSystemFoldersNotification.Trash;
|
||||
break;
|
||||
case Enums.FolderType.Archive:
|
||||
case FolderType.Archive:
|
||||
oMoveFolder = Cache.getFolderFromCacheList(FolderStore.archiveFolder());
|
||||
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Archive;
|
||||
nSetSystemFoldersNotification = SetSystemFoldersNotification.Archive;
|
||||
break;
|
||||
}
|
||||
|
||||
bUseFolder = Utils.isUnd(bUseFolder) ? true : !!bUseFolder;
|
||||
bUseFolder = isUnd(bUseFolder) ? true : !!bUseFolder;
|
||||
if (bUseFolder)
|
||||
{
|
||||
if ((Enums.FolderType.Spam === iDeleteType && Consts.UNUSED_OPTION_VALUE === FolderStore.spamFolder()) ||
|
||||
(Enums.FolderType.Trash === iDeleteType && Consts.UNUSED_OPTION_VALUE === FolderStore.trashFolder()) ||
|
||||
(Enums.FolderType.Archive === iDeleteType && Consts.UNUSED_OPTION_VALUE === FolderStore.archiveFolder()))
|
||||
if ((FolderType.Spam === iDeleteType && UNUSED_OPTION_VALUE === FolderStore.spamFolder()) ||
|
||||
(FolderType.Trash === iDeleteType && UNUSED_OPTION_VALUE === FolderStore.trashFolder()) ||
|
||||
(FolderType.Archive === iDeleteType && UNUSED_OPTION_VALUE === FolderStore.archiveFolder()))
|
||||
{
|
||||
bUseFolder = false;
|
||||
}
|
||||
|
|
@ -350,7 +363,7 @@ class AppUser extends AbstractApp
|
|||
{
|
||||
kn.showScreenPopup(require('View/Popup/FolderSystem'), [nSetSystemFoldersNotification]);
|
||||
}
|
||||
else if (!bUseFolder || (Enums.FolderType.Trash === iDeleteType &&
|
||||
else if (!bUseFolder || (FolderType.Trash === iDeleteType &&
|
||||
(sFromFolderFullNameRaw === FolderStore.spamFolder() || sFromFolderFullNameRaw === FolderStore.trashFolder())))
|
||||
{
|
||||
kn.showScreenPopup(require('View/Popup/Ask'), [Translator.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), () => {
|
||||
|
|
@ -373,7 +386,7 @@ class AppUser extends AbstractApp
|
|||
*/
|
||||
moveMessagesToFolder(sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy) {
|
||||
|
||||
if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && Utils.isArray(aUidForMove) && 0 < aUidForMove.length)
|
||||
if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && isArray(aUidForMove) && 0 < aUidForMove.length)
|
||||
{
|
||||
const
|
||||
oFromFolder = Cache.getFolderFromCacheList(sFromFolderFullNameRaw),
|
||||
|
|
@ -382,7 +395,7 @@ class AppUser extends AbstractApp
|
|||
|
||||
if (oFromFolder && oToFolder)
|
||||
{
|
||||
if (Utils.isUnd(bCopy) ? false : !!bCopy)
|
||||
if (isUnd(bCopy) ? false : !!bCopy)
|
||||
{
|
||||
this.messagesCopyHelper(oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForMove);
|
||||
}
|
||||
|
|
@ -486,7 +499,7 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
});
|
||||
|
||||
Utils.delegateRunOnDestroy(PgpStore.openpgpkeys());
|
||||
delegateRunOnDestroy(PgpStore.openpgpkeys());
|
||||
PgpStore.openpgpkeys(aKeys);
|
||||
}
|
||||
}
|
||||
|
|
@ -499,7 +512,7 @@ class AppUser extends AbstractApp
|
|||
//
|
||||
// AccountStore.accounts.loading(false);
|
||||
//
|
||||
// if (Enums.StorageResultType.Success === sResult && oData.Result && oData.Result['Counts'])
|
||||
// if (StorageResultType.Success === sResult && oData.Result && oData.Result['Counts'])
|
||||
// {
|
||||
// var
|
||||
// sEmail = AccountStore.email(),
|
||||
|
|
@ -514,7 +527,7 @@ class AppUser extends AbstractApp
|
|||
//
|
||||
// if (oAccount)
|
||||
// {
|
||||
// oAccount.count(Utils.pInt(oItem[1]));
|
||||
// oAccount.count(pInt(oItem[1]));
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
|
@ -531,7 +544,7 @@ class AppUser extends AbstractApp
|
|||
AccountStore.accounts.loading(false);
|
||||
IdentityStore.identities.loading(false);
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData.Result)
|
||||
if (StorageResultType.Success === sResult && oData.Result)
|
||||
{
|
||||
var
|
||||
aCounts = {},
|
||||
|
|
@ -541,40 +554,40 @@ class AppUser extends AbstractApp
|
|||
|
||||
sParentEmail = '' === sParentEmail ? sAccountEmail : sParentEmail;
|
||||
|
||||
if (Utils.isArray(oData.Result.Accounts))
|
||||
if (isArray(oData.Result.Accounts))
|
||||
{
|
||||
_.each(AccountStore.accounts(), (oAccount) => {
|
||||
aCounts[oAccount.email] = oAccount.count();
|
||||
});
|
||||
|
||||
Utils.delegateRunOnDestroy(AccountStore.accounts());
|
||||
delegateRunOnDestroy(AccountStore.accounts());
|
||||
|
||||
AccountStore.accounts(_.map(oData.Result.Accounts,
|
||||
(sValue) => new AccountModel(sValue, sValue !== sParentEmail, aCounts[sValue] || 0)));
|
||||
}
|
||||
|
||||
if (Utils.isUnd(bBoot) ? false : !!bBoot)
|
||||
if (isUnd(bBoot) ? false : !!bBoot)
|
||||
{
|
||||
_.delay(() => this.accountsCounts(), 1000 * 5);
|
||||
Events.sub('interval.10m-after5m', () => this.accountsCounts());
|
||||
}
|
||||
|
||||
if (Utils.isArray(oData.Result.Identities))
|
||||
if (isArray(oData.Result.Identities))
|
||||
{
|
||||
Utils.delegateRunOnDestroy(IdentityStore.identities());
|
||||
delegateRunOnDestroy(IdentityStore.identities());
|
||||
|
||||
IdentityStore.identities(_.map(oData.Result.Identities, (oIdentityData) => {
|
||||
|
||||
const
|
||||
sId = Utils.pString(oIdentityData.Id),
|
||||
sEmail = Utils.pString(oIdentityData.Email),
|
||||
sId = pString(oIdentityData.Id),
|
||||
sEmail = pString(oIdentityData.Email),
|
||||
oIdentity = new IdentityModel(sId, sEmail)
|
||||
;
|
||||
|
||||
oIdentity.name(Utils.pString(oIdentityData.Name));
|
||||
oIdentity.replyTo(Utils.pString(oIdentityData.ReplyTo));
|
||||
oIdentity.bcc(Utils.pString(oIdentityData.Bcc));
|
||||
oIdentity.signature(Utils.pString(oIdentityData.Signature));
|
||||
oIdentity.name(pString(oIdentityData.Name));
|
||||
oIdentity.replyTo(pString(oIdentityData.ReplyTo));
|
||||
oIdentity.bcc(pString(oIdentityData.Bcc));
|
||||
oIdentity.signature(pString(oIdentityData.Signature));
|
||||
oIdentity.signatureInsertBefore(!!oIdentityData.SignatureInsertBefore);
|
||||
|
||||
return oIdentity;
|
||||
|
|
@ -592,10 +605,10 @@ class AppUser extends AbstractApp
|
|||
|
||||
TemplateStore.templates.loading(false);
|
||||
|
||||
if (Enums.StorageResultType.Success === result && data.Result &&
|
||||
Utils.isArray(data.Result.Templates))
|
||||
if (StorageResultType.Success === result && data.Result &&
|
||||
isArray(data.Result.Templates))
|
||||
{
|
||||
Utils.delegateRunOnDestroy(TemplateStore.templates());
|
||||
delegateRunOnDestroy(TemplateStore.templates());
|
||||
|
||||
TemplateStore.templates(_.compact(_.map(data.Result.Templates, (templateData) => {
|
||||
const template = new TemplateModel();
|
||||
|
|
@ -607,12 +620,12 @@ class AppUser extends AbstractApp
|
|||
|
||||
quota() {
|
||||
Remote.quota((result, data) => {
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result &&
|
||||
Utils.isArray(data.Result) && 1 < data.Result.length &&
|
||||
Utils.isPosNumeric(data.Result[0], true) && Utils.isPosNumeric(data.Result[1], true))
|
||||
if (StorageResultType.Success === result && data && data.Result &&
|
||||
isArray(data.Result) && 1 < data.Result.length &&
|
||||
isPosNumeric(data.Result[0], true) && isPosNumeric(data.Result[1], true))
|
||||
{
|
||||
require('Stores/User/Quota').populateData(
|
||||
Utils.pInt(data.Result[1]), Utils.pInt(data.Result[0]));
|
||||
pInt(data.Result[1]), pInt(data.Result[0]));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -622,10 +635,10 @@ class AppUser extends AbstractApp
|
|||
* @param {Array=} list = []
|
||||
*/
|
||||
folderInformation(folder, list) {
|
||||
if ('' !== Utils.trim(folder))
|
||||
if ('' !== trim(folder))
|
||||
{
|
||||
Remote.folderInformation((result, data) => {
|
||||
if (Enums.StorageResultType.Success === result)
|
||||
if (StorageResultType.Success === result)
|
||||
{
|
||||
if (data && data.Result && data.Result.Hash && data.Result.Folder)
|
||||
{
|
||||
|
|
@ -645,14 +658,14 @@ class AppUser extends AbstractApp
|
|||
Cache.setFolderHash(data.Result.Folder, data.Result.Hash);
|
||||
}
|
||||
|
||||
if (Utils.isNormal(data.Result.MessageCount))
|
||||
if (isNormal(data.Result.MessageCount))
|
||||
{
|
||||
folderFromCache.messageCountAll(data.Result.MessageCount);
|
||||
}
|
||||
|
||||
if (Utils.isNormal(data.Result.MessageUnseenCount))
|
||||
if (isNormal(data.Result.MessageUnseenCount))
|
||||
{
|
||||
if (Utils.pInt(folderFromCache.messageCountUnread()) !== Utils.pInt(data.Result.MessageUnseenCount))
|
||||
if (pInt(folderFromCache.messageCountUnread()) !== pInt(data.Result.MessageUnseenCount))
|
||||
{
|
||||
unreadCountChange = true;
|
||||
}
|
||||
|
|
@ -712,12 +725,12 @@ class AppUser extends AbstractApp
|
|||
folderInformationMultiply(boot = false) {
|
||||
|
||||
const folders = FolderStore.getNextFolderNames();
|
||||
if (Utils.isNonEmptyArray(folders))
|
||||
if (isNonEmptyArray(folders))
|
||||
{
|
||||
Remote.folderInformationMultiply((sResult, oData) => {
|
||||
if (Enums.StorageResultType.Success === sResult)
|
||||
if (StorageResultType.Success === sResult)
|
||||
{
|
||||
if (oData && oData.Result && oData.Result.List && Utils.isNonEmptyArray(oData.Result.List))
|
||||
if (oData && oData.Result && oData.Result.List && isNonEmptyArray(oData.Result.List))
|
||||
{
|
||||
const utc = Momentor.momentNowUnix();
|
||||
_.each(oData.Result.List, (oItem) => {
|
||||
|
|
@ -737,14 +750,14 @@ class AppUser extends AbstractApp
|
|||
Cache.setFolderHash(oItem.Folder, oItem.Hash);
|
||||
}
|
||||
|
||||
if (Utils.isNormal(oItem.MessageCount))
|
||||
if (isNormal(oItem.MessageCount))
|
||||
{
|
||||
oFolder.messageCountAll(oItem.MessageCount);
|
||||
}
|
||||
|
||||
if (Utils.isNormal(oItem.MessageUnseenCount))
|
||||
if (isNormal(oItem.MessageUnseenCount))
|
||||
{
|
||||
if (Utils.pInt(oFolder.messageCountUnread()) !== Utils.pInt(oItem.MessageUnseenCount))
|
||||
if (pInt(oFolder.messageCountUnread()) !== pInt(oItem.MessageUnseenCount))
|
||||
{
|
||||
bUnreadCountChange = true;
|
||||
}
|
||||
|
|
@ -769,7 +782,7 @@ class AppUser extends AbstractApp
|
|||
if (oFolder.fullNameRaw === FolderStore.currentFolderFullNameRaw())
|
||||
{
|
||||
const aList = MessageStore.messageList();
|
||||
if (Utils.isNonEmptyArray(aList))
|
||||
if (isNonEmptyArray(aList))
|
||||
{
|
||||
this.folderInformation(oFolder.fullNameRaw, aList);
|
||||
}
|
||||
|
|
@ -802,7 +815,7 @@ class AppUser extends AbstractApp
|
|||
iAlreadyUnread = 0
|
||||
;
|
||||
|
||||
if (Utils.isUnd(aMessages))
|
||||
if (isUnd(aMessages))
|
||||
{
|
||||
aMessages = MessageStore.messageListChecked();
|
||||
}
|
||||
|
|
@ -812,7 +825,7 @@ class AppUser extends AbstractApp
|
|||
if ('' !== sFolderFullNameRaw && 0 < aRootUids.length)
|
||||
{
|
||||
switch (iSetAction) {
|
||||
case Enums.MessageSetAction.SetSeen:
|
||||
case MessageSetAction.SetSeen:
|
||||
|
||||
_.each(aRootUids, (sSubUid) => {
|
||||
iAlreadyUnread += Cache.storeMessageFlagsToCacheBySetAction(
|
||||
|
|
@ -825,10 +838,10 @@ class AppUser extends AbstractApp
|
|||
oFolder.messageCountUnread(oFolder.messageCountUnread() - iAlreadyUnread);
|
||||
}
|
||||
|
||||
Remote.messageSetSeen(Utils.emptyFunction, sFolderFullNameRaw, aRootUids, true);
|
||||
Remote.messageSetSeen(noop, sFolderFullNameRaw, aRootUids, true);
|
||||
break;
|
||||
|
||||
case Enums.MessageSetAction.UnsetSeen:
|
||||
case MessageSetAction.UnsetSeen:
|
||||
|
||||
_.each(aRootUids, (sSubUid) => {
|
||||
iAlreadyUnread += Cache.storeMessageFlagsToCacheBySetAction(
|
||||
|
|
@ -841,27 +854,27 @@ class AppUser extends AbstractApp
|
|||
oFolder.messageCountUnread(oFolder.messageCountUnread() - iAlreadyUnread + aRootUids.length);
|
||||
}
|
||||
|
||||
Remote.messageSetSeen(Utils.emptyFunction, sFolderFullNameRaw, aRootUids, false);
|
||||
Remote.messageSetSeen(noop, sFolderFullNameRaw, aRootUids, false);
|
||||
break;
|
||||
|
||||
case Enums.MessageSetAction.SetFlag:
|
||||
case MessageSetAction.SetFlag:
|
||||
|
||||
_.each(aRootUids, (sSubUid) => {
|
||||
Cache.storeMessageFlagsToCacheBySetAction(
|
||||
sFolderFullNameRaw, sSubUid, iSetAction);
|
||||
});
|
||||
|
||||
Remote.messageSetFlagged(Utils.emptyFunction, sFolderFullNameRaw, aRootUids, true);
|
||||
Remote.messageSetFlagged(noop, sFolderFullNameRaw, aRootUids, true);
|
||||
break;
|
||||
|
||||
case Enums.MessageSetAction.UnsetFlag:
|
||||
case MessageSetAction.UnsetFlag:
|
||||
|
||||
_.each(aRootUids, (sSubUid) => {
|
||||
Cache.storeMessageFlagsToCacheBySetAction(
|
||||
sFolderFullNameRaw, sSubUid, iSetAction);
|
||||
});
|
||||
|
||||
Remote.messageSetFlagged(Utils.emptyFunction, sFolderFullNameRaw, aRootUids, false);
|
||||
Remote.messageSetFlagged(noop, sFolderFullNameRaw, aRootUids, false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -895,7 +908,7 @@ class AppUser extends AbstractApp
|
|||
|
||||
Remote.socialUsers((result, data) => {
|
||||
|
||||
if (Enums.StorageResultType.Success === result && data && data.Result)
|
||||
if (StorageResultType.Success === result && data && data.Result)
|
||||
{
|
||||
SocialStore.google.userName(data.Result.Google || '');
|
||||
SocialStore.facebook.userName(data.Result.Facebook || '');
|
||||
|
|
@ -935,12 +948,12 @@ class AppUser extends AbstractApp
|
|||
*/
|
||||
getAutocomplete(query, callback) {
|
||||
Remote.suggestions((result, data) => {
|
||||
if (Enums.StorageResultType.Success === result && data && Utils.isArray(data.Result))
|
||||
if (StorageResultType.Success === result && data && isArray(data.Result))
|
||||
{
|
||||
callback(_.compact(_.map(data.Result,
|
||||
(item) => item && item[0] ? new EmailModel(item[0], item[1]) : null)));
|
||||
}
|
||||
else if (Enums.StorageResultType.Abort !== result)
|
||||
else if (StorageResultType.Abort !== result)
|
||||
{
|
||||
callback([]);
|
||||
}
|
||||
|
|
@ -952,8 +965,8 @@ class AppUser extends AbstractApp
|
|||
* @param {boolean} bExpanded
|
||||
*/
|
||||
setExpandedFolder(sFullNameHash, bExpanded) {
|
||||
let aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
||||
if (!Utils.isArray(aExpandedList))
|
||||
let aExpandedList = Local.get(ClientSideKeyName.ExpandedFolders);
|
||||
if (!isArray(aExpandedList))
|
||||
{
|
||||
aExpandedList = [];
|
||||
}
|
||||
|
|
@ -968,7 +981,7 @@ class AppUser extends AbstractApp
|
|||
aExpandedList = _.without(aExpandedList, sFullNameHash);
|
||||
}
|
||||
|
||||
Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList);
|
||||
Local.set(ClientSideKeyName.ExpandedFolders, aExpandedList);
|
||||
}
|
||||
|
||||
initHorizontalLayoutResizer(sClientSideKeyName) {
|
||||
|
|
@ -1001,32 +1014,32 @@ class AppUser extends AbstractApp
|
|||
|
||||
oResizableHandle
|
||||
.on('mousedown', () => {
|
||||
Globals.$html.addClass('rl-resizer');
|
||||
$html.addClass('rl-resizer');
|
||||
})
|
||||
.on('mouseup', () => {
|
||||
Globals.$html.removeClass('rl-resizer');
|
||||
$html.removeClass('rl-resizer');
|
||||
})
|
||||
;
|
||||
}
|
||||
},
|
||||
|
||||
fResizeStartFunction = () => {
|
||||
Globals.$html.addClass('rl-resizer');
|
||||
$html.addClass('rl-resizer');
|
||||
},
|
||||
|
||||
fResizeResizeFunction = _.debounce(() => {
|
||||
Globals.$html.addClass('rl-resizer');
|
||||
$html.addClass('rl-resizer');
|
||||
}, 500, true),
|
||||
|
||||
fResizeStopFunction = (oEvent, oObject) => {
|
||||
Globals.$html.removeClass('rl-resizer');
|
||||
$html.removeClass('rl-resizer');
|
||||
if (oObject && oObject.size && oObject.size.height)
|
||||
{
|
||||
Local.set(sClientSideKeyName, oObject.size.height);
|
||||
|
||||
fSetHeight(oObject.size.height);
|
||||
|
||||
Utils.windowResize();
|
||||
windowResize();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -1057,7 +1070,7 @@ class AppUser extends AbstractApp
|
|||
oBottom.removeAttr('style');
|
||||
}
|
||||
}
|
||||
else if (Globals.$html.hasClass('rl-bottom-preview-pane'))
|
||||
else if ($html.hasClass('rl-bottom-preview-pane'))
|
||||
{
|
||||
oTop = $('.b-message-list-wrapper');
|
||||
oBottom = $('.b-message-view-wrapper');
|
||||
|
|
@ -1067,7 +1080,7 @@ class AppUser extends AbstractApp
|
|||
oTop.resizable(oOptions);
|
||||
}
|
||||
|
||||
const iHeight = Utils.pInt(Local.get(sClientSideKeyName)) || 300;
|
||||
const iHeight = pInt(Local.get(sClientSideKeyName)) || 300;
|
||||
fSetHeight(iHeight > iMinHeight ? iHeight : iMinHeight);
|
||||
}
|
||||
}
|
||||
|
|
@ -1076,7 +1089,7 @@ class AppUser extends AbstractApp
|
|||
fDisable(false);
|
||||
|
||||
Events.sub('layout', (layout) => {
|
||||
fDisable(Enums.Layout.BottomPreview !== layout);
|
||||
fDisable(Layout.BottomPreview !== layout);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1093,9 +1106,9 @@ class AppUser extends AbstractApp
|
|||
fSetWidth = (iWidth) => {
|
||||
if (iWidth)
|
||||
{
|
||||
Globals.leftPanelWidth(iWidth);
|
||||
leftPanelWidth(iWidth);
|
||||
|
||||
Globals.$html.removeClass('rl-resizer');
|
||||
$html.removeClass('rl-resizer');
|
||||
|
||||
oLeft.css({
|
||||
width: '' + iWidth + 'px'
|
||||
|
|
@ -1116,7 +1129,7 @@ class AppUser extends AbstractApp
|
|||
else
|
||||
{
|
||||
oLeft.resizable('enable');
|
||||
var iWidth = Utils.pInt(Local.get(sClientSideKeyName)) || iMinWidth;
|
||||
var iWidth = pInt(Local.get(sClientSideKeyName)) || iMinWidth;
|
||||
fSetWidth(iWidth > iMinWidth ? iWidth : iMinWidth);
|
||||
}
|
||||
},
|
||||
|
|
@ -1126,27 +1139,27 @@ class AppUser extends AbstractApp
|
|||
{
|
||||
$(oEvent.target).find('.ui-resizable-handle')
|
||||
.on('mousedown', () => {
|
||||
Globals.$html.addClass('rl-resizer');
|
||||
$html.addClass('rl-resizer');
|
||||
})
|
||||
.on('mouseup', () => {
|
||||
Globals.$html.removeClass('rl-resizer');
|
||||
$html.removeClass('rl-resizer');
|
||||
})
|
||||
;
|
||||
}
|
||||
},
|
||||
fResizeResizeFunction = _.debounce(() => {
|
||||
Globals.$html.addClass('rl-resizer');
|
||||
$html.addClass('rl-resizer');
|
||||
}, 500, true),
|
||||
fResizeStartFunction = () => {
|
||||
Globals.$html.addClass('rl-resizer');
|
||||
$html.addClass('rl-resizer');
|
||||
},
|
||||
fResizeStopFunction = (oEvent, oObject) => {
|
||||
Globals.$html.removeClass('rl-resizer');
|
||||
$html.removeClass('rl-resizer');
|
||||
if (oObject && oObject.size && oObject.size.width)
|
||||
{
|
||||
Local.set(sClientSideKeyName, oObject.size.width);
|
||||
|
||||
Globals.leftPanelWidth(oObject.size.width);
|
||||
leftPanelWidth(oObject.size.width);
|
||||
|
||||
oRight.css({
|
||||
left: '' + oObject.size.width + 'px'
|
||||
|
|
@ -1204,9 +1217,9 @@ class AppUser extends AbstractApp
|
|||
|
||||
bootstartLoginScreen() {
|
||||
|
||||
Globals.$html.removeClass('rl-user-auth').addClass('rl-user-no-auth');
|
||||
$html.removeClass('rl-user-auth').addClass('rl-user-no-auth');
|
||||
|
||||
const customLoginLink = Utils.pString(Settings.appSettingsGet('customLoginLink'));
|
||||
const customLoginLink = pString(Settings.appSettingsGet('customLoginLink'));
|
||||
if (!customLoginLink)
|
||||
{
|
||||
kn.startScreens([
|
||||
|
|
@ -1253,8 +1266,8 @@ class AppUser extends AbstractApp
|
|||
|
||||
var
|
||||
sJsHash = Settings.appSettingsGet('jsHash'),
|
||||
sStartupUrl = Utils.pString(Settings.settingsGet('StartupUrl')),
|
||||
iContactsSyncInterval = Utils.pInt(Settings.settingsGet('ContactsSyncInterval')),
|
||||
sStartupUrl = pString(Settings.settingsGet('StartupUrl')),
|
||||
iContactsSyncInterval = pInt(Settings.settingsGet('ContactsSyncInterval')),
|
||||
bGoogle = Settings.settingsGet('AllowGoogleSocial'),
|
||||
bFacebook = Settings.settingsGet('AllowFacebookSocial'),
|
||||
bTwitter = Settings.settingsGet('AllowTwitterSocial')
|
||||
|
|
@ -1265,17 +1278,17 @@ class AppUser extends AbstractApp
|
|||
progressJs.set(90);
|
||||
}
|
||||
|
||||
Globals.leftPanelDisabled.subscribe((value) => {
|
||||
leftPanelDisabled.subscribe((value) => {
|
||||
Events.pub('left-panel.' + (value ? 'off' : 'on'));
|
||||
});
|
||||
|
||||
this.setWindowTitle('');
|
||||
if (Settings.settingsGet('Auth'))
|
||||
{
|
||||
Globals.$html.addClass('rl-user-auth');
|
||||
$html.addClass('rl-user-auth');
|
||||
|
||||
if (Settings.capa(Enums.Capa.TwoFactor) &&
|
||||
Settings.capa(Enums.Capa.TwoFactorForce) &&
|
||||
if (Settings.capa(Capa.TwoFactor) &&
|
||||
Settings.capa(Capa.TwoFactorForce) &&
|
||||
Settings.settingsGet('RequireTwoFactor'))
|
||||
{
|
||||
this.bootend();
|
||||
|
|
@ -1300,7 +1313,7 @@ class AppUser extends AbstractApp
|
|||
kn.routeOn();
|
||||
}
|
||||
|
||||
if (window.jassl && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
|
||||
if (window.jassl && window.crypto && window.crypto.getRandomValues && Settings.capa(Capa.OpenPGP))
|
||||
{
|
||||
const openpgpCallback = (openpgp) => {
|
||||
|
||||
|
|
@ -1314,7 +1327,7 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
catch (e)
|
||||
{
|
||||
Utils.log(e);
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1347,7 +1360,7 @@ class AppUser extends AbstractApp
|
|||
|
||||
kn.startScreens([
|
||||
require('Screen/User/MailBox'),
|
||||
Settings.capa(Enums.Capa.Settings) ? require('Screen/User/Settings') : null
|
||||
Settings.capa(Capa.Settings) ? require('Screen/User/Settings') : null
|
||||
// false ? require('Screen/User/About') : null
|
||||
]);
|
||||
|
||||
|
|
@ -1388,7 +1401,7 @@ class AppUser extends AbstractApp
|
|||
}, 1000);
|
||||
|
||||
_.delay(() => this.quota(), 5000);
|
||||
_.delay(() => Remote.appDelayStart(Utils.emptyFunction), 35000);
|
||||
_.delay(() => Remote.appDelayStart(noop), 35000);
|
||||
|
||||
Events.sub('rl.auto-logout', () => this.logout());
|
||||
|
||||
|
|
@ -1402,7 +1415,7 @@ class AppUser extends AbstractApp
|
|||
|
||||
if (!!Settings.settingsGet('AccountSignMe') &&
|
||||
window.navigator.registerProtocolHandler &&
|
||||
Settings.capa(Enums.Capa.Composer))
|
||||
Settings.capa(Capa.Composer))
|
||||
{
|
||||
_.delay(() => {
|
||||
try {
|
||||
|
|
@ -1413,14 +1426,14 @@ class AppUser extends AbstractApp
|
|||
|
||||
if (Settings.settingsGet('MailToEmail'))
|
||||
{
|
||||
Utils.mailToHelper(Settings.settingsGet('MailToEmail'), require('View/Popup/Compose'));
|
||||
mailToHelper(Settings.settingsGet('MailToEmail'), require('View/Popup/Compose'));
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (!Globals.bMobileDevice)
|
||||
if (!bMobileDevice)
|
||||
{
|
||||
_.defer(() => this.initVerticalLayoutResizer(Enums.ClientSideKeyName.FolderListSize));
|
||||
_.defer(() => this.initVerticalLayoutResizer(ClientSideKeyName.FolderListSize));
|
||||
|
||||
if (Tinycon && Settings.appSettingsGet('faviconStatus') && !Settings.appSettingsGet('listPermanentFiltered'))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue