From d850ee88e9622b87943de1fa0e73a63b7f863357 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sun, 26 Jan 2020 09:20:32 +0100 Subject: [PATCH 1/5] Only use device cam to take pictures if it is used for preview Change-Id: I81cf6938932d1cb57bb998417e482ca9150bf38f --- api/admin.php | 4 ++++ api/takePic.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/admin.php b/api/admin.php index 3b690ec15..eb4a4e040 100644 --- a/api/admin.php +++ b/api/admin.php @@ -94,6 +94,10 @@ $newConfig['login_password'] = NULL; } + if (!$newConfig['previewFromCam']) { + $newConfig['previewCamTakesPic'] = false; + } + $content = " Date: Sun, 26 Jan 2020 09:49:22 +0100 Subject: [PATCH 2/5] Hide video--view on error, else no access to reload button Change-Id: I0c4ad347a564500dfc7187ffa07795fd3b205be9 --- resources/js/core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/js/core.js b/resources/js/core.js index f7a399b58..a1cda59b7 100644 --- a/resources/js/core.js +++ b/resources/js/core.js @@ -247,6 +247,7 @@ const photoBooth = (function () { $('.spinner').hide(); $('.loading').empty(); $('.cheese').empty(); + $('#video--view').hide(); $('#video--sensor').hide(); loader.addClass('error'); $('.loading').append($('

').text(L10N.error)); From 7fa873faf51e635e319ba46b9461ac96db66fc16 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sun, 26 Jan 2020 09:55:42 +0100 Subject: [PATCH 3/5] Fix button font for collage and on error Change-Id: I3127522a7d2b0ad276629cbb278f233da4c6ca08 --- resources/sass/style.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/sass/style.scss b/resources/sass/style.scss index 8e3516c2f..c6418aef7 100644 --- a/resources/sass/style.scss +++ b/resources/sass/style.scss @@ -212,6 +212,10 @@ input[type="email"] { p { margin: 0 0 0.2em; } + + .btn { + font-size: 0.4em; + } } .error { From 26b85de1f431193e0dee01db658b00d3a29ed78c Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sun, 26 Jan 2020 12:34:16 +0100 Subject: [PATCH 4/5] Abort with error if device cam should take pic but no preview available Change-Id: Ib88cc31fdaeb83d65496b0a2722dbb48a4227391 --- resources/js/core.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/resources/js/core.js b/resources/js/core.js index a1cda59b7..57e533b8d 100644 --- a/resources/js/core.js +++ b/resources/js/core.js @@ -164,9 +164,18 @@ const photoBooth = (function () { $('

').text(`${nextCollageNumber + 1} / ${config.collage_limit}`).appendTo('.cheese'); } - setTimeout(() => { - public.takePic(photoStyle); - }, config.cheese_time); + if (config.previewFromCam && config.previewCamTakesPic && !public.stream && !config.dev) { + console.log('No preview by device cam available!'); + + public.errorPic({ + error: 'No preview by device cam available!' + }); + + } else { + setTimeout(() => { + public.takePic(photoStyle); + }, config.cheese_time); + } } // take Picture From db237784c8625c9e67904205c5209aefc2b3d774 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sun, 26 Jan 2020 13:01:53 +0100 Subject: [PATCH 5/5] device cam: hide elements on init and reset Change-Id: Ie8ca299f8b5542ecdd98e4086d40719b1c334196 --- index.php | 2 -- resources/js/core.js | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 502d51634..3b906d78e 100644 --- a/index.php +++ b/index.php @@ -126,9 +126,7 @@ - -

diff --git a/resources/js/core.js b/resources/js/core.js index 57e533b8d..6080ade76 100644 --- a/resources/js/core.js +++ b/resources/js/core.js @@ -71,6 +71,8 @@ const photoBooth = (function () { gallery.find('.gallery__inner').hide(); $('.spinner').hide(); $('.send-mail').hide(); + $('#video--view').hide(); + $('#video--sensor').hide(); public.resetMailForm(); }