mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +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.onerror = () => reject(new Error('Failed loading ' + src));
|
||||
script.src = src;
|
||||
// script.async = true;
|
||||
doc.head.append(script);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -198,22 +198,17 @@ abstract class Service
|
|||
if ($sResult) {
|
||||
$sResult .= '<!--cached-->';
|
||||
} 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['{{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);
|
||||
|
||||
if ($sAppJsMin || $sAppCssMin) {
|
||||
$sResult = \preg_replace(
|
||||
['@\\s*/>@', '/\\s* /i', '/ \\s*/i', '/>\\s+</'],
|
||||
['>', "\xC2\xA0", "\xC2\xA0", '><'],
|
||||
\trim($sResult)
|
||||
);
|
||||
} else {
|
||||
$sResult = Utils::ClearHtmlOutput($sResult);
|
||||
}
|
||||
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace(
|
||||
'/\\s*([:;{},]+)\\s*/s',
|
||||
'$1',
|
||||
$oActions->compileCss($oActions->GetTheme($bAdmin), $bAdmin)
|
||||
);
|
||||
$aTemplateParameters['{{BaseLanguage}}'] = $oActions->compileLanguage($sLanguage, $bAdmin);
|
||||
$aTemplateParameters['{{BaseTemplates}}'] = Utils::ClearHtmlOutput($oServiceActions->compileTemplates($bAdmin));
|
||||
$sResult = Utils::ClearHtmlOutput(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'));
|
||||
$sResult = \strtr($sResult, $aTemplateParameters);
|
||||
if ($sCacheFileName) {
|
||||
$oActions->Cacher()->Set($sCacheFileName, $sResult);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -864,7 +864,7 @@ class ServiceActions
|
|||
foreach ($aTemplates as $sName => $sFile) {
|
||||
$sName = \preg_replace('/[^a-zA-Z0-9]/', '', $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>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,11 +82,11 @@ class Utils
|
|||
public static function ClearHtmlOutput(string $sHtml) : string
|
||||
{
|
||||
// return $sHtml;
|
||||
return \preg_replace(
|
||||
['@\\s*/>@', '/\\s* /i', '/ \\s*/i', '/[\\r\\n\\t]+/', '/>\\s+</'],
|
||||
['>', "\xC2\xA0", "\xC2\xA0", ' ', '><'],
|
||||
return \preg_replace('/>\\s+</', '><', \preg_replace(
|
||||
['@\\s*/>@', '/\\s* /i', '/ \\s*/i', '/[\\r\\n\\t]+/'],
|
||||
['>', "\xC2\xA0", "\xC2\xA0", ' '],
|
||||
\trim($sHtml)
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@
|
|||
}
|
||||
|
||||
.thm-message-list-top-toolbar, .thm-message-list-bottom-toolbar {
|
||||
background-image: linear-gradient(to bottom,#444,#111) !important;
|
||||
background-repeat: repeat-x !important;
|
||||
background-image: linear-gradient(to bottom,#444,#111) !important;
|
||||
background-repeat: repeat-x !important;
|
||||
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);
|
||||
}
|
||||
.btn .icon-spinner {
|
||||
border-color: #333;
|
||||
border-top-color: #ccc;
|
||||
border-color: #333;
|
||||
border-top-color: #ccc;
|
||||
}
|
||||
.btn .caret {
|
||||
border-top-color: var(--main-color);
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
|
||||
.messageListItem {
|
||||
border-left-color: #111;
|
||||
color: #EEE;
|
||||
color: #EEE;
|
||||
}
|
||||
|
||||
.table-hover tbody tr:hover td,
|
||||
|
|
@ -150,12 +150,12 @@
|
|||
}
|
||||
|
||||
input, textarea, .select, select, .emailaddresses {
|
||||
background-color: #000;
|
||||
border-color: #aaa;
|
||||
color: #fff;
|
||||
background-color: #000;
|
||||
border-color: #aaa;
|
||||
color: #fff;
|
||||
}
|
||||
.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 {
|
||||
|
|
@ -164,5 +164,5 @@ hr {
|
|||
|
||||
#messageItem .b-text-part blockquote,
|
||||
.b-settings-general .editMainIdentity {
|
||||
border-color: #999;
|
||||
border-color: #999;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue