mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 08:57:03 +03:00
Resolve #538
This commit is contained in:
parent
e623351d24
commit
23bbd10b9a
5 changed files with 25 additions and 29 deletions
|
|
@ -18,6 +18,7 @@ const
|
||||||
script.onload = () => resolve();
|
script.onload = () => resolve();
|
||||||
script.onerror = () => reject(new Error('Failed loading ' + src));
|
script.onerror = () => reject(new Error('Failed loading ' + src));
|
||||||
script.src = src;
|
script.src = src;
|
||||||
|
// script.async = true;
|
||||||
doc.head.append(script);
|
doc.head.append(script);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -198,22 +198,17 @@ abstract class Service
|
||||||
if ($sResult) {
|
if ($sResult) {
|
||||||
$sResult .= '<!--cached-->';
|
$sResult .= '<!--cached-->';
|
||||||
} else {
|
} else {
|
||||||
$aTemplateParameters['{{BaseAppThemeCss}}'] = $oActions->compileCss($oActions->GetTheme($bAdmin), $bAdmin);
|
|
||||||
$aTemplateParameters['{{BaseLanguage}}'] = $oActions->compileLanguage($sLanguage, $bAdmin);
|
|
||||||
$aTemplateParameters['{{BaseTemplates}}'] = $oServiceActions->compileTemplates($bAdmin);
|
|
||||||
$aTemplateParameters['{{BaseAppBootCss}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot'.$sAppCssMin.'.css');
|
$aTemplateParameters['{{BaseAppBootCss}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot'.$sAppCssMin.'.css');
|
||||||
$aTemplateParameters['{{BaseAppBootScript}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/js'.($sAppJsMin ? '/min' : '').'/boot'.$sAppJsMin.'.js');
|
$aTemplateParameters['{{BaseAppBootScript}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/js'.($sAppJsMin ? '/min' : '').'/boot'.$sAppJsMin.'.js');
|
||||||
$sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters);
|
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace(
|
||||||
|
'/\\s*([:;{},]+)\\s*/s',
|
||||||
if ($sAppJsMin || $sAppCssMin) {
|
'$1',
|
||||||
$sResult = \preg_replace(
|
$oActions->compileCss($oActions->GetTheme($bAdmin), $bAdmin)
|
||||||
['@\\s*/>@', '/\\s* /i', '/ \\s*/i', '/>\\s+</'],
|
);
|
||||||
['>', "\xC2\xA0", "\xC2\xA0", '><'],
|
$aTemplateParameters['{{BaseLanguage}}'] = $oActions->compileLanguage($sLanguage, $bAdmin);
|
||||||
\trim($sResult)
|
$aTemplateParameters['{{BaseTemplates}}'] = Utils::ClearHtmlOutput($oServiceActions->compileTemplates($bAdmin));
|
||||||
);
|
$sResult = Utils::ClearHtmlOutput(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'));
|
||||||
} else {
|
$sResult = \strtr($sResult, $aTemplateParameters);
|
||||||
$sResult = Utils::ClearHtmlOutput($sResult);
|
|
||||||
}
|
|
||||||
if ($sCacheFileName) {
|
if ($sCacheFileName) {
|
||||||
$oActions->Cacher()->Set($sCacheFileName, $sResult);
|
$oActions->Cacher()->Set($sCacheFileName, $sResult);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -864,7 +864,7 @@ class ServiceActions
|
||||||
foreach ($aTemplates as $sName => $sFile) {
|
foreach ($aTemplates as $sName => $sFile) {
|
||||||
$sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName);
|
$sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName);
|
||||||
$sHtml .= '<template id="'.$sName.'">'
|
$sHtml .= '<template id="'.$sName.'">'
|
||||||
. Utils::ClearHtmlOutput(\preg_replace('/<(\/?)script/i', '<$1x-script', \file_get_contents($sFile)))
|
. \preg_replace('/<(\/?)script/i', '<$1x-script', \file_get_contents($sFile))
|
||||||
. '</template>';
|
. '</template>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,11 +82,11 @@ class Utils
|
||||||
public static function ClearHtmlOutput(string $sHtml) : string
|
public static function ClearHtmlOutput(string $sHtml) : string
|
||||||
{
|
{
|
||||||
// return $sHtml;
|
// return $sHtml;
|
||||||
return \preg_replace(
|
return \preg_replace('/>\\s+</', '><', \preg_replace(
|
||||||
['@\\s*/>@', '/\\s* /i', '/ \\s*/i', '/[\\r\\n\\t]+/', '/>\\s+</'],
|
['@\\s*/>@', '/\\s* /i', '/ \\s*/i', '/[\\r\\n\\t]+/'],
|
||||||
['>', "\xC2\xA0", "\xC2\xA0", ' ', '><'],
|
['>', "\xC2\xA0", "\xC2\xA0", ' '],
|
||||||
\trim($sHtml)
|
\trim($sHtml)
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.thm-message-list-top-toolbar, .thm-message-list-bottom-toolbar {
|
.thm-message-list-top-toolbar, .thm-message-list-bottom-toolbar {
|
||||||
background-image: linear-gradient(to bottom,#444,#111) !important;
|
background-image: linear-gradient(to bottom,#444,#111) !important;
|
||||||
background-repeat: repeat-x !important;
|
background-repeat: repeat-x !important;
|
||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,8 +77,8 @@
|
||||||
box-shadow: inset 0 2px 4px rgba(255,255,255,.5), 0 1px 2px rgba(255,255,255,.25);
|
box-shadow: inset 0 2px 4px rgba(255,255,255,.5), 0 1px 2px rgba(255,255,255,.25);
|
||||||
}
|
}
|
||||||
.btn .icon-spinner {
|
.btn .icon-spinner {
|
||||||
border-color: #333;
|
border-color: #333;
|
||||||
border-top-color: #ccc;
|
border-top-color: #ccc;
|
||||||
}
|
}
|
||||||
.btn .caret {
|
.btn .caret {
|
||||||
border-top-color: var(--main-color);
|
border-top-color: var(--main-color);
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
|
|
||||||
.messageListItem {
|
.messageListItem {
|
||||||
border-left-color: #111;
|
border-left-color: #111;
|
||||||
color: #EEE;
|
color: #EEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-hover tbody tr:hover td,
|
.table-hover tbody tr:hover td,
|
||||||
|
|
@ -150,12 +150,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
input, textarea, .select, select, .emailaddresses {
|
input, textarea, .select, select, .emailaddresses {
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
border-color: #aaa;
|
border-color: #aaa;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.select, select {
|
.select, select {
|
||||||
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' height='10px' width='15px'><text x='0' y='10' fill='rgb(255,255,255)'>▾</text></svg>");
|
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' height='10px' width='15px'><text x='0' y='10' fill='rgb(255,255,255)'>▾</text></svg>");
|
||||||
}
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
|
|
@ -164,5 +164,5 @@ hr {
|
||||||
|
|
||||||
#messageItem .b-text-part blockquote,
|
#messageItem .b-text-part blockquote,
|
||||||
.b-settings-general .editMainIdentity {
|
.b-settings-general .editMainIdentity {
|
||||||
border-color: #999;
|
border-color: #999;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue