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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
25ecc376
Commit
25ecc376
authored
Sep 07, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: samsung browser randomize the device ID
Try to get the cropper options from previous device ID
parent
e9938482
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.js
...tem/web_page_module/scanner_gadget_document_scanner_js.js
+32
-1
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 @
25ecc376
...
@@ -829,7 +829,38 @@
...
@@ -829,7 +829,38 @@
return
getPreferredDevice
(
gadget
)
return
getPreferredDevice
(
gadget
)
.
push
(
function
(
preferred_device_id
)
{
.
push
(
function
(
preferred_device_id
)
{
return
selectMediaDevice
(
camera_list
,
preferred_device_id
,
false
);
return
RSVP
.
all
([
selectMediaDevice
(
camera_list
,
preferred_device_id
,
false
),
preferred_device_id
]);
})
.
push
(
function
(
result_list
)
{
var
device_id
=
result_list
[
0
],
preferred_device_id
=
result_list
[
1
];
if
(
device_id
!==
preferred_device_id
)
{
// Previous camera used in the same session was not found
// Samsung browser seems to randomize the device ID every time
// it is accessed
// Duplicate previous crop options
return
gadget
.
session_storage_jio
.
get
(
CROPPER_DATA_JIO_KEY
+
preferred_device_id
)
.
push
(
function
(
data
)
{
return
gadget
.
session_storage_jio
.
put
(
CROPPER_DATA_JIO_KEY
+
device_id
,
data
);
},
function
(
error
)
{
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
(
error
.
status_code
===
404
))
{
// If no previous crop data found, nothing to do
return
;
}
throw
error
;
})
.
push
(
function
()
{
return
device_id
;
});
}
return
device_id
;
})
})
.
push
(
function
(
device_id
)
{
.
push
(
function
(
device_id
)
{
if
(
camera_list
.
indexOf
(
device_id
)
===
-
1
)
{
if
(
camera_list
.
indexOf
(
device_id
)
===
-
1
)
{
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/scanner_gadget_document_scanner_js.xml
View file @
25ecc376
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
986.294
18.46329.12509
</string>
</value>
<value>
<string>
986.294
79.21271.57395
</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>
159947
0361.92
</float>
<float>
159947
3730.39
</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