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
Paul Graydon
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
Show 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 */
/*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */
/*global window, document, rJS, RSVP, Node, asBoolean , ensureArray,
/*global window, document, rJS, RSVP, Node, asBoolean , ensureArray,
mergeGlobalActionWithRawActionList*/
mergeGlobalActionWithRawActionList
, domsugar
*/
(
function
(
window
,
document
,
rJS
,
RSVP
,
Node
,
asBoolean
,
ensureArray
,
(
function
(
window
,
document
,
rJS
,
RSVP
,
Node
,
asBoolean
,
ensureArray
,
mergeGlobalActionWithRawActionList
)
{
mergeGlobalActionWithRawActionList
,
domsugar
)
{
"
use strict
"
;
"
use strict
"
;
function
appendDt
(
fragment
,
dt_title
,
dt_icon
,
function
appendDt
(
fragment
,
dt_title
,
dt_icon
,
...
@@ -13,26 +13,24 @@
...
@@ -13,26 +13,24 @@
// <a class="{{class_name}}" href="{{href}}">{{title}}</a>
// <a class="{{class_name}}" href="{{href}}">{{title}}</a>
// </dd>
// </dd>
// {{/each}}
// {{/each}}
var
dt_element
=
document
.
createElement
(
'
dt
'
),
//////////////////////
dd_element
,
var
element_list
=
[
a_element
,
domsugar
(
'
dt
'
,
{
text
:
dt_title
,
'
class
'
:
'
ui-btn-icon-left ui-icon-
'
+
dt_icon
})
],
i
;
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
)
{
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
dd_element
=
document
.
createElement
(
'
dd
'
);
element_list
.
push
(
domsugar
(
'
dd
'
,
{
'
class
'
:
'
document-listview
'
},
[
dd_element
.
setAttribute
(
'
class
'
,
'
document-listview
'
);
domsugar
(
'
a
'
,
{
a_element
=
document
.
createElement
(
'
a
'
);
href
:
href_list
[
index
+
i
],
if
(
action_list
[
i
].
class_name
)
{
text
:
action_list
[
i
].
title
,
// Avoid add class='undefined' in HTML
'
class
'
:
action_list
[
i
].
class_name
||
null
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
);
}
}
fragment
.
appendChild
(
domsugar
(
null
,
element_list
));
}
}
rJS
(
window
)
rJS
(
window
)
...
@@ -145,7 +143,6 @@
...
@@ -145,7 +143,6 @@
clone_list
,
clone_list
,
jump_list
,
jump_list
,
dl_fragment
,
dl_fragment
,
dl_element
,
queue
=
new
RSVP
.
Queue
();
queue
=
new
RSVP
.
Queue
();
if
(
modification_dict
.
hasOwnProperty
(
"
visible
"
))
{
if
(
modification_dict
.
hasOwnProperty
(
"
visible
"
))
{
...
@@ -202,9 +199,7 @@
...
@@ -202,9 +199,7 @@
})
})
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
var
editable_value
=
[],
var
editable_value
=
[],
ul_fragment
=
document
.
createDocumentFragment
(),
element_list
=
[],
a_element
,
li_element
,
icon_and_key_list
=
[
icon_and_key_list
=
[
'
home
'
,
null
,
'
home
'
,
null
,
'
puzzle-piece
'
,
'
m
'
,
'
puzzle-piece
'
,
'
m
'
,
...
@@ -213,28 +208,22 @@
...
@@ -213,28 +208,22 @@
'
search
'
,
'
s
'
,
'
search
'
,
'
s
'
,
'
sliders
'
,
null
,
'
sliders
'
,
null
,
'
power-off
'
,
'
o
'
'
power-off
'
,
'
o
'
],
];
ul_element
=
gadget
.
element
.
querySelector
(
"
ul
"
);
for
(
i
=
0
;
i
<
result_list
[
0
].
length
;
i
+=
1
)
{
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>
// <li><a href="URL" class="ui-btn-icon-left ui-icon-ICON" data-i18n="TITLE" accesskey="KEY"></a></li>
a_element
=
document
.
createElement
(
'
a
'
);
element_list
.
push
(
domsugar
(
'
li
'
,
[
li_element
=
document
.
createElement
(
'
li
'
);
domsugar
(
'
a
'
,
{
a_element
.
href
=
result_list
[
0
][
i
];
href
:
result_list
[
0
][
i
],
a_element
.
setAttribute
(
'
class
'
,
'
ui-btn-icon-left ui-icon-
'
+
icon_and_key_list
[
2
*
i
]);
'
class
'
:
'
ui-btn-icon-left ui-icon-
'
+
icon_and_key_list
[
2
*
i
],
if
(
icon_and_key_list
[
2
*
i
+
1
]
!==
null
)
{
accesskey
:
icon_and_key_list
[
2
*
i
+
1
],
a_element
.
setAttribute
(
'
accesskey
'
,
icon_and_key_list
[
2
*
i
+
1
]);
text
:
result_list
[
1
][
i
+
1
]
}
})
a_element
.
textContent
=
result_list
[
1
][
i
+
1
];
]));
li_element
.
appendChild
(
a_element
);
ul_fragment
.
appendChild
(
li_element
);
}
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
// Update the checkbox field value
if
(
gadget
.
state
.
editable
)
{
if
(
gadget
.
state
.
editable
)
{
editable_value
=
[
'
editable
'
];
editable_value
=
[
'
editable
'
];
...
@@ -327,11 +316,7 @@
...
@@ -327,11 +316,7 @@
queue
queue
.
push
(
function
()
{
.
push
(
function
()
{
if
(
dl_fragment
)
{
if
(
dl_fragment
)
{
dl_element
=
gadget
.
element
.
querySelector
(
"
dl
"
);
domsugar
(
gadget
.
element
.
querySelector
(
"
dl
"
),
[
dl_fragment
]);
while
(
dl_element
.
firstChild
)
{
dl_element
.
removeChild
(
dl_element
.
firstChild
);
}
dl_element
.
appendChild
(
dl_fragment
);
}
}
});
});
return
queue
;
return
queue
;
...
@@ -426,4 +411,4 @@
...
@@ -426,4 +411,4 @@
},
/*useCapture=*/
false
,
/*preventDefault=*/
true
);
},
/*useCapture=*/
false
,
/*preventDefault=*/
true
);
}(
window
,
document
,
rJS
,
RSVP
,
Node
,
asBoolean
,
ensureArray
,
}(
window
,
document
,
rJS
,
RSVP
,
Node
,
asBoolean
,
ensureArray
,
mergeGlobalActionWithRawActionList
));
mergeGlobalActionWithRawActionList
,
domsugar
));
\ No newline at end of file
\ 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 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
16
20660511.5
1
</float>
<float>
16
31621138.3
1
</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