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
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
a07158d0
Commit
a07158d0
authored
Feb 03, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: change the thumbnail list display to show a thumbnail for previous images.
Drop the current displayed text
parent
16e51e39
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
25 deletions
+31
-25
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css
...eItem/web_page_module/rjs_gadget_document_scanner_css.css
+8
-0
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml
...eItem/web_page_module/rjs_gadget_document_scanner_css.xml
+2
-2
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+19
-21
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_css.css
View file @
a07158d0
...
...
@@ -60,4 +60,12 @@ div[data-gadget-url$="gadget_document_scanner.html"] .ui-btn-icon-left:before {
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
button
:disabled
,
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
button
[
disabled
]
{
color
:
#999999
;
}
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
>
.camera
>
.thumbnail-list
{
padding-top
:
.5em
;
}
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
.show-img
{
width
:
35%
;
}
\ No newline at end of file
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml
View file @
a07158d0
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
981.3
1881.58567.1228
</string>
</value>
<value>
<string>
981.3
9650.41596.57241
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1580
302701.4
5
</float>
<float>
1580
768900.
5
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
View file @
a07158d0
...
...
@@ -185,23 +185,6 @@
return
gadget
.
getTranslationList
([
"
Page
"
,
"
New Page
"
])
.
push
(
function
(
result_list
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// XXX TODO: show nice looking thumbnail
// from gadget.state.blob_url_i
// 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
'
,
text
:
result_list
[
0
]
+
(
i
+
1
)
+
'
(
'
+
gadget
.
state
[
'
blob_state_
'
+
i
]
+
'
)
'
,
// Do not allow to show again the current image
// or do not allow to show sending image (to simplify button management)
disabled
:
(
i
===
gadget
.
state
.
page
)
||
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
'
sending
'
),
'
class
'
:
'
show-img
'
,
'
data-page
'
:
i
}));
}
}
// Always add a button to generate a new image
// XXX TODO right term
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
text
:
result_list
[
1
],
...
...
@@ -209,7 +192,22 @@
disabled
:
(
len
===
gadget
.
state
.
page
-
1
),
'
class
'
:
'
new-btn
'
}));
return
domsugar
(
'
ol
'
,
thumbnail_dom_list
);
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// XXX right term
// XXX TODO display a loader when saving
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
!==
'
deleted
'
)
{
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
"
button
"
,
// Do not allow to show again the current image
// or do not allow to show saving image (to simplify button management)
disabled
:
(
i
===
gadget
.
state
.
page
)
||
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
'
saving
'
)
},
[
domsugar
(
"
img
"
,
{
"
class
"
:
"
show-img
"
,
'
data-page
'
:
i
,
src
:
gadget
.
state
[
'
blob_url_
'
+
i
]})]));
}
}
return
domsugar
(
'
ol
'
,
{
"
class
"
:
"
thumbnail-list
"
},
thumbnail_dom_list
);
});
}
...
...
@@ -493,7 +491,7 @@
.
onEvent
(
"
click
"
,
function
(
evt
)
{
// Only handle click on BUTTON element
if
(
evt
.
target
.
tagName
!==
'
BUTTON
'
)
{
if
(
evt
.
target
.
tagName
!==
'
BUTTON
'
&&
evt
.
target
.
tagName
!==
'
IMG
'
)
{
return
;
}
...
...
@@ -554,7 +552,7 @@
};
// Keep image date, as user may need to display it again
state_dict
[
'
blob_url_
'
+
gadget
.
state
.
page_count
]
=
evt
.
target
.
result
;
state_dict
[
'
blob_state_
'
+
gadget
.
state
.
page_count
]
=
'
s
end
ing
'
;
state_dict
[
'
blob_state_
'
+
gadget
.
state
.
page_count
]
=
'
s
av
ing
'
;
return
gadget
.
changeState
(
state_dict
);
})
.
push
(
function
()
{
...
...
@@ -574,7 +572,7 @@
display_step
:
'
display_video
'
,
page
:
gadget
.
state
.
page_count
+
1
};
state_dict
[
'
blob_state_
'
+
gadget
.
state
.
page
]
=
'
s
end
ing
'
;
state_dict
[
'
blob_state_
'
+
gadget
.
state
.
page
]
=
'
s
av
ing
'
;
return
gadget
.
changeState
(
state_dict
);
}
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
a07158d0
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
981.3
4908.11780.34713
</string>
</value>
<value>
<string>
981.3
9686.3809.47701
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1580
484433.54
</float>
<float>
1580
771167.45
</float>
<string>
UTC
</string>
</tuple>
</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