diff --git a/config/config.inc.php b/config/config.inc.php index f405dacae..296d51edb 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -259,6 +259,13 @@ $config['synctodrive']['interval'] = 300; +// G E T R E Q U E S T +$config['get_request']['enabled'] = false; +$config['get_request']['server'] = NULL; +$config['get_request']['picture'] = 'CNTDWNPHOTO'; +$config['get_request']['collage'] = 'CNTDWNCOLLAGE'; + + // A U T H E N T I C A T I O N $config['login']['enabled'] = false; $config['login']['username'] = 'Photo'; diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php index 8d7bef1dc..e5891d748 100644 --- a/lib/configsetup.inc.php +++ b/lib/configsetup.inc.php @@ -1531,6 +1531,37 @@ 'value' => $config['synctodrive']['logfile'], ], ], + 'get_request' => [ + 'platform' => 'linux', + 'view' => 'advanced', + 'get_request_enabled' => [ + 'view' => 'basic', + 'type' => 'checkbox', + 'name' => 'get_request[enabled]', + 'value' => $config['get_request']['enabled'], + ], + 'get_request_server' => [ + 'view' => 'advanced', + 'type' => 'input', + 'placeholder' => 'http://xxx.xxx.xxx.xxx', + 'name' => 'get_request[server]', + 'value' => htmlentities($config['get_request']['server']), + ], + 'get_request_picture' => [ + 'view' => 'advanced', + 'type' => 'input', + 'placeholder' => $defaultConfig['get_request']['picture'], + 'name' => 'get_request[picture]', + 'value' => htmlentities($config['get_request']['picture']), + ], + 'get_request_collage' => [ + 'view' => 'advanced', + 'type' => 'input', + 'placeholder' => $defaultConfig['get_request']['collage'], + 'name' => 'get_request[collage]', + 'value' => htmlentities($config['get_request']['collage']), + ], + ], 'authentication' => [ 'view' => 'basic', 'login_enabled' => [ diff --git a/resources/lang/en.json b/resources/lang/en.json index 1daba1aff..12db804c8 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -149,6 +149,11 @@ "general:ui_language": "Choose Language", "general:webserver_ip": "IP address of the Photobooth web server", "general:webserver_ssid": "Wireless network name (SSID) used to access the photobooth", + "get_request": "GET request", + "get_request:get_request_collage": "GET request for collage", + "get_request:get_request_enabled": "Send GET request to server at countdown and after processing", + "get_request:get_request_picture": "GET request for picture", + "get_request:get_request_server": "GET request server", "githead": "Latest changes", "home": "Home", "insertMail": "Enter your e-mail address to receive the photo.", @@ -296,6 +301,10 @@ "manual:general:ui_language": "Choose interface language.

If you're missing a language or like to help improving translations visit the \"How to update or add translations?\" inside the Photobooth Wiki for instructions.

", "manual:general:webserver_ip": "Please define the IP address of the Photobooth web server to make the QR-Code working if you're accessing Photobooth via \"localhost\", \"127.0.0.1\" or if you have Photobooth installed inside a subfolder.

Example if Photobooth can be accessed directly: 192.168.0.50.

Example if Photobooth is installed inside a subfolder: 192.168.0.50/photobooth.

", "manual:general:webserver_ssid": "Please define the wireless network name (SSID) to be used to access the Photobooth. The wireless network name (SSID) is displayed on the results page when the QR code is called up.", + "manual:get_request:get_request_collage": "Define GET request at countdown while taking a collage.", + "manual:get_request:get_request_enabled": "If enabled, a GET request will be made to defined Server.", + "manual:get_request:get_request_picture": "Define GET request at countdown while taking a picture.", + "manual:get_request:get_request_server": "Define the server for a GET request.", "manual:jpeg_quality:jpeg_quality_chroma": "Picture quality used for chromakeying pictures.", "manual:jpeg_quality:jpeg_quality_image": "Picture quality used for taking pictures. Value of -1 means the original file from the camera will be retained, if there is no other mods i.e. filters active.", "manual:jpeg_quality:jpeg_quality_thumb": "Picture quality used for thumbnails.", diff --git a/src/js/core.js b/src/js/core.js index 0c24e8562..54aa77549 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -658,6 +658,14 @@ const photoBooth = (function () { success: (data) => { console.log('picture processed', data); + if (config.get_request.enabled) { + const getUrl = config.get_request.server + '/' + photoStyle; + const request = new XMLHttpRequest(); + console.log('Sending GET request to: ' + getUrl); + request.open('GET', getUrl); + request.send(); + } + if (data.error) { api.errorPic(data); } else if (photoStyle === 'chroma') { @@ -905,6 +913,16 @@ const photoBooth = (function () { let current = start; const stop = start > 2 ? start - 2 : start; + if (config.get_request.enabled) { + const getMode = + start == config.picture.cntdwn_time ? config.get_request.picture : config.get_request.collage; + const getUrl = config.get_request.server + '/' + getMode; + const request = new XMLHttpRequest(); + console.log('Sending GET request to: ' + getUrl); + request.open('GET', getUrl); + request.send(); + } + function timerFunction() { element.text(Number(current) + Number(config.picture.cntdwn_offset)); current--;