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
3a58de0f
Commit
3a58de0f
authored
Feb 04, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: mark a thumbnail in red if the upload failed
parent
25e74888
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css
...eItem/web_page_module/rjs_gadget_document_scanner_css.css
+4
-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
+1
-1
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+10
-4
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 @
3a58de0f
...
@@ -68,4 +68,8 @@ div[data-gadget-url$="gadget_document_scanner.html"] > .camera > .thumbnail-list
...
@@ -68,4 +68,8 @@ div[data-gadget-url$="gadget_document_scanner.html"] > .camera > .thumbnail-list
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
.show-img
{
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
.show-img
{
width
:
35%
;
width
:
35%
;
}
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
.upload-error
{
border
:
3px
solid
red
;
}
}
\ No newline at end of file
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml
View file @
3a58de0f
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1580
768900.5
</float>
<float>
1580
843720.26
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
View file @
3a58de0f
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
},
function
()
{
},
function
()
{
// XXX TODO: Handle error case
// XXX TODO: Handle error case
var
state_dict
=
{};
var
state_dict
=
{};
state_dict
[
'
blob_state_
'
+
blob_page
]
=
'
E
rror
'
;
state_dict
[
'
blob_state_
'
+
blob_page
]
=
'
e
rror
'
;
return
gadget
.
changeState
(
state_dict
);
return
gadget
.
changeState
(
state_dict
);
});
});
}
}
...
@@ -177,6 +177,7 @@
...
@@ -177,6 +177,7 @@
function
buildPreviousThumbnailDom
(
gadget
)
{
function
buildPreviousThumbnailDom
(
gadget
)
{
var
i
,
var
i
,
img_class
,
len
=
gadget
.
state
.
page_count
,
len
=
gadget
.
state
.
page_count
,
thumbnail_dom_list
=
[];
thumbnail_dom_list
=
[];
...
@@ -193,12 +194,17 @@
...
@@ -193,12 +194,17 @@
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// XXX TODO display a loader when saving
// XXX TODO display a loader when saving
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
!==
'
deleted
'
)
{
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
!==
'
deleted
'
)
{
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
"
error
"
)
{
img_class
=
"
show-img upload-error
"
;
}
else
{
img_class
=
"
show-img
"
;
}
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
"
button
"
,
type
:
"
button
"
,
// Do not allow to show again the current image
// Do not allow to show again the current image
// or do not allow to show saving image (to simplify button management)
// or do not allow to show saving image (to simplify button management)
disabled
:
(
i
===
gadget
.
state
.
page
)
||
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
'
saving
'
)
disabled
:
(
i
===
gadget
.
state
.
page
)
||
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
'
saving
'
)
},
[
domsugar
(
"
img
"
,
{
"
class
"
:
"
show-img
"
,
},
[
domsugar
(
"
img
"
,
{
"
class
"
:
img_class
,
'
data-page
'
:
i
,
'
data-page
'
:
i
,
src
:
gadget
.
state
[
'
blob_url_
'
+
i
]})]));
src
:
gadget
.
state
[
'
blob_url_
'
+
i
]})]));
}
}
...
@@ -362,7 +368,7 @@
...
@@ -362,7 +368,7 @@
],
],
div
;
div
;
if
(
gadget
.
state
[
'
blob_state_
'
+
gadget
.
state
.
page
]
===
'
failed
'
)
{
if
(
gadget
.
state
[
'
blob_state_
'
+
gadget
.
state
.
page
]
===
'
error
'
)
{
button_list
.
push
(
button_list
.
push
(
// XXX TODO improve icon
// XXX TODO improve icon
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
...
@@ -475,7 +481,7 @@
...
@@ -475,7 +481,7 @@
// XXX TODO use a more precise selector
// XXX TODO use a more precise selector
return
buildPreviousThumbnailDom
(
gadget
)
return
buildPreviousThumbnailDom
(
gadget
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
thumbnail_container
=
gadget
.
element
.
querySelector
(
'
ol
'
);
thumbnail_container
=
gadget
.
element
.
querySelector
(
'
.thumbnail-list
'
);
thumbnail_container
.
parentElement
.
replaceChild
(
thumbnail_container
.
parentElement
.
replaceChild
(
result
,
result
,
thumbnail_container
thumbnail_container
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
3a58de0f
...
@@ -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.
39871.25821.10052
</string>
</value>
<value>
<string>
981.
40903.42421.64529
</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>
15808
32330.0
8
</float>
<float>
15808
45018.9
8
</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