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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
erp5
Commits
e7ffd96f
Commit
e7ffd96f
authored
Oct 17, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Rewrite image field
parent
5da10afa
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
21 deletions
+38
-21
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_html.html
...Item/web_page_module/rjs_gadget_erp5_imagefield_html.html
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_html.xml
...eItem/web_page_module/rjs_gadget_erp5_imagefield_html.xml
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_js.js
...lateItem/web_page_module/rjs_gadget_erp5_imagefield_js.js
+18
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_imagefield_js.xml
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
...mplateItem/web_page_module/rjs_gadget_html5_element_js.js
+9
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
...plateItem/web_page_module/rjs_gadget_html5_element_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_html.html
View file @
e7ffd96f
...
...
@@ -3,7 +3,7 @@
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
ERP5
Radio
field
</title>
<title>
ERP5
Image
field
</title>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
...
...
@@ -13,6 +13,6 @@
</head>
<body>
<
img
class=
"image"
/
>
<
div
data-gadget-url=
"gadget_html5_element.html"
data-gadget-scope=
"image"
></div
>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_html.xml
View file @
e7ffd96f
...
...
@@ -220,7 +220,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
xiaowu
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
43.42165.22547.51319
</string>
</value>
<value>
<string>
9
54.34618.13218.7202
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
14
34089608.82
</float>
<float>
14
76690889.46
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_js.js
View file @
e7ffd96f
...
...
@@ -4,16 +4,25 @@
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
props
=
{};
gadget
.
props
.
element
=
element
;
});
.
setState
({
tag
:
'
img
'
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
image
=
this
.
props
.
element
.
querySelector
(
"
.image
"
);
image
.
src
=
options
.
field_json
.
default
;
image
.
alt
=
options
.
field_json
.
description
||
options
.
field_json
.
title
;
var
field_json
=
options
.
field_json
||
{},
state_dict
=
{
src
:
field_json
.
default
,
alt
:
field_json
.
description
||
field_json
.
title
};
return
this
.
changeState
(
state_dict
);
})
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
;
return
this
.
getDeclaredGadget
(
'
image
'
)
.
push
(
function
(
input
)
{
return
input
.
render
(
gadget
.
state
);
});
});
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_imagefield_js.xml
View file @
e7ffd96f
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
44.8309.29615.33689
</string>
</value>
<value>
<string>
9
54.42813.65502.45670
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,8 +248,8 @@
</tuple>
<state>
<tuple>
<float>
14
35904292.92
</float>
<string>
GMT+2
</string>
<float>
14
76691101.85
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
View file @
e7ffd96f
...
...
@@ -12,7 +12,9 @@
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
state_dict
=
{
text_content
:
options
.
text_content
||
""
,
tag
:
options
.
tag
||
'
div
'
tag
:
options
.
tag
||
'
div
'
,
src
:
options
.
src
,
alt
:
options
.
alt
};
return
this
.
changeState
(
state_dict
);
})
...
...
@@ -21,6 +23,12 @@
var
element
=
this
.
element
,
new_element
=
document
.
createElement
(
this
.
state
.
tag
);
new_element
.
textContent
=
this
.
state
.
text_content
;
if
(
this
.
state
.
src
)
{
new_element
.
setAttribute
(
'
src
'
,
this
.
state
.
src
);
}
if
(
this
.
state
.
alt
)
{
new_element
.
setAttribute
(
'
alt
'
,
this
.
state
.
alt
);
}
// Clear first to DOM, append after to reduce flickering/manip
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
View file @
e7ffd96f
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.3
4618.13218.7202
</string>
</value>
<value>
<string>
954.3
5866.57616.4915
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
1476
274252.73
</float>
<float>
1476
691574.42
</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