Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
erp5
Commits
d8498a23
Commit
d8498a23
authored
Jan 31, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: Update TODO list and remove not used funcionts
parent
ff57eb80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
57 deletions
+4
-57
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+2
-55
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
...teItem/web_page_module/rjs_gadget_document_scanner_js.xml
+2
-2
No files found.
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
View file @
d8498a23
...
@@ -111,57 +111,6 @@
...
@@ -111,57 +111,6 @@
//////////////////////////////////////////////////
//////////////////////////////////////////////////
// helper function
// 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
()
{
function
getVideoDeviceList
()
{
if
(
!
navigator
.
mediaDevices
)
{
if
(
!
navigator
.
mediaDevices
)
{
throw
new
Error
(
"
mediaDevices is not supported
"
);
throw
new
Error
(
"
mediaDevices is not supported
"
);
...
@@ -239,7 +188,7 @@
...
@@ -239,7 +188,7 @@
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// XXX TODO: show nice looking thumbnail
// XXX TODO: show nice looking thumbnail
// from gadget.state.blob_url_i
// from gadget.state.blob_url_i
// XXX
TODO translation +
right term
// XXX right term
// XXX TODO display a loader when sending
// XXX TODO display a loader when sending
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
!==
'
deleted
'
)
{
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
!==
'
deleted
'
)
{
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
...
@@ -253,7 +202,7 @@
...
@@ -253,7 +202,7 @@
}
}
}
}
// Always add a button to generate a new image
// 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
'
,
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
text
:
result_list
[
1
],
text
:
result_list
[
1
],
// Do not allow to show again the current image
// Do not allow to show again the current image
...
@@ -609,7 +558,6 @@
...
@@ -609,7 +558,6 @@
return
gadget
.
changeState
(
state_dict
);
return
gadget
.
changeState
(
state_dict
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
// XXX TODO Send the image to ERP5
// XXX Ensure that you have the active process relative url
// XXX Ensure that you have the active process relative url
addDetachedPromise
(
gadget
,
'
ajax_
'
+
(
gadget
.
state
.
page_count
-
1
),
addDetachedPromise
(
gadget
,
'
ajax_
'
+
(
gadget
.
state
.
page_count
-
1
),
handleAsyncStore
(
gadget
,
gadget
.
state
.
page_count
-
1
));
handleAsyncStore
(
gadget
,
gadget
.
state
.
page_count
-
1
));
...
@@ -619,7 +567,6 @@
...
@@ -619,7 +567,6 @@
}
}
if
(
evt
.
target
.
className
.
indexOf
(
"
retry-btn
"
)
!==
-
1
)
{
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
// XXX Ensure that you have the active process relative url
addDetachedPromise
(
gadget
,
'
ajax_
'
+
(
gadget
.
state
.
page
),
addDetachedPromise
(
gadget
,
'
ajax_
'
+
(
gadget
.
state
.
page
),
handleAsyncStore
(
gadget
,
gadget
.
state
.
page
));
handleAsyncStore
(
gadget
,
gadget
.
state
.
page
));
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
d8498a23
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
981.34
772.33248.46728
</string>
</value>
<value>
<string>
981.34
908.11780.34713
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15804
76795.66
</float>
<float>
15804
84433.54
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment