mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Cleanup *App classes
This commit is contained in:
parent
673bd49095
commit
240b0381f9
5 changed files with 23 additions and 38 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
doc,
|
|
||||||
createElement,
|
|
||||||
elementById,
|
elementById,
|
||||||
Settings
|
Settings
|
||||||
} from 'Common/Globals';
|
} from 'Common/Globals';
|
||||||
|
|
@ -27,27 +25,6 @@ export class AbstractApp {
|
||||||
this.Remote = Remote;
|
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) {
|
logoutReload(close = false) {
|
||||||
const url = logoutLink();
|
const url = logoutLink();
|
||||||
|
|
||||||
|
|
@ -75,7 +52,7 @@ export class AbstractApp {
|
||||||
|
|
||||||
i18nToNodes(componentInfo.element);
|
i18nToNodes(componentInfo.element);
|
||||||
|
|
||||||
if (undefined !== params.inline && ko.unwrap(params.inline)) {
|
if (params.inline && ko.unwrap(params.inline)) {
|
||||||
params.element.style.display = 'inline-block';
|
params.element.style.display = 'inline-block';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -88,12 +65,8 @@ export class AbstractApp {
|
||||||
register('Input', InputComponent);
|
register('Input', InputComponent);
|
||||||
register('Select', SelectComponent);
|
register('Select', SelectComponent);
|
||||||
register('TextArea', TextAreaComponent);
|
register('TextArea', TextAreaComponent);
|
||||||
|
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
||||||
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
|
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
|
||||||
if (!Settings.app('materialDesign')) {
|
|
||||||
register('Checkbox', CheckboxComponent);
|
|
||||||
} else {
|
|
||||||
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
|
||||||
}
|
|
||||||
|
|
||||||
initOnStartOrLangChange();
|
initOnStartOrLangChange();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,6 @@ class AdminApp extends AbstractApp {
|
||||||
this.weakPassword = ko.observable(false);
|
this.weakPassword = ko.observable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bootend() {
|
|
||||||
progressJs.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstart() {
|
bootstart() {
|
||||||
super.bootstart();
|
super.bootstart();
|
||||||
|
|
||||||
|
|
@ -35,7 +31,7 @@ class AdminApp extends AbstractApp {
|
||||||
startScreens([LoginAdminScreen]);
|
startScreens([LoginAdminScreen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bootend();
|
progressJs.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
logout() {
|
||||||
Remote.logout(() => this.logoutReload((SettingsGet('ParentEmail')||{length:0}).length));
|
Remote.logout(() => this.logoutReload((SettingsGet('ParentEmail')||{length:0}).length));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const USER_VIEW_MODELS_HOOKS = [],
|
||||||
* @param {?number=} timeout
|
* @param {?number=} timeout
|
||||||
*/
|
*/
|
||||||
rl.pluginRemoteRequest = (callback, action, parameters, 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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -773,8 +773,8 @@ class Actions
|
||||||
$sLogFileFullPath = \APP_PRIVATE_DATA . 'logs/' . $this->compileLogFileName($sLogFileName);
|
$sLogFileFullPath = \APP_PRIVATE_DATA . 'logs/' . $this->compileLogFileName($sLogFileName);
|
||||||
$sLogFileDir = \dirname($sLogFileFullPath);
|
$sLogFileDir = \dirname($sLogFileFullPath);
|
||||||
|
|
||||||
if (!is_dir($sLogFileDir)) {
|
if (!\is_dir($sLogFileDir)) {
|
||||||
mkdir($sLogFileDir, 0755, true);
|
\mkdir($sLogFileDir, 0755, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDriver = new \MailSo\Log\Drivers\File($sLogFileFullPath);
|
$oDriver = new \MailSo\Log\Drivers\File($sLogFileFullPath);
|
||||||
|
|
@ -1009,7 +1009,6 @@ class Actions
|
||||||
'useImapThread' => (bool)$oConfig->Get('labs', 'use_imap_thread', false),
|
'useImapThread' => (bool)$oConfig->Get('labs', 'use_imap_thread', false),
|
||||||
'useImapSubscribe' => (bool)$oConfig->Get('labs', 'use_imap_list_subscribe', true),
|
'useImapSubscribe' => (bool)$oConfig->Get('labs', 'use_imap_list_subscribe', true),
|
||||||
'allowAppendMessage' => (bool)$oConfig->Get('labs', 'allow_message_append', false),
|
'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),
|
'folderSpecLimit' => (int)$oConfig->Get('labs', 'folders_spec_limit', 50),
|
||||||
'faviconStatus' => (bool)$oConfig->Get('labs', 'favicon_status', true),
|
'faviconStatus' => (bool)$oConfig->Get('labs', 'favicon_status', true),
|
||||||
'listPermanentFiltered' => '' !== \trim(Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')),
|
'listPermanentFiltered' => '' !== \trim(Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue