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
b5712227
Commit
b5712227
authored
Mar 02, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: Improve code and comment
parent
3add7a8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+11
-15
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 @
b5712227
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
});
});
}
}
function
handleDataURLRead
(
data_url
)
{
function
getOrientationFromDataUrl
(
data_url
)
{
var
view
=
new
DataView
(
data_url
),
var
view
=
new
DataView
(
data_url
),
length
=
view
.
byteLength
,
length
=
view
.
byteLength
,
offset
=
2
,
offset
=
2
,
...
@@ -59,17 +59,13 @@
...
@@ -59,17 +59,13 @@
return
-
1
;
return
-
1
;
}
}
function
getOrientation
(
blob
,
callback
)
{
function
getOrientation
(
blob
)
{
var
fr
=
new
FileReader
();
return
RSVP
.
Queue
()
return
new
RSVP
.
Promise
(
function
waitFormDataURLRead
(
resolve
,
reject
)
{
.
push
(
function
()
{
fr
.
addEventListener
(
"
load
"
,
function
onload
(
evt
)
{
return
jIO
.
util
.
readBlobAsArrayBuffer
(
blob
);
resolve
(
handleDataURLRead
(
evt
.
target
.
result
));
})
});
.
push
(
function
(
evt
)
{
return
getOrientationFromDataUrl
(
evt
.
target
.
result
);
fr
.
addEventListener
(
"
error
"
,
reject
);
fr
.
readAsArrayBuffer
(
blob
);
},
function
cancelReadBlobAsDataURL
()
{
fr
.
abort
();
});
});
}
}
...
@@ -159,11 +155,11 @@
...
@@ -159,11 +155,11 @@
viewMode
:
3
,
viewMode
:
3
,
// Avoid any cropper calculation or guessing
// Avoid any cropper calculation or guessing
scalable
:
false
,
scalable
:
false
,
//
By default rotatable is true, if you remove it.
//
Please, DON'T touch on rotatable and checkOrientation. Removing it,
//
Make sure, it is set on data
.
//
we will not be able to fix orientation before crop
.
rotatable
:
true
,
rotatable
:
true
,
zoomable
:
false
,
checkOrientation
:
true
,
checkOrientation
:
true
,
zoomable
:
false
,
movable
:
false
,
movable
:
false
,
data
:
data
,
data
:
data
,
ready
:
function
()
{
ready
:
function
()
{
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
b5712227
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.166
59.47570.45977
</string>
</value>
<value>
<string>
982.166
83.22364.19575
</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>
15831
49298.17
</float>
<float>
15831
53003.34
</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