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

Commit

Permalink
feature (print): allow to show the print button independent
Browse files Browse the repository at this point in the history
Change-Id: I63cdcd71f95e0f4d3405c0e55b5b0c00a74c4827
  • Loading branch information
andi34 committed Sep 18, 2020
1 parent 66e5f50 commit 97dddc3
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 29 deletions.
2 changes: 1 addition & 1 deletion chromakeying.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<div class="chroma-control-bar">
<a class="btn btn--flex" id="save-btn" href="#"><i class="fa fa-floppy-o"></i> <span data-i18n="save"></span></a>

<?php if ($config['use_print']): ?>
<?php if ($config['use_print_chromakeying']): ?>
<a class="btn btn--flex" id="print-btn" href="#"><i class="fa fa-print"></i> <span data-i18n="print"></span></a>
<?php endif; ?>

Expand Down
23 changes: 13 additions & 10 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@
$config['show_error_messages'] = true;
$config['auto_reload_on_error'] = true;
$config['pictureRotation'] = '0';
$config['use_print'] = false;
$config['auto_print'] = false;
$config['auto_print_delay'] = '1000';
$config['printing_time'] = '5000';
$config['use_qr'] = true;
$config['use_download'] = true;
$config['use_slideshow'] = true;
$config['print_qrcode'] = false;
$config['print_frame'] = false;
$config['print_frame_path'] = '../resources/img/frames/frame.png';
$config['crop_onprint'] = false;
$config['crop_width'] = '1000';
$config['crop_height'] = '500';
$config['use_mail'] = false; // mail data needs to be configured
$config['show_fork'] = true;
$config['previewFromCam'] = false; // experimental see https://github.com/andreknieriem/photobooth/pull/30
Expand Down Expand Up @@ -154,6 +144,19 @@
$config['slideshow_randomPicture'] = true;
$config['slideshow_use_thumbs'] = false;

// PRINT
$config['use_print_result'] = false;
$config['use_print_gallery'] = false;
$config['use_print_chromakeying'] = false;
$config['auto_print'] = false;
$config['auto_print_delay'] = '1000';
$config['printing_time'] = '5000';
$config['print_qrcode'] = false;
$config['print_frame'] = false;
$config['print_frame_path'] = '../resources/img/frames/frame.png';
$config['crop_onprint'] = false;
$config['crop_width'] = '1000';
$config['crop_height'] = '500';
// TEXT ON PRINT
$config['is_textonprint'] = false;
$config['textonprint']['line1'] = 'line 1';
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<a href="#" class="btn mailbtn"><i class="fa fa-envelope"></i> <span data-i18n="mail"></span></a>
<?php endif; ?>

<?php if ($config['use_print']): ?>
<?php if ($config['use_print_result']): ?>
<a href="#" class="btn printbtn"><i class="fa fa-print"></i> <span data-i18n="print"></span></a>
<?php endif; ?>

Expand Down
20 changes: 15 additions & 5 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@
'placeholder' => '0644',
'value' => $config['picture_permissions']
],
'use_print' => [
'type' => 'checkbox',
'name' => 'use_print',
'value' => $config['use_print']
],
'use_qr' => [
'type' => 'checkbox',
'name' => 'use_qr',
Expand Down Expand Up @@ -601,6 +596,21 @@
]
],
'print' => [
'use_print_result' => [
'type' => 'checkbox',
'name' => 'use_print_result',
'value' => $config['use_print_result']
],
'use_print_gallery' => [
'type' => 'checkbox',
'name' => 'use_print_gallery',
'value' => $config['use_print_gallery']
],
'use_print_chromakeying' => [
'type' => 'checkbox',
'name' => 'use_print_chromakeying',
'value' => $config['use_print_chromakeying']
],
'auto_print' => [
'type' => 'checkbox',
'name' => 'auto_print',
Expand Down
2 changes: 0 additions & 2 deletions resources/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
"manual_use_download": "Wenn diese Option aktiviert ist, ist für jedes Bild in der Galerie eine Download-Schaltfläche sichtbar.",
"manual_use_filter": "Wenn diese Option aktiviert ist, kann der Benutzer nach dem Aufnehmen eines Bildes einen Bildfilter auswählen.",
"manual_use_mail": "Wenn diese Option aktiviert ist, ist für jedes Bild in der Galerie eine E-Mail-Schaltfläche sichtbar. Abhängig von Ihren Einstellungen können Sie Bilder direkt per E-Mail senden oder die eingegebene E-Mail-Adresse in einer Datenbank sammeln.",
"manual_use_print": "Wenn diese Option aktiviert ist, wird eine Druckschaltfläche auf dem Ergebnisbildschirm, der Galerie und der Chromakeying-Seite angezeigt.",
"manual_use_qr": "Wenn diese Option aktiviert ist, wird eine QR-Schaltfläche auf dem Ergebnisbildschirm und in der Galerie angezeigt. Der Benutzer kann beim Scannen des QR-Codes ein Bild herunterladen. Wenn Sie über \"localhost\", \"127.0.0.1\" auf Photobooth zugreifen oder Photobooth in einem Unterordner installiert haben, definieren Sie bitte die IP-Adresse des Photobooth-Webservers, damit der QR-Code funktioniert. <p>Beispiel, wenn auf Photobooth direkt zugegriffen werden kann: <code>192.168.0.50</code>.</p> <p>Beispiel, wenn Photobooth in einem Unterordner installiert ist: <code>192.168.0.50/photobooth</code>.</p>",
"manual_use_slideshow": "Wenn diese Option aktiviert ist, wird in der Galerie eine Diashow-Schaltfläche angezeigt, mit der Sie eine Diashow starten / stoppen können.",
"manual_use_thumbs": "Wenn diese Option aktiviert ist, werden Miniaturansichten für die Diashow verwendet. Dadurch wird die Leistung leicht verbessert.",
Expand Down Expand Up @@ -349,7 +348,6 @@
"use_download": "Download aktivieren",
"use_filter": "Bildfilter erlauben",
"use_mail": "E-Mail aktivieren",
"use_print": "Drucken aktivieren",
"use_qr": "QR-Code aktivieren",
"use_slideshow": "Diashow in Galerie erlauben",
"use_thumbs": "Thumbnails für die Diashow verwenden",
Expand Down
1 change: 0 additions & 1 deletion resources/lang/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"use_download": "Επιτρέψτε τη λήψη",
"use_filter": "Αφήστε φίλτρα εικόνας",
"use_mail": "E-Mail Ενεργοποίηση",
"use_print": "Ενεργοποίηση εκτύπωσης",
"use_qr": "Ενεργοποιήστε τον κωδικό QR",
"user_interface": "διεπαφή χρήστη",
"user_interface_background_admin": "Διαδρομή εικόνας φόντου διαχειριστή",
Expand Down
8 changes: 6 additions & 2 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@
"manual_use_download": "If enabled, a download button is visible on each picture inside the gallery.",
"manual_use_filter": "If enabled, user can choose a imagefiler after taking a picture.",
"manual_use_mail": "If enabled, a email button is visible on each picture inside the gallery. Depending on your setup you can send pictures via email directly or collect entered email address inside a database.",
"manual_use_print": "If enabled, a print button is visible on result screen, gallery and chromakeying page.",
"manual_use_print_chromakeying": "If enabled, a print button is visible on chromakeying page.",
"manual_use_print_gallery": "If enabled, a print button is visible inside the gallery.",
"manual_use_print_result": "If enabled, a print button is visible on result screen.",
"manual_use_qr": "If enabled, a QR-Button is visible on the result screen and inside gallery. User can download a picture while scanning the QR-Code. If you're accessing Photobooth via \"localhost\", \"127.0.0.1\" or if you have Photobooth installed inside a subfolder, please define IP address of the Photobooth web server to make the QR-Code working. <p>Example if Photobooth can be accessed directly: <code>192.168.0.50</code>.</p><p>Example if Photobooth is installed inside a subfolder: <code>192.168.0.50/photobooth</code>.</p>",
"manual_use_slideshow": "If enabled, a slideshow button is visible inside the gallery to start/stop a slideshow.",
"manual_use_thumbs": "If enabled, thumbnails are used for standalone gallery. This will improve the performance slightly.",
Expand Down Expand Up @@ -361,7 +363,9 @@
"use_download": "Allow downloads",
"use_filter": "Allow image filter",
"use_mail": "Use E-Mail",
"use_print": "Use Print",
"use_print_chromakeying": "Allow printing from chromakeying",
"use_print_gallery": "Allow printing from gallery",
"use_print_result": "Allow printing from result page",
"use_qr": "Use QR Codes",
"use_slideshow": "Allow slideshow in gallery",
"use_thumbs": "Use thumbnails for slideshow",
Expand Down
2 changes: 0 additions & 2 deletions resources/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@
"manual_use_download": "Si está activado, un botón de descarga es visible en cada imagen dentro de la galería.",
"manual_use_filter": "Si está habilitado, el usuario puede elegir un imagefiler después de tomar una foto.",
"manual_use_mail": "Si está habilitado, un botón de correo electrónico es visible en cada imagen dentro de la galería. Dependiendo de su configuración puede enviar imágenes por correo electrónico directamente o recopilar la dirección de correo electrónico introducida dentro de una base de datos.",
"manual_use_print": "Si está activado, un botón de impresión es visible en la pantalla de resultados, la galería y la página de cromakey.",
"manual_use_qr": "Si está activado, un botón QR es visible en la pantalla de resultados y dentro de la galería. El usuario puede descargar una imagen mientras escanea el código QR. Si está accediendo a Photobooth a través de \"localhost\", \"127.0.0.1\" o si tiene Photobooth instalado dentro de una subcarpeta, defina la dirección IP del servidor web Photobooth para que el código QR funcione. <p>Por ejemplo, si Photobooth se puede acceder directamente: <code>192.168.0.50</code>.</p><p>Por ejemplo, si Photobooth está instalado dentro de una subcarpeta: <code>192.168.0.50/photobooth</code>.</p>",
"manual_use_thumbs": "Si está habilitada, las miniaturas se utilizan para la galería independiente. Esto mejorará ligeramente el rendimiento.",
"manual_user_interface_background_admin": "Estilo CSS para fondo en el panel de administración.",
Expand Down Expand Up @@ -287,7 +286,6 @@
"use_download": "Permitir descargas",
"use_filter": "Autorice el tratamiento de imagen",
"use_mail": "Utilizar el correo electrónico",
"use_print": "Utilizar la impresion",
"use_qr": "Utilizar los códigos QR",
"use_thumbs": "Usar miniaturas para la presentación de diapositivas",
"user_interface": "Interfaz de usuario",
Expand Down
1 change: 0 additions & 1 deletion resources/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"use_download": "Autoriser les téléchargements",
"use_filter": "Autorisez le filtre d'image",
"use_mail": "Utiliser le courrier électronique",
"use_print": "Utiliser l'impression",
"use_qr": "Utiliser le QR code",
"user_interface": "Interface utilisateur",
"user_interface_background_admin": "Chemin de l'image d'arrière-plan du panneau d'administration",
Expand Down
2 changes: 1 addition & 1 deletion src/js/chromakeying.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function closeHandler(ev) {
}

$(document).on('keyup', function (ev) {
if (config.use_print && config.print_key && parseInt(config.print_key, 10) === ev.keyCode) {
if (config.use_print_chromakeying && config.print_key && parseInt(config.print_key, 10) === ev.keyCode) {
if (isPrinting) {
console.log('Printing already in progress!');
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ const photoBooth = (function () {
}
}

if (config.use_print && config.print_key && parseInt(config.print_key, 10) === ev.keyCode) {
if (config.use_print_result && config.print_key && parseInt(config.print_key, 10) === ev.keyCode) {
if (isPrinting) {
console.log('Printing already in progress!');
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/js/photoinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
$(gallerySelector).on('click', onThumbnailClick);

$(document).on('keyup', function (ev) {
if (config.use_print && config.print_key && parseInt(config.print_key, 10) === ev.keyCode) {
if (config.use_print_gallery && config.print_key && parseInt(config.print_key, 10) === ev.keyCode) {
if (isPrinting) {
console.log('Printing already in progress!');
} else {
Expand Down
2 changes: 1 addition & 1 deletion template/pswp.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<button type="button" class="pswp__button pswp__button--mail" title="Send Email"><i class="fa fa-envelope"></i></button>
<?php endif; ?>

<?php if ($config['use_print']): ?>
<?php if ($config['use_print_gallery']): ?>
<button type="button" class="pswp__button pswp__button--print" title="Print"><i class="fa fa-print"></i></button>
<?php endif; ?>

Expand Down

0 comments on commit 97dddc3

Please sign in to comment.