Details for #188

This commit is contained in:
the-djmaze 2023-02-01 11:09:18 +01:00
parent 7236412e48
commit 5259da41f2
3 changed files with 17 additions and 16 deletions

View file

@ -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();

View file

@ -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'));

View file

@ -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>