From 0b421d5a625922e577fb18245e8fed206030a707 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Thu, 26 Jan 2023 21:42:14 +0100 Subject: [PATCH] Nextcloud /themes/*/snappymail/(style.css|preview.png) for #875 --- dev/Common/Links.js | 2 +- dev/Stores/Theme.js | 7 +------ .../v/0.0.0/app/libraries/RainLoop/Actions/Themes.php | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dev/Common/Links.js b/dev/Common/Links.js index bef08a1b9..d5ec584ca 100644 --- a/dev/Common/Links.js +++ b/dev/Common/Links.js @@ -81,7 +81,7 @@ export const themePreviewLink = theme => { if (theme.endsWith('@nextcloud')) { theme = theme.slice(0, theme.length - 10).trim(); - return OC().webroot + '/themes/' + encodeURI(theme) + '/snappymail.png'; + return OC().webroot + '/themes/' + encodeURI(theme) + '/snappymail/preview.png'; } let path = 'webVersionPath'; if (theme.endsWith('@custom')) { diff --git a/dev/Stores/Theme.js b/dev/Stores/Theme.js index 1713c10f9..e725eedcf 100644 --- a/dev/Stores/Theme.js +++ b/dev/Stores/Theme.js @@ -57,12 +57,7 @@ export const }, clearTimer); }, - convertThemeName = theme => theme - .replace(/@custom$/, '') - .replace(/@nextcloud$/, '') - .replace(/([A-Z])/g, ' $1') - .replace(/[^a-zA-Z0-9]+/g, ' ') - .trim(); + convertThemeName = theme => theme.replace(/@[a-z]+$/, '').replace(/([A-Z])/g, ' $1').trim(); ThemeStore.isMobile.subscribe(value => $htmlCL.toggle('rl-mobile', value)); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php index 134e4e159..b43bb21cd 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php @@ -103,7 +103,7 @@ trait Themes if ('@nextcloud' === \substr($sTheme, -10)) { $sBase = \OC::$WEBROOT . '/'; - $sThemeCSSFile = \OC::$SERVERROOT . '/themes/' . \str_replace('@nextcloud', '/snappymail.css', $sTheme); + $sThemeCSSFile = \OC::$SERVERROOT . '/themes/' . \str_replace('@nextcloud', '/snappymail/style.css', $sTheme); } else { $bCustomTheme = '@custom' === \substr($sTheme, -7); if ($bCustomTheme) {