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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
970fd625
Commit
970fd625
authored
Jan 02, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XXX [erp5_web_renderjs_ui] Listbox: new buttons, more fun
parent
20fb75d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
10 deletions
+58
-10
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html
...ateItem/web_page_module/rjs_gadget_erp5_listbox_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
...lateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+53
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html
View file @
970fd625
...
...
@@ -5,6 +5,7 @@
data-i18n=No records
data-i18n=Records
data-i18n=Select
data-i18n=Clipboard
data-i18n=Configure
data-i18n=Sort
data-i18n=sample of
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
View file @
970fd625
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
1.37684.40708.23176
</string>
</value>
<value>
<string>
97
2.44335.31558.29354
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
154
5124793.1
7
</float>
<float>
154
6420711.3
7
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
970fd625
...
...
@@ -278,7 +278,9 @@
"
row_list
"
:
row_list
,
"
show_anchor
"
:
gadget
.
state
.
show_anchor
,
"
column_list
"
:
column_list
,
"
show_line_selector
"
:
gadget
.
state
.
show_line_selector
"
show_line_selector
"
:
gadget
.
state
.
show_line_selector
,
"
show_select_action
"
:
gadget
.
state
.
show_select_action
,
"
show_clipboard_action
"
:
gadget
.
state
.
show_clipboard_action
});
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
...
...
@@ -331,6 +333,8 @@
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
"
getListboxSelectActionList
"
,
"
getListboxSelectActionList
"
)
.
declareAcquiredMethod
(
"
getListboxClipboardActionList
"
,
"
getListboxClipboardActionList
"
)
.
declareAcquiredMethod
(
"
triggerListboxSelectAction
"
,
"
triggerListboxSelectAction
"
)
...
...
@@ -481,7 +485,9 @@
// No error message
has_error
:
false
,
show_line_selector
:
false
show_line_selector
:
false
,
show_select_action
:
false
,
show_clipboard_action
:
false
});
});
return
queue
;
...
...
@@ -497,6 +503,7 @@
j
,
result_queue
=
new
RSVP
.
Queue
(),
button_selector_list
=
[
'
button[name="Sort"]
'
,
'
button[name="Hide"]
'
,
'
button[name="Clipboard"]
'
,
'
button[name="Configure"]
'
,
'
button[name="SelectRows"]
'
],
button
;
...
...
@@ -614,7 +621,7 @@
}
}
if
(
gadget
.
state
.
show_
line_selector
)
{
if
(
gadget
.
state
.
show_
select_action
)
{
select_list
=
gadget
.
getListboxSelectActionList
()
.
push
(
undefined
,
function
(
error
)
{
if
(
error
instanceof
rJS
.
AcquisitionError
)
{
...
...
@@ -627,12 +634,25 @@
});
}
if
(
gadget
.
state
.
show_clipboard_action
)
{
select_list
=
gadget
.
getListboxClipboardActionList
()
.
push
(
undefined
,
function
(
error
)
{
if
(
error
instanceof
rJS
.
AcquisitionError
)
{
// Do not break if parent gadget does not implement it
// XXX this could be a new rJS function when doing
// declareAcquiredMethod
return
[];
}
throw
error
;
});
}
return
RSVP
.
all
([
gadget
.
getUrlForList
(
url_for_option_list
),
is_sortable_list
,
gadget
.
getTranslationList
([
'
Jump
'
,
'
Select
'
,
'
Configure
'
,
'
Sort
'
,
'
Cancel
'
]),
'
Cancel
'
,
'
Clipboard
'
]),
select_list
]);
})
...
...
@@ -713,6 +733,17 @@
button_element
.
textContent
=
translation_list
[
3
];
div_element
.
appendChild
(
button_element
);
// Add Do button
// <button {{disabled}} data-rel="hide" data-i18n="Select" name="Hide" type="button" class="ui-icon-check-square-o ui-btn-icon-left {{hide_class}}"></button>
button_element
=
document
.
createElement
(
'
button
'
);
button_element
.
disabled
=
gadget
.
state
.
disabled
;
button_element
.
setAttribute
(
'
data-rel
'
,
'
clipboard
'
);
button_element
.
setAttribute
(
'
name
'
,
'
Clipboard
'
);
button_element
.
type
=
'
button
'
;
button_element
.
setAttribute
(
'
class
'
,
'
ui-icon-ellipsis-v ui-btn-icon-left
'
+
gadget
.
state
.
hide_class
);
button_element
.
textContent
=
translation_list
[
5
];
div_element
.
appendChild
(
button_element
);
// Add Select button
// <button {{disabled}} data-rel="hide" data-i18n="Select" name="Hide" type="button" class="ui-icon-check-square-o ui-btn-icon-left {{hide_class}}"></button>
button_element
=
document
.
createElement
(
'
button
'
);
...
...
@@ -1210,6 +1241,7 @@
.
onEvent
(
'
click
'
,
function
click
(
evt
)
{
// For some reason, Zelenium can click even if button has the disabled
// attribute. So, it is needed for now to manually checks
console
.
log
(
'
onCLick
'
,
this
.
state
.
disabled
);
if
(
this
.
state
.
disabled
)
{
return
;
}
...
...
@@ -1217,6 +1249,7 @@
var
gadget
=
this
,
sort_button
=
gadget
.
element
.
querySelector
(
'
button[name="Sort"]
'
),
hide_button
=
gadget
.
element
.
querySelector
(
'
button[name="Hide"]
'
),
clipboard_button
=
gadget
.
element
.
querySelector
(
'
button[name="Clipboard"]
'
),
configure_button
=
gadget
.
element
.
querySelector
(
'
button[name="Configure"]
'
),
cancel_select_button
=
gadget
.
element
.
querySelector
(
'
button[name="CancelSelect"]
'
),
url
,
...
...
@@ -1226,6 +1259,8 @@
unchecked_uid_list
,
i
;
console
.
log
(
'
onCLick
'
,
clipboard_button
,
evt
.
target
);
if
(
evt
.
target
===
configure_button
)
{
evt
.
preventDefault
();
url
=
"
gadget_erp5_configure_editor.html
"
;
...
...
@@ -1247,14 +1282,26 @@
if
(
evt
.
target
===
hide_button
)
{
evt
.
preventDefault
();
return
gadget
.
changeState
({
show_line_selector
:
true
show_line_selector
:
true
,
show_select_action
:
true
});
}
if
(
evt
.
target
===
clipboard_button
)
{
console
.
log
(
'
couscous clipboard
'
);
evt
.
preventDefault
();
return
gadget
.
changeState
({
show_line_selector
:
true
,
show_clipboard_action
:
true
});
}
if
(
evt
.
target
===
cancel_select_button
)
{
evt
.
preventDefault
();
return
gadget
.
changeState
({
show_line_selector
:
false
show_line_selector
:
false
,
show_select_action
:
false
,
show_clipboard_action
:
false
});
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
970fd625
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
972.
27092.48077.63488
</string>
</value>
<value>
<string>
972.
46954.57423.23859
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
154
5386943.7
</float>
<float>
154
6422454.02
</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