Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit 73331ec

Browse files
committed
feature (cheese): allow to take pictures right after the countdown
Change-Id: Id6a8c2ae33025e7344bf8de0196d9628d8ff3494
1 parent 54e71d9 commit 73331ec

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

config/config.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
$config['force_buzzer'] = false;
3939
// control countdown timer in seconds
4040
$config['cntdwn_time'] = '5';
41+
$config['no_cheese'] = false;
4142
// control time for cheeeeese! in milliseconds
4243
$config['cheese_time'] = '1000';
4344
// control time in milliseconds until Photobooth reloads automatically

lib/configsetup.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@
160160
'range_step' => 1,
161161
'unit' => 'seconds'
162162
],
163+
'no_cheese' => [
164+
'type' => 'checkbox',
165+
'name' => 'no_cheese',
166+
'value' => $config['no_cheese']
167+
],
163168
'cheese_time' => [
164169
'type' => 'range',
165170
'placeholder' => $defaultConfig['cheese_time'],

resources/lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
"manual_mail_text": "Enter the mail text which is used while sending pictures via email.",
204204
"manual_mail_username": "Enter the username used to login into your email account.",
205205
"manual_newest_first": "If enabled, latest images will be shown first inside the gallery.",
206+
"manual_no_cheese": "If enabled, pictures will be taken right after the countdown. This skips the \"Cheeeeeeeese!\" message.",
206207
"manual_polaroid_effect": "If enabled, a polaroid effect is applied to your picture after it was taken.",
207208
"manual_preserve_exif_data": "If enabled, EXIF data is preserved while taking pictures. Please setup \"Preserve EXIF data\" inside the \"Commands\" tab.",
208209
"manual_previewCamBackground": "If enabled, a stream from your device cam is used as background on start screen.",
@@ -284,6 +285,7 @@
284285
"newPhoto": "New Picture",
285286
"newest_first": "Show latest images first",
286287
"nextPhoto": "Next Picture",
288+
"no_cheese": "Take picture right after the countdown",
287289
"path": "Path:",
288290
"percent": "%",
289291
"polaroid_effect": "Polaroid effect",

src/js/core.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,19 @@ const photoBooth = (function () {
250250
$('#counter').empty();
251251
$('.cheese').empty();
252252

253-
if (photoStyle === 'photo') {
254-
const cheesemsg = i18n('cheese');
255-
$('.cheese').text(cheesemsg);
253+
if (config.no_cheese) {
254+
console.log('Cheese is disabled.');
256255
} else {
257-
const cheesemsg = i18n('cheeseCollage');
258-
$('.cheese').text(cheesemsg);
259-
$('<p>')
260-
.text(`${nextCollageNumber + 1} / ${config.collage_limit}`)
261-
.appendTo('.cheese');
256+
if (photoStyle === 'photo') {
257+
const cheesemsg = i18n('cheese');
258+
$('.cheese').text(cheesemsg);
259+
} else {
260+
const cheesemsg = i18n('cheeseCollage');
261+
$('.cheese').text(cheesemsg);
262+
$('<p>')
263+
.text(`${nextCollageNumber + 1} / ${config.collage_limit}`)
264+
.appendTo('.cheese');
265+
}
262266
}
263267

264268
if (config.previewFromCam && config.previewCamTakesPic && !api.stream && !config.dev) {
@@ -273,9 +277,13 @@ const photoBooth = (function () {
273277
error: 'No preview by device cam available!'
274278
});
275279
} else {
276-
setTimeout(() => {
280+
if (config.no_cheese) {
277281
api.takePic(photoStyle);
278-
}, config.cheese_time);
282+
} else {
283+
setTimeout(() => {
284+
api.takePic(photoStyle);
285+
}, config.cheese_time);
286+
}
279287
}
280288
};
281289

0 commit comments

Comments
 (0)