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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
f9c408f7
Commit
f9c408f7
authored
May 14, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Use getUrlForList to reduce number of acquired method call
parent
4234b52a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
34 deletions
+36
-34
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
+17
-23
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
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
+15
-7
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
f9c408f7
...
...
@@ -146,6 +146,7 @@
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
renderEditorPanel
"
,
"
renderEditorPanel
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
...
...
@@ -482,35 +483,28 @@
sort_list
=
JSON
.
parse
(
gadget
.
state
.
sort_list_json
);
// Every line points to a sub-document so we need those links
for
(
i
=
0
;
i
<
counter
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
gadget
.
state
.
command
,
options
:
{
jio_key
:
allDocs_result
.
data
.
rows
[
i
].
id
,
uid
:
allDocs_result
.
data
.
rows
[
i
].
value
.
uid
,
selection_index
:
gadget
.
state
.
begin_from
+
i
,
query
:
gadget
.
state
.
query_string
,
list_method_template
:
gadget
.
state
.
list_method_template
,
"
sort_list:json
"
:
sort_list
}
})
);
promise_list
.
push
({
command
:
gadget
.
state
.
command
,
options
:
{
jio_key
:
allDocs_result
.
data
.
rows
[
i
].
id
,
uid
:
allDocs_result
.
data
.
rows
[
i
].
value
.
uid
,
selection_index
:
gadget
.
state
.
begin_from
+
i
,
query
:
gadget
.
state
.
query_string
,
list_method_template
:
gadget
.
state
.
list_method_template
,
"
sort_list:json
"
:
sort_list
}
});
for
(
j
=
0
;
j
<
column_list
.
length
;
j
+=
1
)
{
content_value
=
allDocs_result
.
data
.
rows
[
i
].
value
[
column_list
[
j
][
0
]]
||
""
;
if
(
content_value
.
url_value
)
{
if
(
content_value
.
url_value
.
command
)
{
url_promise_list
.
push
(
gadget
.
getUrlFor
(
content_value
.
url_value
)
);
url_promise_list
.
push
(
content_value
.
url_value
);
}
}
}
}
promise_list
.
push
.
apply
(
promise_list
,
url_promise_list
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
(
promise_list
);
})
return
gadget
.
getUrlForList
(
promise_list
)
.
push
(
function
(
line_link_list
)
{
var
row_list
=
[],
value
,
...
...
@@ -610,9 +604,9 @@
prev_param
[
gadget
.
state
.
key
+
'
_begin_from
'
]
=
gadget
.
state
.
begin_from
-
lines
;
setNext
();
}
return
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
prev_param
})
,
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
next_param
})
return
gadget
.
getUrlForList
([
{
command
:
'
change
'
,
options
:
prev_param
}
,
{
command
:
'
change
'
,
options
:
next_param
}
]);
})
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
f9c408f7
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
967.34
816.49816.58760
</string>
</value>
<value>
<string>
967.34
904.15900.7253
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
152629
2640.95
</float>
<float>
152629
7884.31
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
View file @
f9c408f7
...
...
@@ -9,6 +9,7 @@
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
...
...
@@ -18,14 +19,21 @@
.
allowPublicAcquisition
(
'
updateHeader
'
,
function
()
{
return
;
})
.
allowPublicAcquisition
(
'
getUrlFor
'
,
function
(
argument_list
)
{
if
(
argument_list
[
0
].
command
===
'
index
'
)
{
return
this
.
getUrlFor
({
command
:
'
display_stored_state
'
,
options
:
{
jio_key
:
argument_list
[
0
].
options
.
jio_key
}
});
.
allowPublicAcquisition
(
'
getUrlForList
'
,
function
(
argument_list
)
{
var
i
,
options_list
=
argument_list
[
0
],
result_list
=
[];
for
(
i
=
0
;
i
<
options_list
.
length
;
i
+=
1
)
{
if
(
options_list
[
i
].
command
===
'
index
'
)
{
result_list
.
push
({
command
:
'
display_stored_state
'
,
options
:
{
jio_key
:
options_list
[
i
].
options
.
jio_key
}
});
}
else
{
result_list
.
push
(
options_list
[
i
]);
}
}
return
this
.
getUrlFor
.
apply
(
this
,
argument_list
);
return
this
.
getUrlFor
List
.
apply
(
this
,
[
result_list
]
);
})
.
allowPublicAcquisition
(
'
jio_allDocs
'
,
function
(
argument_list
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
View file @
f9c408f7
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
5.30895.62413.8584
</string>
</value>
<value>
<string>
96
7.35005.6239.57258
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
18597596.15
</float>
<float>
15
26303943.53
</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