mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Details for #188
This commit is contained in:
parent
7236412e48
commit
5259da41f2
|
@ -43,18 +43,21 @@ export const
|
|||
},
|
||||
url = cssLink(value);
|
||||
|
||||
clearTimeout(__themeTimer);
|
||||
if (themeStyle.dataset.name != value) {
|
||||
clearTimeout(__themeTimer);
|
||||
|
||||
themeTrigger(SaveSettingStatus.Saving);
|
||||
themeTrigger(SaveSettingStatus.Saving);
|
||||
|
||||
rl.app.Remote.abort('theme').get('theme', url)
|
||||
.then(data => {
|
||||
if (2 === arrayLength(data)) {
|
||||
themeStyle.textContent = data[1];
|
||||
themeTrigger(SaveSettingStatus.Success);
|
||||
}
|
||||
clearTimer();
|
||||
}, clearTimer);
|
||||
rl.app.Remote.abort('theme').get('theme', url)
|
||||
.then(data => {
|
||||
if (2 === arrayLength(data)) {
|
||||
themeStyle.textContent = data[1];
|
||||
themeStyle.dataset.name = value;
|
||||
themeTrigger(SaveSettingStatus.Success);
|
||||
}
|
||||
clearTimer();
|
||||
}, clearTimer);
|
||||
}
|
||||
},
|
||||
|
||||
convertThemeName = theme => theme.replace(/@[a-z]+$/, '').replace(/([A-Z])/g, ' $1').trim();
|
||||
|
|
|
@ -184,13 +184,11 @@ abstract class Service
|
|||
if ($sResult) {
|
||||
$sResult .= '<!--cached-->';
|
||||
} else {
|
||||
$sThemeName = $oActions->GetTheme($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');
|
||||
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace(
|
||||
'/\\s*([:;{},]+)\\s*/s',
|
||||
'$1',
|
||||
$oActions->compileCss($oActions->GetTheme($bAdmin), $bAdmin)
|
||||
);
|
||||
$aTemplateParameters['{{BaseAppThemeName}}'] = $sThemeName;
|
||||
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace('/\\s*([:;{},]+)\\s*/s', '$1', $oActions->compileCss($sThemeName, $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'));
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}">
|
||||
<link rel="manifest" href="{{BaseAppManifestLink}}">
|
||||
<link rel="icon" href="{{BaseFavIconSvg}}" type="image/svg+xml">
|
||||
<style id="app-theme-style">{{BaseAppThemeCss}}</style>
|
||||
<style id="app-theme-style" data-name="{{BaseAppThemeName}}">{{BaseAppThemeCss}}</style>
|
||||
{{BaseAppFaviconPngLinkTag}}
|
||||
{{BaseAppFaviconTouchLinkTag}}
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue