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
Xiaowu Zhang
erp5
Commits
9fa1ea05
Commit
9fa1ea05
authored
Sep 14, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: use domsugar in the panel
parent
7409a2cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
48 deletions
+33
-48
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
...hTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
+31
-46
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
View file @
9fa1ea05
/*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */
/*global window, document, rJS, RSVP, Node, asBoolean , ensureArray,
mergeGlobalActionWithRawActionList*/
mergeGlobalActionWithRawActionList
, domsugar
*/
(
function
(
window
,
document
,
rJS
,
RSVP
,
Node
,
asBoolean
,
ensureArray
,
mergeGlobalActionWithRawActionList
)
{
mergeGlobalActionWithRawActionList
,
domsugar
)
{
"
use strict
"
;
function
appendDt
(
fragment
,
dt_title
,
dt_icon
,
...
...
@@ -13,26 +13,24 @@
// <a class="{{class_name}}" href="{{href}}">{{title}}</a>
// </dd>
// {{/each}}
var
dt_element
=
document
.
createElement
(
'
dt
'
),
dd_element
,
a_element
,
//////////////////////
var
element_list
=
[
domsugar
(
'
dt
'
,
{
text
:
dt_title
,
'
class
'
:
'
ui-btn-icon-left ui-icon-
'
+
dt_icon
})
],
i
;
dt_element
.
textContent
=
dt_title
;
dt_element
.
setAttribute
(
'
class
'
,
'
ui-btn-icon-left ui-icon-
'
+
dt_icon
);
fragment
.
appendChild
(
dt_element
);
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
dd_element
=
document
.
createElement
(
'
dd
'
);
dd_element
.
setAttribute
(
'
class
'
,
'
document-listview
'
);
a_element
=
document
.
createElement
(
'
a
'
);
if
(
action_list
[
i
].
class_name
)
{
// Avoid add class='undefined' in HTML
a_element
.
setAttribute
(
'
class
'
,
action_list
[
i
].
class_name
);
}
a_element
.
href
=
href_list
[
index
+
i
];
a_element
.
textContent
=
action_list
[
i
].
title
;
dd_element
.
appendChild
(
a_element
);
fragment
.
appendChild
(
dd_element
);
element_list
.
push
(
domsugar
(
'
dd
'
,
{
'
class
'
:
'
document-listview
'
},
[
domsugar
(
'
a
'
,
{
href
:
href_list
[
index
+
i
],
text
:
action_list
[
i
].
title
,
'
class
'
:
action_list
[
i
].
class_name
||
null
})
]));
}
fragment
.
appendChild
(
domsugar
(
null
,
element_list
));
}
rJS
(
window
)
...
...
@@ -145,7 +143,6 @@
clone_list
,
jump_list
,
dl_fragment
,
dl_element
,
queue
=
new
RSVP
.
Queue
();
if
(
modification_dict
.
hasOwnProperty
(
"
visible
"
))
{
...
...
@@ -202,9 +199,7 @@
})
.
push
(
function
(
result_list
)
{
var
editable_value
=
[],
ul_fragment
=
document
.
createDocumentFragment
(),
a_element
,
li_element
,
element_list
=
[],
icon_and_key_list
=
[
'
home
'
,
null
,
'
puzzle-piece
'
,
'
m
'
,
...
...
@@ -213,28 +208,22 @@
'
search
'
,
'
s
'
,
'
sliders
'
,
null
,
'
power-off
'
,
'
o
'
],
ul_element
=
gadget
.
element
.
querySelector
(
"
ul
"
);
];
for
(
i
=
0
;
i
<
result_list
[
0
].
length
;
i
+=
1
)
{
// <li><a href="URL" class="ui-btn-icon-left ui-icon-ICON" data-i18n="TITLE" accesskey="KEY"></a></li>
a_element
=
document
.
createElement
(
'
a
'
);
li_element
=
document
.
createElement
(
'
li
'
);
a_element
.
href
=
result_list
[
0
][
i
];
a_element
.
setAttribute
(
'
class
'
,
'
ui-btn-icon-left ui-icon-
'
+
icon_and_key_list
[
2
*
i
]);
if
(
icon_and_key_list
[
2
*
i
+
1
]
!==
null
)
{
a_element
.
setAttribute
(
'
accesskey
'
,
icon_and_key_list
[
2
*
i
+
1
]);
}
a_element
.
textContent
=
result_list
[
1
][
i
+
1
];
li_element
.
appendChild
(
a_element
);
ul_fragment
.
appendChild
(
li_element
);
element_list
.
push
(
domsugar
(
'
li
'
,
[
domsugar
(
'
a
'
,
{
href
:
result_list
[
0
][
i
],
'
class
'
:
'
ui-btn-icon-left ui-icon-
'
+
icon_and_key_list
[
2
*
i
],
accesskey
:
icon_and_key_list
[
2
*
i
+
1
],
text
:
result_list
[
1
][
i
+
1
]
})
]));
}
while
(
ul_element
.
firstChild
)
{
ul_element
.
removeChild
(
ul_element
.
firstChild
);
}
ul_element
.
appendChild
(
ul_fragment
);
domsugar
(
gadget
.
element
.
querySelector
(
"
ul
"
),
[
domsugar
(
null
,
element_list
)]);
// Update the checkbox field value
if
(
gadget
.
state
.
editable
)
{
editable_value
=
[
'
editable
'
];
...
...
@@ -327,11 +316,7 @@
queue
.
push
(
function
()
{
if
(
dl_fragment
)
{
dl_element
=
gadget
.
element
.
querySelector
(
"
dl
"
);
while
(
dl_element
.
firstChild
)
{
dl_element
.
removeChild
(
dl_element
.
firstChild
);
}
dl_element
.
appendChild
(
dl_fragment
);
domsugar
(
gadget
.
element
.
querySelector
(
"
dl
"
),
[
dl_fragment
]);
}
});
return
queue
;
...
...
@@ -426,4 +411,4 @@
},
/*useCapture=*/
false
,
/*preventDefault=*/
true
);
}(
window
,
document
,
rJS
,
RSVP
,
Node
,
asBoolean
,
ensureArray
,
mergeGlobalActionWithRawActionList
));
\ No newline at end of file
mergeGlobalActionWithRawActionList
,
domsugar
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
9fa1ea05
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
99
1.63550.23294.43315
</string>
</value>
<value>
<string>
99
4.51061.29790.4608
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
16
20660511.5
1
</float>
<float>
16
31621138.3
1
</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