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
148
Merge Requests
148
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
6bdde913
Commit
6bdde913
authored
Oct 09, 2019
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: Add new field to selection publication section and remove select
because we will select camera automatically
parent
2ae8b435
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
27 deletions
+143
-27
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml
...ument_scanner/Base_viewUploadDocumentFromCameraDialog.xml
+1
-0
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_state.xml
...UploadDocumentFromCameraDialog/your_publication_state.xml
+126
-0
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/gadget_document_scanner.css.css
...ins/erp5_document_scanner/gadget_document_scanner.css.css
+4
-0
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/gadget_document_scanner.html.html
...s/erp5_document_scanner/gadget_document_scanner.html.html
+0
-9
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/gadget_document_scanner.js.js
...skins/erp5_document_scanner/gadget_document_scanner.js.js
+12
-18
No files found.
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml
View file @
6bdde913
...
...
@@ -110,6 +110,7 @@
<string>
your_version
</string>
<string>
your_group
</string>
<string>
your_publication_section
</string>
<string>
your_publication_state
</string>
<string>
your_description
</string>
</list>
</value>
...
...
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_state.xml
0 → 100644
View file @
6bdde913
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
items
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_publication_state
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_dialog_mode_category
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Publication State
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [("", ""), ("Draft", "draft"), ("Shared", "shared"), ("Released", "relase"), ("Published", "publish")]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/gadget_document_scanner.css.css
View file @
6bdde913
...
...
@@ -16,6 +16,10 @@
filter
:
brightness
(
1
);
}
.camera
{
min-height
:
390px
;
}
.camera-input
,
.camera-output
{
text-align
:
center
;
}
...
...
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/gadget_document_scanner.html.html
View file @
6bdde913
...
...
@@ -10,12 +10,6 @@
<title>
Gadget Document Scanner
</title>
</head>
<body>
<label>
Select camera
</label>
<div
class=
"device-selector"
>
<select>
<option
value=
""
>
--------
</option>
</select>
</div>
<div
class=
"camera"
>
<div
class=
"camera-input"
style=
"display: none"
>
<video
class=
"video"
>
Webcam is not available
</video>
...
...
@@ -28,9 +22,6 @@
<div
class=
"edit-picture"
>
<button
class=
"capture-button"
>
Crop
</button>
<button
class=
"reset-button"
>
Reset
</button>
<label
for=
"brightness"
>
Brightness (NOT WORKING)
</label>
<input
type=
"range"
step=
"1"
min=
"1"
value=
"1"
max=
"100"
name=
"brightness"
/><br/>
<input
type=
"checkbox"
name=
"grayscale"
value=
"enabled"
/>
Grayscale (DON'T CLICK)
<br/>
</div>
</div>
</div>
...
...
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/gadget_document_scanner.js.js
View file @
6bdde913
...
...
@@ -12,7 +12,9 @@
canvas
,
photo
,
photoInput
,
imageCapture
;
cameraSelected
,
imageCapture
,
cameraList
=
[];
function
readBlobAsDataURL
(
blob
)
{
var
fr
=
new
FileReader
();
...
...
@@ -193,21 +195,19 @@
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
el
,
root
,
selector
;
root
;
return
this
.
getElement
()
.
push
(
function
(
element
)
{
root
=
element
;
selector
=
element
.
querySelector
(
"
select
"
);
preferredCroppedCanvasData
=
preferredCroppedCanvasData
||
JSON
.
parse
(
options
.
preferred_cropped_canvas_data
);
// Clear photo input
element
.
querySelector
(
'
.photoInput
'
).
value
=
""
;
if
(
!
selector
.
value
&&
video
)
{
if
(
video
)
{
video
.
pause
();
}
if
(
selector
.
value
)
{
if
(
cameraSelected
)
{
root
.
querySelector
(
"
.camera-input
"
).
style
.
display
=
""
;
root
.
querySelector
(
"
.capture-button
"
).
style
.
display
=
""
;
root
.
querySelector
(
"
.camera-output
"
).
style
.
display
=
"
none
"
;
...
...
@@ -221,21 +221,15 @@
var
j
,
device
,
len
=
info_list
.
length
;
if
(
selector
.
length
>
1
)
{
return
;
}
for
(
j
=
0
;
j
<
len
;
j
+=
1
)
{
device
=
info_list
[
j
];
if
(
device
.
kind
===
'
videoinput
'
)
{
el
=
document
.
createElement
(
"
option
"
);
el
.
value
=
device
.
deviceId
;
el
.
innerText
=
device
.
label
||
device
.
kind
+
"
"
+
device
.
deviceId
;
selector
.
appendChild
(
el
);
cameraList
.
push
(
device
);
}
}
if
(
selector
.
options
.
length
===
2
)
{
selector
.
options
[
selector
.
options
.
length
-
1
].
selected
=
true
;
return
startup
(
root
,
selector
.
value
);
if
(
cameraList
.
length
>=
1
)
{
// trick to select back camera in mobile
return
startup
(
root
,
cameraList
[
cameraList
.
length
-
1
].
deviceId
);
}
});
})
...
...
@@ -248,7 +242,7 @@
});
return
result
;
})
.
onEvent
(
"
change
"
,
function
(
evt
)
{
/*
.onEvent("change", function (evt) {
if (evt.target.type === "select-one") {
return this.getElement()
.push(function (root) {
...
...
@@ -270,7 +264,7 @@
}
});
}
},
false
,
true
)
}, false, true)
*/
.
onEvent
(
"
click
"
,
function
(
evt
)
{
var
gadget
,
canvasData
;
...
...
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