mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Some small cleanups and fixes
This commit is contained in:
parent
e7c7b8ed53
commit
962ddde1f3
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
define('ROOT_DIR', dirname(__DIR__));
|
||||
define('PLUGINS_DEST_DIR', dirname(__DIR__) . '/build/dist/releases/plugins');
|
||||
define('PLUGINS_DEST_DIR', __DIR__ . '/dist/releases/plugins');
|
||||
|
||||
$destPath = __DIR__ . 'build/dist/releases/plugins/';
|
||||
is_dir(PLUGINS_DEST_DIR) || mkdir(PLUGINS_DEST_DIR, 0777, true);
|
||||
|
|
|
@ -6,7 +6,7 @@ const
|
|||
HASH_PREFIX = '#/',
|
||||
SERVER_PREFIX = './?',
|
||||
VERSION = Settings.app('version'),
|
||||
VERSION_PREFIX = Settings.app('webVersionPath') || 'snappymail/v/' + VERSION + '/',
|
||||
VERSION_PREFIX = () => Settings.app('webVersionPath') || 'snappymail/v/' + VERSION + '/',
|
||||
|
||||
adminPath = () => rl.adminArea() && !Settings.app('adminHostUse'),
|
||||
|
||||
|
@ -75,14 +75,14 @@ export const
|
|||
* @param {string} path
|
||||
* @returns {string}
|
||||
*/
|
||||
staticLink = path => VERSION_PREFIX + 'static/' + path,
|
||||
staticLink = path => VERSION_PREFIX() + 'static/' + path,
|
||||
|
||||
/**
|
||||
* @param {string} theme
|
||||
* @returns {string}
|
||||
*/
|
||||
themePreviewLink = theme => {
|
||||
let prefix = VERSION_PREFIX;
|
||||
let prefix = VERSION_PREFIX();
|
||||
if ('@custom' === theme.slice(-7)) {
|
||||
theme = theme.slice(0, theme.length - 7).trim();
|
||||
prefix = Settings.app('webPath') || '';
|
||||
|
|
|
@ -44,7 +44,7 @@ export const
|
|||
/* // Without deprecated 'unescape':
|
||||
b64EncodeJSON = data => btoa(encodeURIComponent(JSON.stringify(data)).replace(
|
||||
/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode('0x' + p1)
|
||||
)),
|
||||
)),
|
||||
*/
|
||||
b64EncodeJSONSafe = data => b64EncodeJSON(data).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''),
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { MessageFlagsCache, addRequestedMessage } from 'Common/Cache';
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { MessageSetAction, ComposeType/*, FolderType*/ } from 'Common/EnumsUser';
|
||||
import { doc, createElement, elementById } from 'Common/Globals';
|
||||
import { plainToHtml } from 'Common/Html';
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { koComputable } from 'External/ko';
|
||||
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { MessageSetAction } from 'Common/EnumsUser';
|
||||
import { $htmlCL } from 'Common/Globals';
|
||||
import { arrayLength, pInt, pString } from 'Common/Utils';
|
||||
|
|
|
@ -11,16 +11,16 @@ import { DomainAdminStore } from 'Stores/Admin/Domain';
|
|||
const domainToParams = oDomain => ({
|
||||
Name: oDomain.name(),
|
||||
|
||||
IncHost: oDomain.imapServer(),
|
||||
IncHost: oDomain.imapHost(),
|
||||
IncPort: oDomain.imapPort(),
|
||||
IncSecure: oDomain.imapSecure(),
|
||||
|
||||
UseSieve: oDomain.useSieve() ? 1 : 0,
|
||||
SieveHost: oDomain.sieveServer(),
|
||||
SieveHost: oDomain.sieveHost(),
|
||||
SievePort: oDomain.sievePort(),
|
||||
SieveSecure: oDomain.sieveSecure(),
|
||||
|
||||
OutHost: oDomain.smtpServer(),
|
||||
OutHost: oDomain.smtpHost(),
|
||||
OutPort: oDomain.smtpPort(),
|
||||
OutSecure: oDomain.smtpSecure(),
|
||||
OutAuth: oDomain.smtpAuth() ? 1 : 0,
|
||||
|
@ -46,9 +46,9 @@ class DomainPopupView extends AbstractViewPopup {
|
|||
testingSieveErrorDesc: '',
|
||||
testingSmtpErrorDesc: '',
|
||||
|
||||
imapServerFocus: false,
|
||||
sieveServerFocus: false,
|
||||
smtpServerFocus: false,
|
||||
imapHostFocus: false,
|
||||
sieveHostFocus: false,
|
||||
smtpHostFocus: false,
|
||||
});
|
||||
|
||||
this.addComputables({
|
||||
|
@ -83,10 +83,10 @@ class DomainPopupView extends AbstractViewPopup {
|
|||
|
||||
return (
|
||||
this.name() &&
|
||||
this.imapServer() &&
|
||||
this.imapHost() &&
|
||||
this.imapPort() &&
|
||||
(useSieve ? this.sieveServer() && this.sievePort() : true) &&
|
||||
((this.smtpServer() && this.smtpPort()) || usePhpMail)
|
||||
(useSieve ? this.sieveHost() && this.sievePort() : true) &&
|
||||
((this.smtpHost() && this.smtpPort()) || usePhpMail)
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -100,14 +100,14 @@ class DomainPopupView extends AbstractViewPopup {
|
|||
testingSmtpError: value => value || this.testingSmtpErrorDesc(''),
|
||||
|
||||
// smart form improvements
|
||||
imapServerFocus: value =>
|
||||
value && this.name() && !this.imapServer() && this.imapServer(this.name().replace(/[.]?[*][.]?/g, '')),
|
||||
imapHostFocus: value =>
|
||||
value && this.name() && !this.imapHost() && this.imapHost(this.name().replace(/[.]?[*][.]?/g, '')),
|
||||
|
||||
sieveServerFocus: value =>
|
||||
value && this.imapServer() && !this.sieveServer() && this.sieveServer(this.imapServer()),
|
||||
sieveHostFocus: value =>
|
||||
value && this.imapHost() && !this.sieveHost() && this.sieveHost(this.imapHost()),
|
||||
|
||||
smtpServerFocus: value => value && this.imapServer() && !this.smtpServer()
|
||||
&& this.smtpServer(this.imapServer().replace(/imap/gi, 'smtp')),
|
||||
smtpHostFocus: value => value && this.imapHost() && !this.smtpHost()
|
||||
&& this.smtpHost(this.imapHost().replace(/imap/gi, 'smtp')),
|
||||
|
||||
imapSecure: value => {
|
||||
if (this.enableSmartPorts()) {
|
||||
|
@ -247,15 +247,15 @@ class DomainPopupView extends AbstractViewPopup {
|
|||
this.edit(true);
|
||||
|
||||
this.name(oDomain.Name);
|
||||
this.imapServer(oDomain.IncHost);
|
||||
this.imapHost(oDomain.IncHost);
|
||||
this.imapPort('' + pInt(oDomain.IncPort));
|
||||
this.imapSecure(oDomain.IncSecure);
|
||||
this.imapShortLogin(!!oDomain.IncShortLogin);
|
||||
this.useSieve(!!oDomain.UseSieve);
|
||||
this.sieveServer(oDomain.SieveHost);
|
||||
this.sieveHost(oDomain.SieveHost);
|
||||
this.sievePort('' + pInt(oDomain.SievePort));
|
||||
this.sieveSecure(oDomain.SieveSecure);
|
||||
this.smtpServer(oDomain.OutHost);
|
||||
this.smtpHost(oDomain.OutHost);
|
||||
this.smtpPort('' + pInt(oDomain.OutPort));
|
||||
this.smtpSecure(oDomain.OutSecure);
|
||||
this.smtpShortLogin(!!oDomain.OutShortLogin);
|
||||
|
@ -275,17 +275,17 @@ class DomainPopupView extends AbstractViewPopup {
|
|||
|
||||
name: '',
|
||||
|
||||
imapServer: '',
|
||||
imapHost: '',
|
||||
imapPort: '143',
|
||||
imapSecure: 0,
|
||||
imapShortLogin: false,
|
||||
|
||||
useSieve: false,
|
||||
sieveServer: '',
|
||||
sieveHost: '',
|
||||
sievePort: '4190',
|
||||
sieveSecure: 0,
|
||||
|
||||
smtpServer: '',
|
||||
smtpHost: '',
|
||||
smtpPort: '25',
|
||||
smtpSecure: 0,
|
||||
smtpShortLogin: false,
|
||||
|
|
|
@ -16,9 +16,7 @@ class Settings extends \RainLoop\Providers\AbstractProvider
|
|||
|
||||
public function Load(\RainLoop\Model\Account $oAccount) : \RainLoop\Settings
|
||||
{
|
||||
$oSettings = new \RainLoop\Settings();
|
||||
$oSettings->InitData($this->oDriver->Load($oAccount));
|
||||
return $oSettings;
|
||||
return new \RainLoop\Settings($this->oDriver->Load($oAccount));
|
||||
}
|
||||
|
||||
public function Save(\RainLoop\Model\Account $oAccount, \RainLoop\Settings $oSettings) : bool
|
||||
|
|
|
@ -7,14 +7,9 @@ class Settings
|
|||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $aData;
|
||||
protected $aData = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->aData = array();
|
||||
}
|
||||
|
||||
public function InitData(array $aData) : void
|
||||
public function __construct(array $aData)
|
||||
{
|
||||
$this->aData = $aData;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<span data-i18n="POPUPS_DOMAIN/LABEL_SERVER"></span>
|
||||
<br>
|
||||
<input type="text" class="span3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="textInput: imapServer, hasfocus: imapServerFocus">
|
||||
data-bind="textInput: imapHost, hasfocus: imapHostFocus">
|
||||
</div>
|
||||
<div class="span2">
|
||||
<span data-i18n="POPUPS_DOMAIN/LABEL_SECURE"></span>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<span data-i18n="POPUPS_DOMAIN/LABEL_SERVER"></span>
|
||||
<br>
|
||||
<input type="text" class="span3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="textInput: smtpServer, hasfocus: smtpServerFocus">
|
||||
data-bind="textInput: smtpHost, hasfocus: smtpHostFocus">
|
||||
</div>
|
||||
<div class="span2">
|
||||
<span data-i18n="POPUPS_DOMAIN/LABEL_SECURE"></span>
|
||||
|
@ -152,7 +152,7 @@
|
|||
<span data-i18n="POPUPS_DOMAIN/LABEL_SERVER"></span>
|
||||
<br>
|
||||
<input type="text" class="span3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="textInput: sieveServer, hasfocus: sieveServerFocus">
|
||||
data-bind="textInput: sieveHost, hasfocus: sieveHostFocus">
|
||||
</div>
|
||||
<div class="span2">
|
||||
<span data-i18n="POPUPS_DOMAIN/LABEL_SECURE"></span>
|
||||
|
|
Loading…
Reference in a new issue