Commit d8498a23 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: Update TODO list and remove not used funcionts

parent ff57eb80
......@@ -111,57 +111,6 @@
//////////////////////////////////////////////////
// helper function
//////////////////////////////////////////////////
/*function contrastImage(input, output, contrast) {
var i,
outputContext,
inputContext = input.getContext("2d"),
imageData = inputContext.getImageData(0, 0, input.width, input.height),
data = imageData.data,
factor = (259 * (contrast + 255)) / (255 * (259 - contrast));
for (i = 0; i < data.length; i += 4) {
data[i] = factor * (data[i] - 128) + 128;
data[i + 1] = factor * (data[i + 1] - 128) + 128;
data[i + 2] = factor * (data[i + 2] - 128) + 128;
}
outputContext = output.getContext("2d");
outputContext.putImageData(imageData, 0, 0);
}*/
/*function grayscale(input, output) {
var i,
gray,
outputContext,
outputCanvas = document.createElement("canvas"),
inputContext = input.getContext("2d"),
imageData = inputContext.getImageData(0, 0, input.width, input.height),
data = imageData.data,
arraylength = input.width * input.height * 4;
//gray = 0.3*R + 0.59*G + 0.11*B
// http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/
for (i = arraylength - 1; i > 0; i -= 4) {
gray = 0.3 * data[i - 3] + 0.59 * data[i - 2] + 0.11 * data[i - 1];
data[i - 3] = gray;
data[i - 2] = gray;
data[i - 1] = gray;
}
outputContext = outputCanvas.getContext("2d");
outputContext.putImageData(imageData, 0, 0);
data = canvas.toDataURL("image/png");
output.setAttribute("src", data);
if (cropper) {
cropper.destroy();
}
return new RSVP.Queue()
.push(function () {
cropper = new Cropper(
output,
{
data: preferred_cropped_canvas_data
}
);
});
}*/
function getVideoDeviceList() {
if (!navigator.mediaDevices) {
throw new Error("mediaDevices is not supported");
......@@ -239,7 +188,7 @@
for (i = 0; i < len; i += 1) {
// XXX TODO: show nice looking thumbnail
// from gadget.state.blob_url_i
// XXX TODO translation + right term
// XXX right term
// XXX TODO display a loader when sending
if (gadget.state['blob_state_' + i] !== 'deleted') {
thumbnail_dom_list.push(domsugar('button', {type: 'button',
......@@ -253,7 +202,7 @@
}
}
// Always add a button to generate a new image
// XXX TODO translation + right term
// XXX TODO right term
thumbnail_dom_list.push(domsugar('button', {type: 'button',
text: result_list[1],
// Do not allow to show again the current image
......@@ -609,7 +558,6 @@
return gadget.changeState(state_dict);
})
.push(function () {
// XXX TODO Send the image to ERP5
// XXX Ensure that you have the active process relative url
addDetachedPromise(gadget, 'ajax_' + (gadget.state.page_count - 1),
handleAsyncStore(gadget, gadget.state.page_count - 1));
......@@ -619,7 +567,6 @@
}
if (evt.target.className.indexOf("retry-btn") !== -1) {
// XXX TODO Send the image to ERP5
// XXX Ensure that you have the active process relative url
addDetachedPromise(gadget, 'ajax_' + (gadget.state.page),
handleAsyncStore(gadget, gadget.state.page));
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>981.34772.33248.46728</string> </value>
<value> <string>981.34908.11780.34713</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1580476795.66</float>
<float>1580484433.54</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment