From f49b3db7f5de0899a676ea708e994ed5b39dbde8 Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Thu, 26 Oct 2023 01:26:34 +0200 Subject: [PATCH] task: drop unnessesary wrapper --- chroma/chromakeying.php | 39 ++-- chroma/index.php | 68 ++----- gallery/index.php | 7 +- gulpfile.mjs | 4 +- index.php | 31 +-- lib/services_start.php | 2 +- lib/services_stop.php | 2 +- lib/src/Utility/ThemeUtility.php | 2 +- resources/lang/cs.json | 1 - resources/lang/de.json | 1 - resources/lang/en.json | 1 - resources/lang/es.json | 1 - resources/lang/fr.json | 1 - resources/lang/it.json | 1 - resources/lang/nl.json | 1 - resources/lang/no.json | 1 - resources/lang/pt.json | 1 - slideshow/index.php | 15 +- src/js/chromakeying.js | 192 ++++++------------ src/js/core.js | 18 +- ..._updatecheck.js => gallery-updatecheck.js} | 0 src/js/preview.js | 30 +-- ...uzzer_client.js => remotebuzzer-client.js} | 0 ...uzzer_server.js => remotebuzzer-server.js} | 0 src/js/{test_chroma.js => test-chroma.js} | 0 src/js/{test_preview.js => test-preview.js} | 109 +++++----- src/sass/classic_chromacapture.scss | 127 ------------ src/sass/classic_chromakeying.scss | 39 ---- src/sass/classic_rounded_chromacapture.scss | 1 - src/sass/classic_rounded_chromakeying.scss | 1 - src/sass/classic_rounded_style.scss | 1 - src/sass/components/_base.scss | 4 + src/sass/components/_button.scss | 20 +- src/sass/components/_chroma.scss | 37 ++++ src/sass/components/_preview.scss | 74 +++++++ src/sass/components/_root.scss | 2 +- src/sass/components/_stage.scss | 13 +- src/sass/framework.scss | 2 + src/sass/{classic_style.scss => legacy.scss} | 31 +-- src/sass/modern_chromacapture.scss | 13 -- src/sass/modern_chromakeying.scss | 1 - src/sass/modern_squared_chromacapture.scss | 1 - src/sass/modern_squared_chromakeying.scss | 1 - src/sass/modern_squared_style.scss | 1 - src/sass/modern_style.scss | 5 - src/sass/partials/_video_animation.scss | 1 - src/sass/partials/_video_preview.scss | 74 ------- src/sass/themes/_classic.scss | 6 +- src/sass/themes/_modern.scss | 8 +- .../components/chroma.background.selector.php | 11 + template/components/chroma.canvas.php | 3 + template/components/main.footer.php | 2 +- template/components/main.head.php | 2 +- template/components/preview.php | 23 +++ template/components/stage.loader.php | 3 +- template/components/stage.results.php | 2 +- template/components/stage.start.php | 2 +- test/chroma.php | 45 ++-- test/preview.php | 24 +-- test/trigger.php | 3 - 60 files changed, 412 insertions(+), 699 deletions(-) rename src/js/{gallery_updatecheck.js => gallery-updatecheck.js} (100%) rename src/js/{remotebuzzer_client.js => remotebuzzer-client.js} (100%) rename src/js/{remotebuzzer_server.js => remotebuzzer-server.js} (100%) rename src/js/{test_chroma.js => test-chroma.js} (100%) rename src/js/{test_preview.js => test-preview.js} (51%) delete mode 100644 src/sass/classic_chromacapture.scss delete mode 100644 src/sass/classic_chromakeying.scss delete mode 100644 src/sass/classic_rounded_chromacapture.scss delete mode 100644 src/sass/classic_rounded_chromakeying.scss delete mode 100644 src/sass/classic_rounded_style.scss create mode 100644 src/sass/components/_chroma.scss create mode 100644 src/sass/components/_preview.scss rename src/sass/{classic_style.scss => legacy.scss} (56%) delete mode 100644 src/sass/modern_chromacapture.scss delete mode 100644 src/sass/modern_chromakeying.scss delete mode 100644 src/sass/modern_squared_chromacapture.scss delete mode 100644 src/sass/modern_squared_chromakeying.scss delete mode 100644 src/sass/modern_squared_style.scss delete mode 100644 src/sass/modern_style.scss delete mode 100644 src/sass/partials/_video_preview.scss create mode 100644 template/components/chroma.background.selector.php create mode 100644 template/components/chroma.canvas.php create mode 100644 template/components/preview.php diff --git a/chroma/chromakeying.php b/chroma/chromakeying.php index 4fe463fff..7b8bd762d 100644 --- a/chroma/chromakeying.php +++ b/chroma/chromakeying.php @@ -4,7 +4,6 @@ use Photobooth\Service\LanguageService; use Photobooth\Utility\ComponentUtility; -use Photobooth\Utility\ImageUtility; use Photobooth\Utility\PathUtility; if (empty($_GET['filename'])) { @@ -31,7 +30,6 @@ $languageService = LanguageService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Chromakeying'; -$mainStyle = $config['ui']['style'] . '_chromakeying.css'; $photoswipe = false; $remoteBuzzer = true; @@ -39,37 +37,24 @@ ?> -
-
- -
- -
- '; - } - ?> -
- -
- + +
+
+ +
+ + + +
+
-
-

translate('keyingerror')?>

+
+

translate('keyingerror')?>

-
diff --git a/chroma/index.php b/chroma/index.php index fec7127d1..31a77926d 100644 --- a/chroma/index.php +++ b/chroma/index.php @@ -5,7 +5,6 @@ use Photobooth\Service\AssetService; use Photobooth\Service\LanguageService; use Photobooth\Utility\ComponentUtility; -use Photobooth\Utility\ImageUtility; use Photobooth\Utility\PathUtility; // Login / Authentication check @@ -21,7 +20,6 @@ $languageService = LanguageService::getInstance(); $assetService = AssetService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Chroma capture'; -$mainStyle = $config['ui']['style'] . '_chromacapture.css'; $photoswipe = true; $randomImage = false; $remoteBuzzer = true; @@ -30,61 +28,33 @@ ?> - -
-
-
- -
-
- -
+ + -
- translate('chromaInfoBefore')?> -
- - - - -
- -
- '; -} -?> +
+
+
translate('chromaInfoBefore')?>
+ +
+
- -
- +
+
-
-
- +
+ +
+
+
+ +
+ + diff --git a/gallery/index.php b/gallery/index.php index eb8522dd3..e4a486c5f 100644 --- a/gallery/index.php +++ b/gallery/index.php @@ -7,7 +7,6 @@ $assetService = AssetService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Gallery'; -$mainStyle = $config['ui']['style'] . '_style.css'; $photoswipe = true; $randomImage = false; $remoteBuzzer = true; @@ -15,9 +14,7 @@ include PathUtility::getAbsolutePath('template/components/main.head.php'); ?> -
- -
+ - + diff --git a/gulpfile.mjs b/gulpfile.mjs index 7535198b3..987aa2491 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -28,7 +28,7 @@ gulp.task('js', function () { .src('./src/js/**/*.js') .pipe(babel({ presets: ['@babel/env'], - ignore: ['src/js/sync-to-drive.js', 'src/js/remotebuzzer_server.js'] + ignore: ['src/js/sync-to-drive.js', 'src/js/remotebuzzer-server.js'] })) .pipe(gulp.dest('./resources/js')); }); @@ -68,7 +68,7 @@ gulp.task('js-admin', function () { .pipe(concat('main.admin.js')) .pipe(babel({ presets: ['@babel/env'], - ignore: ['src/js/sync-to-drive.js', 'src/js/remotebuzzer_server.js'] + ignore: ['src/js/sync-to-drive.js', 'src/js/remotebuzzer-server.js'] })) .pipe(gulp.dest('./resources/js')); }); diff --git a/index.php b/index.php index eee0cec88..6bdcc586d 100644 --- a/index.php +++ b/index.php @@ -26,7 +26,6 @@ ((isset($_SESSION['auth']) && $_SESSION['auth'] === true) || !$config['protect']['index']) ) { $pageTitle = $config['ui']['branding']; - $mainStyle = $config['ui']['style'] . '_style.css'; $photoswipe = true; $randomImage = false; $remoteBuzzer = true; @@ -39,30 +38,8 @@ ?> + - - pictureFrame - - - collageFrame - -
    @@ -77,7 +54,6 @@ class="
-
-
+include PathUtility::getAbsolutePath('template/components/main.footer.php'); - +?> diff --git a/lib/services_start.php b/lib/services_start.php index aa3968a83..c44256821 100644 --- a/lib/services_start.php +++ b/lib/services_start.php @@ -28,7 +28,7 @@ function processIsRunning($pName, $pidFile) echo '' . "\n"; chdir(PathUtility::getRootPath()); - proc_close(proc_open($config['nodebin']['cmd'] . ' resources/js/remotebuzzer_server.js 1>' . $logfile . ' 2>&1 &', [], $foo)); + proc_close(proc_open($config['nodebin']['cmd'] . ' resources/js/remotebuzzer-server.js 1>' . $logfile . ' 2>&1 &', [], $foo)); } else { echo '' . "\n"; } diff --git a/lib/services_stop.php b/lib/services_stop.php index 2b76b547f..325406414 100644 --- a/lib/services_stop.php +++ b/lib/services_stop.php @@ -28,7 +28,7 @@ function killProcessIfActive($pName, $pidFile, $logfileName, $killSig) // can be killed if active independent of $config['remotebuzzer']['startserver'] killProcessIfActive( - 'remotebuzzer_server.js', + 'remotebuzzer-server.js', $config['foldersAbs']['tmp'] . DIRECTORY_SEPARATOR . 'remotebuzzer_server.pid', $config['remotebuzzer']['logfile'], 9 diff --git a/lib/src/Utility/ThemeUtility.php b/lib/src/Utility/ThemeUtility.php index 84420988c..9605dbd65 100644 --- a/lib/src/Utility/ThemeUtility.php +++ b/lib/src/Utility/ThemeUtility.php @@ -23,7 +23,7 @@ public static function renderCustomUserStyle(array $config): string '--gallery-button-color' => $config['colors']['gallery_button'] ?? '__UNSET__', '--background-default' => $config['background']['defaults'] ?? '__UNSET__', '--background-chroma' => $config['background']['chroma'] ?? '__UNSET__', - '--background-url' => $config['preview']['url'] ?? '__UNSET__', + '--background-preview' => $config['preview']['url'] ?? '__UNSET__', '--font-size' => $config['ui']['font_size'] ?? '__UNSET__', '--font-color' => $config['colors']['font'] ?? '__UNSET__', '--preview-rotation' => $config['preview']['rotation'] ?? '__UNSET__', diff --git a/resources/lang/cs.json b/resources/lang/cs.json index 954ee1e50..049c6ce52 100644 --- a/resources/lang/cs.json +++ b/resources/lang/cs.json @@ -18,7 +18,6 @@ "busyVideo": "Zpracování videa...", "check_version": "Zkontrolovat online", "cheese": "Sýýýýýýýýýýýýýýýrrrr!", - "chromaInfoAfter": "Pro pořízení nové fottografie prosím obnovte stránku", "close": "Zavřít", "collage:collage_background": "Pozadí", "collage:collage_background_color": "Barva pozadí koláže", diff --git a/resources/lang/de.json b/resources/lang/de.json index 95d09a255..7dff984ca 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -32,7 +32,6 @@ "cheese": "Cheeeeeeeese!", "choose_image": "Bild auswählen", "chromaCapture": "Chroma-Aufnahme", - "chromaInfoAfter": "Bitte laden Sie die Seite neu, um ein neues Foto aufzunehmen", "chromaInfoBefore": "Bitte wählen Sie einen Hintergrund, um ein neues Foto aufzunehmen", "chromaPreviewTest": "Chroma-Vorschau-Test", "chroma_needs_background": "Bitte wählen Sie zuerst einen Hintergrund!", diff --git a/resources/lang/en.json b/resources/lang/en.json index 363bec972..c3c16fe23 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -32,7 +32,6 @@ "cheese": "Cheeeeeeeese!", "choose_image": "Choose an image", "chromaCapture": "Chroma Capture", - "chromaInfoAfter": "Please reload the page to take a new Picture", "chromaInfoBefore": "Please choose a background to take a Picture", "chromaPreviewTest": "Chroma preview test", "chroma_needs_background": "Please choose a background first!", diff --git a/resources/lang/es.json b/resources/lang/es.json index 438453e10..e7ed968c0 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -32,7 +32,6 @@ "cheese": "¡Patataaaaaa!", "choose_image": "Elige una imagen", "chromaCapture": "Captura de croma", - "chromaInfoAfter": "Favor de cargar nuevamente la página para tomar una nueva fotografía", "chromaInfoBefore": "Por favor elige un fondo para tomar la fotografía", "chromaPreviewTest": "Prueba de vista previa de Chroma", "chroma_needs_background": "¡Por favor, elige un fondo primero!", diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 375e2489e..82191b0e2 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -30,7 +30,6 @@ "cheese": "Souriez !", "choose_image": "Choisissez une image", "chromaCapture": "Capture Chroma", - "chromaInfoAfter": "Veuillez actualiser la page pour prendre une nouvelle photo", "chromaInfoBefore": "Veuillez choisir un arrière-plan pour prendre une photo", "chromaPreviewTest": "Test d'aperçu Chroma", "chroma_needs_background": "Veuillez d'abord choisir un arrière-plan !", diff --git a/resources/lang/it.json b/resources/lang/it.json index 71a73a1aa..9e12d78da 100644 --- a/resources/lang/it.json +++ b/resources/lang/it.json @@ -32,7 +32,6 @@ "cheese": "Cheeeeeeeese!", "choose_image": "Scegli un'immagine", "chromaCapture": "Cattura Chroma", - "chromaInfoAfter": "Per favore ricarica la pagina per scattare una nuova foto", "chromaInfoBefore": "Per favore scegli uno sfondo per scattare un'immagine", "chromaPreviewTest": "Anteprima chroma test", "chroma_needs_background": "Per favore scegli prima uno sfondo!", diff --git a/resources/lang/nl.json b/resources/lang/nl.json index 4811a0566..bac25d2ed 100644 --- a/resources/lang/nl.json +++ b/resources/lang/nl.json @@ -32,7 +32,6 @@ "cheese": "Lachen!", "choose_image": "Kies een afbeelding", "chromaCapture": "Chroma-opname", - "chromaInfoAfter": "Vernieuw de pagina om een nieuwe foto te maken", "chromaInfoBefore": "Kies alstublieft een achtergrond om een foto te maken", "chromaPreviewTest": "Chroma voorbeeldtest", "chroma_needs_background": "Kies eerst een achtergrond!", diff --git a/resources/lang/no.json b/resources/lang/no.json index 0e56599cb..489d4d995 100644 --- a/resources/lang/no.json +++ b/resources/lang/no.json @@ -22,7 +22,6 @@ "busyCollage": "Behandler collage...", "check_version": "Sjekk online", "cheese": "Smiiiiiiiiiiil!", - "chromaInfoAfter": "Vennligst last inn siden på nytt for å ta et nytt bilde", "chromaInfoBefore": "Vennligst velg en bakgrunn for å ta et bilde", "close": "Lukk", "collage": "Collage", diff --git a/resources/lang/pt.json b/resources/lang/pt.json index 9e9900846..720ef6e44 100644 --- a/resources/lang/pt.json +++ b/resources/lang/pt.json @@ -32,7 +32,6 @@ "cheese": "Cheeeeeeeese!", "choose_image": "Escolha uma imagem", "chromaCapture": "Captura Chroma", - "chromaInfoAfter": "Por favor, recarregue a página para tirar uma nova Fotografia", "chromaInfoBefore": "Por favor, escolha um plano de fundo para tirar uma Foto", "chromaPreviewTest": "Teste de pré-visualização Chroma", "chroma_needs_background": "Por favor, escolha um plano de fundo primeiro!", diff --git a/slideshow/index.php b/slideshow/index.php index c174d5cab..3c9c8547b 100644 --- a/slideshow/index.php +++ b/slideshow/index.php @@ -9,7 +9,6 @@ $languageService = LanguageService::getInstance(); $assetService = AssetService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Slideshow'; -$mainStyle = $config['ui']['style'] . '_style.css'; $photoswipe = true; $randomImage = $config['slideshow']['randomPicture']; $remoteBuzzer = false; @@ -18,14 +17,12 @@ ?> -
- '; diff --git a/template/components/chroma.canvas.php b/template/components/chroma.canvas.php new file mode 100644 index 000000000..7a61a1117 --- /dev/null +++ b/template/components/chroma.canvas.php @@ -0,0 +1,3 @@ +
+ +
diff --git a/template/components/main.footer.php b/template/components/main.footer.php index 2ea58d719..85fcd4d4a 100644 --- a/template/components/main.footer.php +++ b/template/components/main.footer.php @@ -9,7 +9,7 @@ if ($remoteBuzzer) { echo ''; - echo ''; + echo ''; } if ($photoswipe) { diff --git a/template/components/main.head.php b/template/components/main.head.php index 31b65ca29..c8ed8755f 100644 --- a/template/components/main.head.php +++ b/template/components/main.head.php @@ -40,7 +40,7 @@ - + '; +echo ''; +echo '
'; +echo '
' . $languageService->translate('no_preview') . '
'; + +if ($previewShowPictureFrame) { + echo 'pictureFrame'; +} +if ($previewShowCollageFrame) { + echo 'collageFrame'; +} + +echo '
'; diff --git a/template/components/stage.loader.php b/template/components/stage.loader.php index 14c32eef4..7be40e069 100644 --- a/template/components/stage.loader.php +++ b/template/components/stage.loader.php @@ -1,7 +1,6 @@ -
+
-
diff --git a/template/components/stage.results.php b/template/components/stage.results.php index 1ba2a5fc0..28e41842a 100644 --- a/template/components/stage.results.php +++ b/template/components/stage.results.php @@ -2,7 +2,7 @@ use Photobooth\Utility\ComponentUtility; -echo '
'; +echo '
'; echo '
'; echo '
'; diff --git a/template/components/stage.start.php b/template/components/stage.start.php index 3a5fdf53e..592166f84 100644 --- a/template/components/stage.start.php +++ b/template/components/stage.start.php @@ -4,7 +4,7 @@ ?> -
+
diff --git a/test/chroma.php b/test/chroma.php index 4c03e18e0..aad9e5e7d 100644 --- a/test/chroma.php +++ b/test/chroma.php @@ -10,7 +10,6 @@ $languageService = LanguageService::getInstance(); $assetService = AssetService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Chroma-Preview Test'; -$mainStyle = $config['ui']['style'] . '_style.css'; $photoswipe = false; $remoteBuzzer = false; @@ -18,36 +17,30 @@ ?> - - -
-
-
- translate('no_preview')?> -
-
- - - - - - - ' - - - - - - - -
+ +
+ +
+
+ + + + + + ' + + + + + +
- - + + diff --git a/test/preview.php b/test/preview.php index be3840547..0816cf213 100644 --- a/test/preview.php +++ b/test/preview.php @@ -10,7 +10,6 @@ $languageService = LanguageService::getInstance(); $assetService = AssetService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Preview-Test'; -$mainStyle = $config['ui']['style'] . '_style.css'; $photoswipe = false; $remoteBuzzer = false; @@ -18,20 +17,11 @@ ?> - - pictureFrame - - - collageFrame - - - -
-
-
- translate('no_preview')?> -
-
+ +
+ +
+
-
- + diff --git a/test/trigger.php b/test/trigger.php index a96b75b34..7eb0d369e 100644 --- a/test/trigger.php +++ b/test/trigger.php @@ -8,14 +8,12 @@ $languageService = LanguageService::getInstance(); $pageTitle = $config['ui']['branding'] . ' Remote Trigger'; -$mainStyle = $config['ui']['style'] . '_style.css'; $photoswipe = false; $remoteBuzzer = false; include PathUtility::getAbsolutePath('template/components/main.head.php'); echo ''; -echo '
'; echo '
'; if ($config['remotebuzzer']['usebuttons']) { @@ -53,7 +51,6 @@ echo ComponentUtility::renderButtonLink('back', 'fa fa-chevron-left', PathUtility::getPublicPath('test')); -echo '
'; echo '
'; include PathUtility::getAbsolutePath('template/components/main.footer.php');