Skip to content

Commit 240b038

Browse files
author
djmaze
committed
Cleanup *App classes
1 parent 673bd49 commit 240b038

File tree

5 files changed

+23
-38
lines changed

5 files changed

+23
-38
lines changed

dev/App/Abstract.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import ko from 'ko';
22

33
import {
4-
doc,
5-
createElement,
64
elementById,
75
Settings
86
} from 'Common/Globals';
@@ -27,27 +25,6 @@ export class AbstractApp {
2725
this.Remote = Remote;
2826
}
2927

30-
remote() {
31-
return this.Remote || null;
32-
}
33-
34-
/**
35-
* @param {string} link
36-
* @returns {boolean}
37-
*/
38-
download(link) {
39-
if (ThemeStore.isMobile()) {
40-
open(link, '_self');
41-
focus();
42-
} else {
43-
const oLink = createElement('a');
44-
oLink.href = link;
45-
doc.body.appendChild(oLink).click();
46-
oLink.remove();
47-
}
48-
return true;
49-
}
50-
5128
logoutReload(close = false) {
5229
const url = logoutLink();
5330

@@ -75,7 +52,7 @@ export class AbstractApp {
7552

7653
i18nToNodes(componentInfo.element);
7754

78-
if (undefined !== params.inline && ko.unwrap(params.inline)) {
55+
if (params.inline && ko.unwrap(params.inline)) {
7956
params.element.style.display = 'inline-block';
8057
}
8158
}
@@ -88,12 +65,8 @@ export class AbstractApp {
8865
register('Input', InputComponent);
8966
register('Select', SelectComponent);
9067
register('TextArea', TextAreaComponent);
68+
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
9169
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
92-
if (!Settings.app('materialDesign')) {
93-
register('Checkbox', CheckboxComponent);
94-
} else {
95-
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
96-
}
9770

9871
initOnStartOrLangChange();
9972

dev/App/Admin.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class AdminApp extends AbstractApp {
1616
this.weakPassword = ko.observable(false);
1717
}
1818

19-
bootend() {
20-
progressJs.end();
21-
}
22-
2319
bootstart() {
2420
super.bootstart();
2521

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

38-
this.bootend();
34+
progressJs.end();
3935
}
4036
}
4137

dev/App/User.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,23 @@ class AppUser extends AbstractApp {
867867
}
868868
}
869869

870+
/**
871+
* @param {string} link
872+
* @returns {boolean}
873+
*/
874+
download(link) {
875+
if (ThemeStore.isMobile()) {
876+
open(link, '_self');
877+
focus();
878+
} else {
879+
const oLink = createElement('a');
880+
oLink.href = link;
881+
doc.body.appendChild(oLink).click();
882+
oLink.remove();
883+
}
884+
return true;
885+
}
886+
870887
logout() {
871888
Remote.logout(() => this.logoutReload((SettingsGet('ParentEmail')||{length:0}).length));
872889
}

dev/Common/Plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const USER_VIEW_MODELS_HOOKS = [],
1111
* @param {?number=} timeout
1212
*/
1313
rl.pluginRemoteRequest = (callback, action, parameters, timeout) => {
14-
rl.app && rl.app.remote().defaultRequest(callback, 'Plugin' + action, parameters, timeout);
14+
rl.app && rl.app.Remote.defaultRequest(callback, 'Plugin' + action, parameters, timeout);
1515
};
1616

1717
/**

snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,8 @@ public function Logger(): \MailSo\Log\Logger
773773
$sLogFileFullPath = \APP_PRIVATE_DATA . 'logs/' . $this->compileLogFileName($sLogFileName);
774774
$sLogFileDir = \dirname($sLogFileFullPath);
775775

776-
if (!is_dir($sLogFileDir)) {
777-
mkdir($sLogFileDir, 0755, true);
776+
if (!\is_dir($sLogFileDir)) {
777+
\mkdir($sLogFileDir, 0755, true);
778778
}
779779

780780
$oDriver = new \MailSo\Log\Drivers\File($sLogFileFullPath);
@@ -1009,7 +1009,6 @@ public function AppDataSystem(bool $bAdmin = false): array
10091009
'useImapThread' => (bool)$oConfig->Get('labs', 'use_imap_thread', false),
10101010
'useImapSubscribe' => (bool)$oConfig->Get('labs', 'use_imap_list_subscribe', true),
10111011
'allowAppendMessage' => (bool)$oConfig->Get('labs', 'allow_message_append', false),
1012-
'materialDesign' => (bool)$oConfig->Get('labs', 'use_material_design', true),
10131012
'folderSpecLimit' => (int)$oConfig->Get('labs', 'folders_spec_limit', 50),
10141013
'faviconStatus' => (bool)$oConfig->Get('labs', 'favicon_status', true),
10151014
'listPermanentFiltered' => '' !== \trim(Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')),

0 commit comments

Comments
 (0)