From 11910e6538f911e6849c66235d8142ff25086951 Mon Sep 17 00:00:00 2001 From: Andreas Skomski Date: Sun, 2 Mar 2025 10:34:52 +0100 Subject: [PATCH 1/3] feature: make Remotebuzzer available on chroma capture Change-Id: I1d7b8617af44e18db0da61fee13d5360dbabfd15 --- assets/js/remotebuzzer-client.js | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/assets/js/remotebuzzer-client.js b/assets/js/remotebuzzer-client.js index 126dd85ef..700368120 100644 --- a/assets/js/remotebuzzer-client.js +++ b/assets/js/remotebuzzer-client.js @@ -218,39 +218,44 @@ function initRemoteBuzzerFromDOM() { // vars const api = {}; api.waitingToProcessCollage = false; + api.needsReload = false; + api.chromaCapture = typeof onCaptureChromaView !== 'undefined'; api.init = function () { // nothing to init }; api.enabled = function () { - return ( - config.remotebuzzer.usebuttons && - typeof onStandaloneGalleryView === 'undefined' && - typeof onCaptureChromaView === 'undefined' - ); + return config.remotebuzzer.usebuttons && typeof onStandaloneGalleryView === 'undefined'; }; api.takePicture = function () { if (this.enabled() && config.picture.enabled) { - photoBooth.thrill('photo'); + if (api.chromaCapture) { + if (!api.needsReload) { + api.needsReload = true; + photoBooth.thrill('chroma'); + } + } else { + photoBooth.thrill('photo'); + } } }; api.takeCustom = function () { - if (this.enabled() && config.custom.enabled) { + if (this.enabled() && !api.chromaCapture && config.custom.enabled) { photoBooth.thrill('custom'); } }; api.takeVideo = function () { - if (this.enabled() && config.video.enabled) { + if (this.enabled() && !api.chromaCapture && config.video.enabled) { photoBooth.thrill('video'); } }; api.takeCollage = function () { - if (this.enabled() && config.collage.enabled) { + if (this.enabled() && !api.chromaCapture && config.collage.enabled) { this.waitingToProcessCollage = false; photoBooth.thrill('collage'); } @@ -267,8 +272,13 @@ function initRemoteBuzzerFromDOM() { api.print = function () { if ($('.stage[data-stage="result"]').is(':visible')) { - $('.printbtn').trigger('click'); - $('.printbtn').trigger('blur'); + if (api.chromaCapture) { + $('[data-command="print-btn"]').trigger('click'); + $('[data-command="print-btn"]').trigger('blur'); + } else { + $('[data-command="printbtn"]').trigger('click'); + $('[data-command="printbtn"]').trigger('blur'); + } } else if ($('.pswp__button--print').is(':visible')) { $('.pswp__button--print').trigger('click'); } else { @@ -277,7 +287,7 @@ function initRemoteBuzzerFromDOM() { }; api.move2usb = function () { - if (this.enabled()) { + if (this.enabled() && !api.chromaCapture) { photoBooth.thrill('move2usb'); } }; From 1cfaca9e0b15b9023ed1b2a8ee700212331ba74d Mon Sep 17 00:00:00 2001 From: Andreas Skomski Date: Fri, 21 Mar 2025 17:00:17 +0100 Subject: [PATCH 2/3] Update remotebuzzer-client.js --- assets/js/remotebuzzer-client.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/js/remotebuzzer-client.js b/assets/js/remotebuzzer-client.js index 700368120..bddd19edb 100644 --- a/assets/js/remotebuzzer-client.js +++ b/assets/js/remotebuzzer-client.js @@ -231,9 +231,9 @@ function initRemoteBuzzerFromDOM() { api.takePicture = function () { if (this.enabled() && config.picture.enabled) { - if (api.chromaCapture) { - if (!api.needsReload) { - api.needsReload = true; + if (this.chromaCapture) { + if (!this.needsReload) { + this.needsReload = true; photoBooth.thrill('chroma'); } } else { @@ -243,19 +243,19 @@ function initRemoteBuzzerFromDOM() { }; api.takeCustom = function () { - if (this.enabled() && !api.chromaCapture && config.custom.enabled) { + if (this.enabled() && !this.chromaCapture && config.custom.enabled) { photoBooth.thrill('custom'); } }; api.takeVideo = function () { - if (this.enabled() && !api.chromaCapture && config.video.enabled) { + if (this.enabled() && !this.chromaCapture && config.video.enabled) { photoBooth.thrill('video'); } }; api.takeCollage = function () { - if (this.enabled() && !api.chromaCapture && config.collage.enabled) { + if (this.enabled() && !thie.chromaCapture && config.collage.enabled) { this.waitingToProcessCollage = false; photoBooth.thrill('collage'); } @@ -272,7 +272,7 @@ function initRemoteBuzzerFromDOM() { api.print = function () { if ($('.stage[data-stage="result"]').is(':visible')) { - if (api.chromaCapture) { + if (this.chromaCapture) { $('[data-command="print-btn"]').trigger('click'); $('[data-command="print-btn"]').trigger('blur'); } else { @@ -287,7 +287,7 @@ function initRemoteBuzzerFromDOM() { }; api.move2usb = function () { - if (this.enabled() && !api.chromaCapture) { + if (this.enabled() && !this.chromaCapture) { photoBooth.thrill('move2usb'); } }; From 6b7b9a32f3fc7a270dea4206662fb697bbb2ff74 Mon Sep 17 00:00:00 2001 From: Andreas Skomski Date: Fri, 21 Mar 2025 17:02:09 +0100 Subject: [PATCH 3/3] Update remotebuzzer-client.js --- assets/js/remotebuzzer-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/remotebuzzer-client.js b/assets/js/remotebuzzer-client.js index bddd19edb..0866e35bd 100644 --- a/assets/js/remotebuzzer-client.js +++ b/assets/js/remotebuzzer-client.js @@ -255,7 +255,7 @@ function initRemoteBuzzerFromDOM() { }; api.takeCollage = function () { - if (this.enabled() && !thie.chromaCapture && config.collage.enabled) { + if (this.enabled() && !this.chromaCapture && config.collage.enabled) { this.waitingToProcessCollage = false; photoBooth.thrill('collage'); }