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 e79cdc3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
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
6 changes: 5 additions & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ const photoBooth = (function () {
$('#counter').empty();
$('.cheese').empty();

if (photoStyle === 'photo') {
if (config.no_cheese) {
console.log('Cheese is disabled.');
} else if (photoStyle === 'photo') {
const cheesemsg = i18n('cheese');
$('.cheese').text(cheesemsg);
} else {
Expand All @@ -272,6 +274,8 @@ const photoBooth = (function () {
api.errorPic({
error: 'No preview by device cam available!'
});
} else if (config.no_cheese) {
api.takePic(photoStyle);
} else {
setTimeout(() => {
api.takePic(photoStyle);
Expand Down

0 comments on commit e79cdc3

Please sign in to comment.