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
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
2febf23a
Commit
2febf23a
authored
Apr 03, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: always display the autocrop button
parent
b473603b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.js
...tem/web_page_module/scanner_gadget_document_scanner_js.js
+21
-19
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.xml
...em/web_page_module/scanner_gadget_document_scanner_js.xml
+2
-2
No files found.
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.js
View file @
2febf23a
...
@@ -186,14 +186,19 @@
...
@@ -186,14 +186,19 @@
// creating Cropper is asynchronous
// creating Cropper is asynchronous
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
cropper
=
new
Cropper
(
element
,
{
cropper
=
new
Cropper
(
element
,
{
// restrict the minimum canvas size to fill fit the container
// restrict the minimum canvas size to fit within the container
viewMode
:
3
,
viewMode
:
2
,
guides
:
true
,
center
:
true
,
background
:
false
,
minContainerWidth
:
1
,
minContainerHeight
:
1
,
responsive
:
true
,
restore
:
true
,
// Avoid any cropper calculation or guessing
// Avoid any cropper calculation or guessing
scalable
:
false
,
scalable
:
false
,
// Please, DON'T touch on rotatable and checkOrientation. Removing it,
rotatable
:
false
,
// we will not be able to fix orientation before crop.
checkOrientation
:
false
,
rotatable
:
true
,
checkOrientation
:
true
,
zoomable
:
false
,
zoomable
:
false
,
movable
:
false
,
movable
:
false
,
data
:
data
,
data
:
data
,
...
@@ -425,14 +430,11 @@
...
@@ -425,14 +430,11 @@
text
:
result_list
[
1
][
0
]
text
:
result_list
[
1
][
0
]
}));
}));
if
(
gadget
.
state
.
is_cropper_size_confirmed
)
{
button_list
.
push
(
button_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
'
class
'
:
'
auto-crop-btn ui-icon-fast-forward ui-btn-icon-left
'
,
'
class
'
:
'
auto-crop-btn ui-icon-fast-forward ui-btn-icon-left
'
,
text
:
result_list
[
1
][
3
]
text
:
result_list
[
1
][
3
]
}));
})
);
}
div
=
domsugar
(
'
div
'
,
{
'
class
'
:
'
camera
'
},
[
div
=
domsugar
(
'
div
'
,
{
'
class
'
:
'
camera
'
},
[
domsugar
(
'
div
'
,
{
'
class
'
:
'
camera-header
'
},
[
domsugar
(
'
div
'
,
{
'
class
'
:
'
camera-header
'
},
[
...
@@ -718,7 +720,9 @@
...
@@ -718,7 +720,9 @@
domsugar
(
'
label
'
,
{
'
class
'
:
'
page-number
'
,
text
:
gadget
.
state
.
page
+
1
})
domsugar
(
'
label
'
,
{
'
class
'
:
'
page-number
'
,
text
:
gadget
.
state
.
page
+
1
})
])
])
]),
]),
domsugar
(
'
img
'
,
{
src
:
gadget
.
state
[
'
blob_url_
'
+
gadget
.
state
.
page
]}),
domsugar
(
'
div
'
,
{
'
class
'
:
'
img-container
'
},
[
domsugar
(
'
img
'
,
{
src
:
gadget
.
state
[
'
blob_url_
'
+
gadget
.
state
.
page
]})
]),
// XXX TODO: why is the button rendering different from the other pages?
// XXX TODO: why is the button rendering different from the other pages?
domsugar
(
'
div
'
,
{
'
class
'
:
'
edit-picture
'
},
button_list
),
domsugar
(
'
div
'
,
{
'
class
'
:
'
edit-picture
'
},
button_list
),
result_list
[
1
]
result_list
[
1
]
...
@@ -738,8 +742,7 @@
...
@@ -738,8 +742,7 @@
preferred_cropped_canvas_data
:
gadget
.
cropper
.
getData
(),
preferred_cropped_canvas_data
:
gadget
.
cropper
.
getData
(),
display_step
:
'
display_video
'
,
display_step
:
'
display_video
'
,
page
:
gadget
.
state
.
page
+
1
,
page
:
gadget
.
state
.
page
+
1
,
page_count
:
gadget
.
state
.
page_count
+
1
,
page_count
:
gadget
.
state
.
page_count
+
1
is_cropper_size_confirmed
:
true
};
};
// Keep image date, as user may need to display it again
// Keep image date, as user may need to display it again
state_dict
[
'
blob_canvas_
'
+
gadget
.
state
.
page_count
]
=
canvas
;
state_dict
[
'
blob_canvas_
'
+
gadget
.
state
.
page_count
]
=
canvas
;
...
@@ -785,8 +788,7 @@
...
@@ -785,8 +788,7 @@
display_step
:
'
display_video
'
,
display_step
:
'
display_video
'
,
page
:
1
,
page
:
1
,
page_count
:
0
,
page_count
:
0
,
camera_list
:
[],
camera_list
:
[]
is_cropper_size_confirmed
:
false
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
// This method is called during the ERP5 form rendering
// This method is called during the ERP5 form rendering
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.xml
View file @
2febf23a
...
@@ -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.6
2635.64377.64716
</string>
</value>
<value>
<string>
982.6
1614.28913.46660
</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>
1585
917286.2
</float>
<float>
1585
846471.58
</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