Skip to content

Commit

Permalink
Cleanup *App classes
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaze committed Mar 25, 2021
1 parent 673bd49 commit 240b038
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 38 deletions.
31 changes: 2 additions & 29 deletions dev/App/Abstract.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import ko from 'ko';

import {
doc,
createElement,
elementById,
Settings
} from 'Common/Globals';
Expand All @@ -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();

Expand Down Expand Up @@ -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';
}
}
Expand All @@ -88,12 +65,8 @@ export class AbstractApp {
register('Input', InputComponent);
register('Select', SelectComponent);
register('TextArea', TextAreaComponent);
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
if (!Settings.app('materialDesign')) {
register('Checkbox', CheckboxComponent);
} else {
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
}

initOnStartOrLangChange();

Expand Down
6 changes: 1 addition & 5 deletions dev/App/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ class AdminApp extends AbstractApp {
this.weakPassword = ko.observable(false);
}

bootend() {
progressJs.end();
}

bootstart() {
super.bootstart();

Expand All @@ -35,7 +31,7 @@ class AdminApp extends AbstractApp {
startScreens([LoginAdminScreen]);
}

this.bootend();
progressJs.end();
}
}

Expand Down
17 changes: 17 additions & 0 deletions dev/App/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion dev/Common/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down
5 changes: 2 additions & 3 deletions snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ public function Logger(): \MailSo\Log\Logger
$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);
Expand Down Expand Up @@ -1009,7 +1009,6 @@ public function AppDataSystem(bool $bAdmin = false): array
'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', '')),
Expand Down

0 comments on commit 240b038

Please sign in to comment.