cleanup some code

This commit is contained in:
djmaze 2020-10-02 12:40:33 +02:00
parent e566494a87
commit cb2048f163
14 changed files with 32 additions and 117 deletions

View file

@ -83,23 +83,6 @@ export const Focused = {
FolderList: 'folder-list'
};
/**
* @enum {number}
*/
export const State = {
Empty: 10,
Login: 20,
Auth: 30
};
/**
* @enum {number}
*/
export const StateType = {
Webmail: 0,
Admin: 1
};
/**
* @enum {string}
*/
@ -108,7 +91,6 @@ export const Capa = {
TwoFactorForce: 'TWO_FACTOR_FORCE',
OpenPGP: 'OPEN_PGP',
Prefetch: 'PREFETCH',
Gravatar: 'GRAVATAR',
Folders: 'FOLDERS',
Composer: 'COMPOSER',
Contacts: 'CONTACTS',
@ -252,7 +234,7 @@ export const ClientSideKeyName = {
LastSignMe: 7,
ComposeLastIdentityID: 8,
MessageHeaderFullInfo: 9,
MessageAttachmnetControls: 10
MessageAttachmentControls: 10
};
/**
@ -432,17 +414,6 @@ export const ContactPropertyType = {
Custom: 250
};
/**
* @enum {number}
*/
export const Ports = {
Imap: 143,
ImapSsl: 993,
Smtp: 25,
SmtpSsl: 465,
SmtpStartTls: 587
};
/**
* @enum {number}
*/

View file

@ -7,11 +7,7 @@ const
SERVER_PREFIX = './?',
SUB_QUERY_PREFIX = '&q[]=',
VERSION = Settings.app('version'),
WEB_PREFIX = Settings.app('webPath') || '',
VERSION_PREFIX = Settings.app('webVersionPath') || 'rainloop/v/' + VERSION + '/',
STATIC_PREFIX = VERSION_PREFIX + 'static/',
ADMIN_HOST_USE = !!Settings.app('adminHostUse'),
ADMIN_PATH = Settings.app('adminPath') || 'admin',
getHash = () => Settings.get('AuthAccountHash') || '0';
@ -34,7 +30,7 @@ export function root(startupUrl = '') {
* @returns {string}
*/
export function rootAdmin() {
return ADMIN_HOST_USE ? ROOT : SERVER_PREFIX + ADMIN_PATH;
return Settings.app('adminHostUse') ? ROOT : SERVER_PREFIX + (Settings.app('adminPath') || 'admin');
}
/**
@ -238,7 +234,7 @@ export function exportContactsCsv() {
* @returns {string}
*/
export function staticPrefix(path) {
return STATIC_PREFIX + path;
return VERSION_PREFIX + 'static/' + path;
}
/**
@ -292,7 +288,7 @@ export function themePreviewLink(theme) {
let prefix = VERSION_PREFIX;
if ('@custom' === theme.substr(-7)) {
theme = theme.substr(0, theme.length - 7).trim();
prefix = WEB_PREFIX;
prefix = Settings.app('webPath') || '';
}
return prefix + 'themes/' + encodeURI(theme) + '/images/preview.png';