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

Commit

Permalink
feature (cheese): allow to take pictures right after the countdown
Browse files Browse the repository at this point in the history
Change-Id: Id6a8c2ae33025e7344bf8de0196d9628d8ff3494
  • Loading branch information
andi34 committed Nov 8, 2020
1 parent 54e71d9 commit 73331ec
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
$config['force_buzzer'] = false;
// control countdown timer in seconds
$config['cntdwn_time'] = '5';
$config['no_cheese'] = false;
// control time for cheeeeese! in milliseconds
$config['cheese_time'] = '1000';
// control time in milliseconds until Photobooth reloads automatically
Expand Down
5 changes: 5 additions & 0 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
'range_step' => 1,
'unit' => 'seconds'
],
'no_cheese' => [
'type' => 'checkbox',
'name' => 'no_cheese',
'value' => $config['no_cheese']
],
'cheese_time' => [
'type' => 'range',
'placeholder' => $defaultConfig['cheese_time'],
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"manual_mail_text": "Enter the mail text which is used while sending pictures via email.",
"manual_mail_username": "Enter the username used to login into your email account.",
"manual_newest_first": "If enabled, latest images will be shown first inside the gallery.",
"manual_no_cheese": "If enabled, pictures will be taken right after the countdown. This skips the \"Cheeeeeeeese!\" message.",
"manual_polaroid_effect": "If enabled, a polaroid effect is applied to your picture after it was taken.",
"manual_preserve_exif_data": "If enabled, EXIF data is preserved while taking pictures. Please setup \"Preserve EXIF data\" inside the \"Commands\" tab.",
"manual_previewCamBackground": "If enabled, a stream from your device cam is used as background on start screen.",
Expand Down Expand Up @@ -284,6 +285,7 @@
"newPhoto": "New Picture",
"newest_first": "Show latest images first",
"nextPhoto": "Next Picture",
"no_cheese": "Take picture right after the countdown",
"path": "Path:",
"percent": "%",
"polaroid_effect": "Polaroid effect",
Expand Down
28 changes: 18 additions & 10 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,19 @@ const photoBooth = (function () {
$('#counter').empty();
$('.cheese').empty();

if (photoStyle === 'photo') {
const cheesemsg = i18n('cheese');
$('.cheese').text(cheesemsg);
if (config.no_cheese) {
console.log('Cheese is disabled.');
} else {
const cheesemsg = i18n('cheeseCollage');
$('.cheese').text(cheesemsg);
$('<p>')
.text(`${nextCollageNumber + 1} / ${config.collage_limit}`)
.appendTo('.cheese');
if (photoStyle === 'photo') {
const cheesemsg = i18n('cheese');
$('.cheese').text(cheesemsg);
} else {
const cheesemsg = i18n('cheeseCollage');
$('.cheese').text(cheesemsg);
$('<p>')
.text(`${nextCollageNumber + 1} / ${config.collage_limit}`)
.appendTo('.cheese');
}
}

if (config.previewFromCam && config.previewCamTakesPic && !api.stream && !config.dev) {
Expand All @@ -273,9 +277,13 @@ const photoBooth = (function () {
error: 'No preview by device cam available!'
});
} else {
setTimeout(() => {
if (config.no_cheese) {
api.takePic(photoStyle);
}, config.cheese_time);
} else {
setTimeout(() => {
api.takePic(photoStyle);
}, config.cheese_time);
}
}
};

Expand Down

0 comments on commit 73331ec

Please sign in to comment.