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

Commit 862fcae

Browse files
committed
general: allow delete of images without request
Change-Id: Icff930a00b5b6e722554d033bc32698a07ff546c
1 parent ccd0923 commit 862fcae

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

config/config.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
// control time in milliseconds until Photobooth reloads automatically
2828
$config['picture']['time_to_live'] = '90000';
2929
$config['picture']['preview_before_processing'] = true;
30+
$config['delete']['no_request'] = false;
3031
$config['database']['enabled'] = true;
3132
$config['database']['file'] = 'db';
3233

lib/configsetup.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@
208208
'name' => 'picture[preview_before_processing]',
209209
'value' => $config['picture']['preview_before_processing'],
210210
],
211+
'delete_no_request' => [
212+
'view' => 'expert',
213+
'type' => 'checkbox',
214+
'name' => 'delete[no_request]',
215+
'value' => $config['delete']['no_request'],
216+
],
211217
'database_enabled' => [
212218
'view' => 'expert',
213219
'type' => 'checkbox',

resources/lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"general:database_enabled": "Use database for images",
115115
"general:database_file": "Database file name",
116116
"general:database_rebuild": "Rebuild image database",
117+
"general:delete_no_request": "Delete images without confirm request",
117118
"general:dev_enabled": "Dev-Mode",
118119
"general:dev_error_messages": "Show error messages",
119120
"general:dev_reload_on_error": "Automatically reload Photobooth on error",
@@ -247,6 +248,7 @@
247248
"manual:general:database_enabled": "If enabled, images will be added to a database which is used by the gallery. If disabled, gallery will read the images folder for images - this could reduce the performance.",
248249
"manual:general:database_file": "Name of the database file.",
249250
"manual:general:database_rebuild": "Rebuild the images database. Normally not required but can be used to fix a corrupted database file.",
251+
"manual:general:delete_no_request": "If enabled, images will be deleted without a confirm request. Delete of images can't be undone!",
250252
"manual:general:dev_enabled": "Enables development mode. Sample pictures will be used instead taking a picture.",
251253
"manual:general:dev_error_messages": "If enabled real error messages are shown on error.",
252254
"manual:general:dev_reload_on_error": "If an error occurs while taking a picture, Photobooth will reload automatically after 5 seconds.",

src/js/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ const photoBooth = (function () {
705705
ev.preventDefault();
706706

707707
const msg = api.getTranslation('really_delete_image');
708-
const really = confirm(filename + ' ' + msg);
708+
const really = config.delete.no_request ? true : confirm(filename + ' ' + msg);
709709
if (really) {
710710
api.deleteImage(filename, (data) => {
711711
if (data.success) {

src/js/livechroma.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function saveImage(cb) {
209209
ev.preventDefault();
210210

211211
const msg = photoBooth.getTranslation('really_delete_image');
212-
const really = confirm(data.filename + ' ' + msg);
212+
const really = config.delete.no_request ? true : confirm(data.filename + ' ' + msg);
213213
if (really) {
214214
photoBooth.deleteImage(data.filename, (result) => {
215215
if (result.success) {

src/js/photoinit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
206206
img = img.split('\\').pop().split('/').pop();
207207

208208
const msg = photoBooth.getTranslation('really_delete_image');
209-
const really = confirm(img + ' ' + msg);
209+
const really = config.delete.no_request ? true : confirm(img + ' ' + msg);
210210
if (really) {
211211
$.ajax({
212212
url: 'api/deletePhoto.php',

0 commit comments

Comments
 (0)