forked from PhotoboothProject/photobooth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-chroma.js
40 lines (33 loc) · 1.18 KB
/
test-chroma.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* globals photoboothTools */
// eslint-disable-next-line no-unused-vars
const photoboothChromaTest = (function () {
const api = {};
api.runCmd = function (chromaImage, chromaColor, chromaSensitivity, chromaBlend) {
const dataChroma = {
chromaImage: chromaImage,
chromaColor: chromaColor,
chromaSensitivity: chromaSensitivity,
chromaBlend: chromaBlend
};
jQuery
.post('../api/liveChromaConfig.php', dataChroma)
.done(function () {
photoboothTools.console.log('successfully set chroma data');
})
// eslint-disable-next-line no-unused-vars
.fail(function (xhr, status, result) {
photoboothTools.console.log('Failed to set chroma data!');
});
};
$('.setChroma').on('click', function (e) {
e.preventDefault();
photoboothTools.console.log('Setting chroma values...');
api.runCmd(
$('#chromaImage').val(),
$('#chromaColor').val().replace(/#/gu, ''),
$('#chromaSensitivity').val(),
$('#chromaBlend').val()
);
});
return api;
})();