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
140
Merge Requests
140
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
9a03a635
Commit
9a03a635
authored
May 09, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] HTML5 element gadget now correctly display '0' text content
parent
050ad68b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
15 deletions
+21
-15
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_html.html
...teItem/web_page_module/rjs_gadget_html5_element_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_html.xml
...ateItem/web_page_module/rjs_gadget_html5_element_html.xml
+2
-2
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
+16
-11
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_html5_element_html.html
View file @
9a03a635
...
...
@@ -8,6 +8,7 @@
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_erp5_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_html5_element.js"
type=
"text/javascript"
></script>
</head>
<body></body>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_html.xml
View file @
9a03a635
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
54.3908.27788.61064
</string>
</value>
<value>
<string>
9
63.11788.48702.26146
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
475499589.67
</float>
<float>
1
525874132.93
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
View file @
9a03a635
/*global window, document, rJS */
/*global window, document, rJS
, getFirstNonEmpty, isEmpty
*/
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
document
,
rJS
)
{
(
function
(
window
,
document
,
rJS
,
getFirstNonEmpty
,
isEmpty
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -18,15 +18,15 @@
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
state_dict
=
{
text_content
:
options
.
text_content
||
""
,
inner_html
:
options
.
inner_html
||
""
,
text_content
:
getFirstNonEmpty
(
options
.
text_content
,
""
)
,
inner_html
:
getFirstNonEmpty
(
options
.
inner_html
,
""
)
,
id
:
options
.
id
,
tag
:
options
.
tag
||
'
div
'
,
src
:
options
.
src
,
alt
:
options
.
alt
,
name
:
options
.
name
,
append
:
options
.
append
||
''
,
prepend
:
options
.
prepend
||
''
append
:
getFirstNonEmpty
(
options
.
append
,
""
)
,
prepend
:
getFirstNonEmpty
(
options
.
prepend
,
""
)
};
// data are dictionary thus include it only when defined so it appears
// in modification_dict only when necessary
...
...
@@ -42,8 +42,7 @@
new_element
=
document
.
createElement
(
this
.
state
.
tag
),
content
=
this
.
state
.
text_content
,
data
,
data_attr
;
if
(
this
.
state
.
text_content
)
{
if
(
!
isEmpty
(
this
.
state
.
text_content
))
{
if
(
this
.
state
.
prepend
)
{
content
=
this
.
state
.
prepend
+
"
"
+
content
;
}
...
...
@@ -51,7 +50,7 @@
content
=
content
+
"
"
+
this
.
state
.
append
;
}
new_element
.
textContent
=
content
;
}
else
if
(
this
.
state
.
inner_html
)
{
}
else
if
(
!
isEmpty
(
this
.
state
.
inner_html
)
)
{
new_element
.
innerHTML
=
this
.
state
.
inner_html
;
}
if
(
this
.
state
.
id
)
{
...
...
@@ -87,8 +86,14 @@
if
(
!
this
.
state
.
name
)
{
return
data
;
}
data
[
this
.
state
.
name
]
=
this
.
state
.
text_content
||
this
.
state
.
inner_html
||
""
;
if
(
!
isEmpty
(
this
.
state
.
text_content
))
{
data
[
this
.
state
.
name
]
=
this
.
state
.
text_content
;
}
else
if
(
!
isEmpty
(
this
.
state
.
inner_html
))
{
data
[
this
.
state
.
name
]
=
this
.
state
.
inner_html
;
}
else
{
data
[
this
.
state
.
name
]
=
""
;
}
return
data
;
});
}(
window
,
document
,
rJS
));
\ No newline at end of file
}(
window
,
document
,
rJS
,
getFirstNonEmpty
,
isEmpty
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
View file @
9a03a635
...
...
@@ -224,7 +224,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
5.20431.18358.6485
3
</string>
</value>
<value>
<string>
96
7.27766.62273.1208
3
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -242,7 +242,7 @@
</tuple>
<state>
<tuple>
<float>
15
17925786.08
</float>
<float>
15
25874417.09
</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