Cleanup *App classes

This commit is contained in:
djmaze 2021-03-25 10:54:40 +01:00
parent 673bd49095
commit 240b0381f9
5 changed files with 23 additions and 38 deletions

View file

@ -1,8 +1,6 @@
import ko from 'ko';
import {
doc,
createElement,
elementById,
Settings
} from 'Common/Globals';
@ -27,27 +25,6 @@ export class AbstractApp {
this.Remote = Remote;
}
remote() {
return this.Remote || null;
}
/**
* @param {string} link
* @returns {boolean}
*/
download(link) {
if (ThemeStore.isMobile()) {
open(link, '_self');
focus();
} else {
const oLink = createElement('a');
oLink.href = link;
doc.body.appendChild(oLink).click();
oLink.remove();
}
return true;
}
logoutReload(close = false) {
const url = logoutLink();
@ -75,7 +52,7 @@ export class AbstractApp {
i18nToNodes(componentInfo.element);
if (undefined !== params.inline && ko.unwrap(params.inline)) {
if (params.inline && ko.unwrap(params.inline)) {
params.element.style.display = 'inline-block';
}
}
@ -88,12 +65,8 @@ export class AbstractApp {
register('Input', InputComponent);
register('Select', SelectComponent);
register('TextArea', TextAreaComponent);
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
if (!Settings.app('materialDesign')) {
register('Checkbox', CheckboxComponent);
} else {
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
}
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
initOnStartOrLangChange();

View file

@ -16,10 +16,6 @@ class AdminApp extends AbstractApp {
this.weakPassword = ko.observable(false);
}
bootend() {
progressJs.end();
}
bootstart() {
super.bootstart();
@ -35,7 +31,7 @@ class AdminApp extends AbstractApp {
startScreens([LoginAdminScreen]);
}
this.bootend();
progressJs.end();
}
}

View file

@ -867,6 +867,23 @@ class AppUser extends AbstractApp {
}
}
/**
* @param {string} link
* @returns {boolean}
*/
download(link) {
if (ThemeStore.isMobile()) {
open(link, '_self');
focus();
} else {
const oLink = createElement('a');
oLink.href = link;
doc.body.appendChild(oLink).click();
oLink.remove();
}
return true;
}
logout() {
Remote.logout(() => this.logoutReload((SettingsGet('ParentEmail')||{length:0}).length));
}

View file

@ -11,7 +11,7 @@ const USER_VIEW_MODELS_HOOKS = [],
* @param {?number=} timeout
*/
rl.pluginRemoteRequest = (callback, action, parameters, timeout) => {
rl.app && rl.app.remote().defaultRequest(callback, 'Plugin' + action, parameters, timeout);
rl.app && rl.app.Remote.defaultRequest(callback, 'Plugin' + action, parameters, timeout);
};
/**

View file

@ -773,8 +773,8 @@ class Actions
$sLogFileFullPath = \APP_PRIVATE_DATA . 'logs/' . $this->compileLogFileName($sLogFileName);
$sLogFileDir = \dirname($sLogFileFullPath);
if (!is_dir($sLogFileDir)) {
mkdir($sLogFileDir, 0755, true);
if (!\is_dir($sLogFileDir)) {
\mkdir($sLogFileDir, 0755, true);
}
$oDriver = new \MailSo\Log\Drivers\File($sLogFileFullPath);
@ -1009,7 +1009,6 @@ class Actions
'useImapThread' => (bool)$oConfig->Get('labs', 'use_imap_thread', false),
'useImapSubscribe' => (bool)$oConfig->Get('labs', 'use_imap_list_subscribe', true),
'allowAppendMessage' => (bool)$oConfig->Get('labs', 'allow_message_append', false),
'materialDesign' => (bool)$oConfig->Get('labs', 'use_material_design', true),
'folderSpecLimit' => (int)$oConfig->Get('labs', 'folders_spec_limit', 50),
'faviconStatus' => (bool)$oConfig->Get('labs', 'favicon_status', true),
'listPermanentFiltered' => '' !== \trim(Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')),