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
Alexander Emmerich
erp5
Commits
30b6820e
Commit
30b6820e
authored
Sep 30, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: support languages translated
parent
580c359e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
253 additions
and
186 deletions
+253
-186
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_filtereditor_html.xml
...tem/web_page_module/rjs_gadget_erp5_filtereditor_html.xml
+9
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_filtereditor_js.xml
...eItem/web_page_module/rjs_gadget_erp5_filtereditor_js.xml
+151
-117
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
+52
-35
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_sorteditor_html.xml
...eItem/web_page_module/rjs_gadget_erp5_sorteditor_html.xml
+5
-5
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_sorteditor_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_sorteditor_js.xml
+36
-20
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_filtereditor_html.xml
View file @
30b6820e
...
...
@@ -148,16 +148,16 @@
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<form
class=
"delete"
>
\n
<button
data-rel=
"close"
type=
"submit"
class=
"close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times"
>
Close
</button>
\n
<button
data-rel=
"close"
type=
"submit"
data-i18n=
"Close"
class=
"close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times"
>
Close
</button>
\n
</form>
\n
</div>
\n
</div>
\n
\n
<h1
class=
"ui-title"
role=
"heading"
aria-level=
"1"
>
Filter Editor
</h1>
\n
<h1
class=
"ui-title"
role=
"heading"
data-i18n=
"Filter Editor"
aria-level=
"1"
>
Filter Editor
</h1>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-right"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<form
class=
"submit"
>
\n
<button
data-rel=
"save"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check"
>
Submit
</button>
\n
<button
data-rel=
"save"
data-i18n=
"submit"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check"
>
Submit
</button>
\n
</form>
\n
</div>
\n
</div>
\n
...
...
@@ -165,7 +165,7 @@
\n
\n
<section
class=
"ui-content-header-plain"
>
\n
<h3
class=
"ui-content-title ui-body-c"
>
\n
<h3
class=
"ui-content-title ui-body-c"
data-i18n=
"Custom Filter"
>
\n
<span
class=
"ui-icon ui-icon-custom"
>
</span>
\n
Custom Filter\n
</h3>
\n
...
...
@@ -174,12 +174,12 @@
<fieldset
data-role=
"controlgroup"
class=
"ui-controlgroup ui-corner-all"
>
\n
\n
<div
class=
"ui-radio"
>
\n
<label
class=
"ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-radio-on"
>
All criterions(AND)
</label>
\n
<label
class=
"ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-radio-on"
data-i18n=
"All criterions(AND)"
>
All criterions(AND)
</label>
\n
<input
type=
"radio"
value=
"Off"
name=
"heard_about"
id=
"heard_about_a"
class=
"and checkboxradio"
data-cacheval=
"true"
data-enhanced=
"true"
>
\n
</div>
\n
\n
<div
class=
"ui-radio"
>
\n
<label
class=
"ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-radio-off"
>
At lease one(OR)
</label>
\n
<label
class=
"ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-radio-off"
data-i18n=
"At lease one(OR)"
>
At lease one(OR)
</label>
\n
<input
type=
"radio"
value=
"Off"
name=
"heard_about"
id=
"heard_about_b"
class=
"or checkboxradio"
data-cacheval=
"false"
data-enhanced=
"true"
>
\n
</div>
\n
\n
...
...
@@ -196,7 +196,7 @@
\n
\n
<section
class=
"ui-content-header-plain"
>
\n
<h3
class=
"ui-content-title ui-body-c"
>
\n
<h3
class=
"ui-content-title ui-body-c"
data-i18n=
"Predefined Filter"
>
\n
<span
class=
"ui-icon ui-icon-custom"
>
</span>
\n
Predefined Filter\n
</h3>
\n
...
...
@@ -349,7 +349,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
5.58401.24333.5606
4
</string>
</value>
<value>
<string>
94
6.2931.62817.6391
4
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -367,7 +367,7 @@
</tuple>
<state>
<tuple>
<float>
144
2993681.5
9
</float>
<float>
144
3620387.1
9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_filtereditor_js.xml
View file @
30b6820e
...
...
@@ -328,15 +328,9 @@
}\n
\n
\n
function
createFilterItem(gadget,
simple_query)
{\n
var
div =
document.createElement("div"),\n
container =
document.createElement("form"),\n
minus_button =
document.createElement("span"),\n
div_text =
document.createElement("div"),\n
select_reference =
document.createElement("select"),\n
i,\n
tmp =
""
,\n
default_select =
"Searchable Text"
,\n
function
createSelectOperator(type,
operator)
{\n
var
html =
""
,\n
select_operator =
document.createElement("select"),\n
select_options,\n
select_options_value,\n
options_map =
{\n
...
...
@@ -347,9 +341,50 @@
"other": ["Exact Match", "keyword"],\n
"other_value": ["", "keyword"]\n
},\n
j;\n
\n
if (type.indexOf(\'date\') !== -1 ||\n
type.indexOf(\'quantity\') !== -1 ||\n
type.indexOf(\'price\') !== -1) {\n
select_options = options_map.date_float;\n
select_options_value = options_map.date_float_value;\n
} else if (type === "Searchable Text") {\n
select_options = options_map.searchable_text;\n
select_options_value = options_map.searchable_text_value;\n
} else {\n
select_options = options_map.other;\n
select_options_value = options_map.other_value;\n
}\n
\n
for (j = 0; j
< select_options.length
;
j
+=
1)
{\n
if
(
operator =
==
select_options_value[j])
{\n
html
+=
selected_option_template({\n
value:
select_options_value[j],\n
text:
select_options[j]\n
});\n
}
else
{\n
html
+=
option_template({\n
value:
select_options_value[j],\n
text:
select_options[j]\n
});\n
}\n
}\n
select_operator.innerHTML =
html;\n
return
select_operator;\n
}\n
\n
\n
text = document.createElement("input"),\n
select_operator = document.createElement("select");\n
function
createFilterItem(gadget,
simple_query)
{\n
var
div =
document.createElement("div"),\n
container =
document.createElement("form"),\n
minus_button =
document.createElement("span"),\n
div_text =
document.createElement("div"),\n
select_reference =
document.createElement("select"),\n
i,\n
operator,\n
tmp =
""
,\n
default_select =
"Searchable Text"
,\n
text =
document.createElement("input");\n
\n
if
(
simple_query =
==
undefined)
{\n
simple_query =
{};\n
...
...
@@ -357,60 +392,13 @@
\n
minus_button.setAttribute("class",
"ui-icon
ui-icon-delete
ui-icon-shadow");\n
div_text.setAttribute("class",
"ui-input-text
ui-body-inherit
ui-corner-all
ui-shadow-inset");\n
container.appendChild(select_reference);\n
container.appendChild(select_operator);\n
div_text.appendChild(text);\n
container.appendChild(div_text);\n
container.appendChild(minus_button);\n
container.setAttribute("class", "filterForm");\n
div.appendChild(container);\n
function createSelectOperator(event) {\n
var html = "",\n
j;\n
if (event.target.value.indexOf(\'date\') !== -1) {\n
text.setAttribute("type", "date");\n
simple_query.value = simple_query.value ? simple_query.value.replace(/\\//g, "-") : "";\n
} else {\n
text.setAttribute("type", "text");\n
}\n
text.setAttribute("value", simple_query.value || "");\n
if (event.target.value.indexOf(\'date\') !== -1 ||\n
event.target.value.indexOf(\'quantity\') !== -1 ||\n
event.target.value.indexOf(\'price\') !== -1) {\n
select_options = options_map.date_float;\n
select_options_value = options_map.date_float_value;\n
} else if (event.target.value === "Searchable Text") {\n
select_options = options_map.searchable_text;\n
select_options_value = options_map.searchable_text_value;\n
} else {\n
select_options = options_map.other;\n
select_options_value = options_map.other_value;\n
}\n
\n
for (j = 0; j
< select_options.length
;
j
+=
1)
{\n
if
(
simple_query.operator =
==
select_options_value[j])
{\n
html
+=
selected_option_template({\n
value:
select_options_value[j],\n
text:
select_options[j]\n
});\n
}
else
{\n
html
+=
option_template({\n
value:
select_options_value[j],\n
text:
select_options[j]\n
});\n
}\n
}\n
select_operator.innerHTML =
html;\n
$(select_operator).selectmenu();\n
$(select_operator).selectmenu(\'refresh\');\n
}\n
\n
\n
tmp =
""
;\n
tmp
+=
option_template({\n
value:
"Searchable
Text",\n
text:
"Searchable
Text"\n
});\n
\n
for
(
i =
0;
i
<
gadget.props.column_list.length;
i
+=
1)
{\n
if
(
simple_query.key =
==
gadget.props.column_list[i][0])
{\n
default_select =
gadget.props.column_list[i][0];\n
...
...
@@ -425,36 +413,84 @@
});\n
}\n
}\n
\n
select_reference.innerHTML =
tmp;\n
createSelectOperator({"target":
{"value":
default_select}});\n
\n
$(select_reference).selectmenu();\n
loopEventListener(\n
minus_button,\n
"click",\n
false,\n
function
()
{\n
div.parentElement.removeChild(div);\n
}\n
);\n
loopEventListener(\n
select_reference,\n
"change",\n
false,\n
createSelectOperator\n
);\n
loopEventListener(\n
container,\n
"submit",\n
false,\n
function
()
{\n
return
submitFilterQuery(gadget);\n
}\n
);\n
if
(simple_query.key
&&
simple_query.key.indexOf(\'date\')
!==
-1)
{\n
text.setAttribute("type",
"date");\n
simple_query.value =
simple_query.value
?
simple_query.value.replace(/\\//g,
"-")
:
"";\n
}
else
{\n
text.setAttribute("type",
"text");\n
}\n
text.setAttribute("value",
simple_query.value
||
"");\n
operator =
createSelectOperator(default_select,
simple_query.operator);\n
container.appendChild(select_reference);\n
container.appendChild(operator);\n
div_text.appendChild(text);\n
container.appendChild(div_text);\n
container.appendChild(minus_button);\n
container.setAttribute("class",
"filterForm");\n
div.appendChild(container);\n
return
div;\n
}\n
\n
\n
function
createTranslatedItem(gadget,
value)
{\n
var
container =
gadget.props.element.querySelector(".filter_item_container"),\n
item =
createFilterItem(gadget,
value);\n
return
new
RSVP.Queue()\n
.push(function
()
{\n
return
gadget.translateHtml(item.innerHTML);\n
})\n
.push(function
(innerHTML)
{\n
var
select_list,\n
i;\n
item.innerHTML =
innerHTML;\n
select_list =
item.querySelectorAll("select");\n
for
(
i =
0;
i
<
select_list.length;
i
+=
1)
{\n
$(select_list[i]).selectmenu();\n
}\n
container.insertBefore(item,
container.lastChild);\n
\n
loopEventListener(\n
select_list[0],\n
"change",\n
false,\n
function
(event)
{\n
return
new
RSVP.Queue()\n
.push(function
()
{\n
var
tmp =
document.createElement("div");\n
tmp.appendChild(createSelectOperator(event.target.value));\n
if
(event.target.value.indexOf(\'date\')
!==
-1)
{\n
item.querySelector("input").setAttribute("type",
"date");\n
}
else
{\n
item.querySelector("input").setAttribute("type",
"text");\n
}\n
return
gadget.translateHtml(tmp.innerHTML);\n
})\n
.push(function
(innerHTML)
{\n
select_list[1]
.innerHTML =
innerHTML;\n
$(select_list[1]).selectmenu(\'refresh\');\n
});\n
}\n
);\n
loopEventListener(\n
item.querySelector(".filterForm"),\n
"submit",\n
false,\n
function
()
{\n
return
submitFilterQuery(gadget);\n
}\n
);\n
\n
loopEventListener(\n
item.querySelector(".ui-icon-delete"),\n
"click",\n
false,\n
function
()
{\n
container.removeChild(item);\n
}\n
);\n
});\n
}\n
\n
gadget_klass\n
/////////////////////////////////////////////////////////////////\n
...
...
@@ -509,11 +545,9 @@
})\n
\n
.declareMethod(\'render\',
function
(options)
{\n
var
container =
this.props.element.querySelector(".filter_item_container"),\n
i,\n
var
i,\n
gadget =
this,\n
domain_tree,\n
item,\n
and =
gadget.props.element.querySelector(".and"),\n
or =
gadget.props.element.querySelector(".or"),\n
query =
""
;\n
...
...
@@ -530,10 +564,30 @@
.push(function
(result)
{\n
var
query_list,\n
query_item_list,\n
queue =
new
RSVP.Queue(),\n
domain_tree_map =
result._embedded._view.listbox.domain_tree_map,\n
domain_tree_query_list;\n
gadget.props.column_list =
result._embedded._view.listbox.column_list;\n
gadget.props.domain_tree_map =
result._embedded._view.listbox.domain_tree_map;\n
\n
if
(domain_tree
!==
"")
{\n
domain_tree_query_list =
QueryFactory.create(domain_tree);\n
domain_tree_query_list =
domain_tree_query_list.query_list
||
[domain_tree_query_list];\n
for
(
i =
0;
i
<
domain_tree_query_list.length;
i
+=
1)
{\n
if
(Object.keys(domain_tree_map).length
!==
0)
{\n
createDomainTree(gadget,
domain_tree_map,
domain_tree_query_list[i].value);\n
}\n
domain_tree_map =
domain_tree_map[domain_tree_query_list[i].value].sub_categories;\n
}\n
if
(Object.keys(domain_tree_map).length
!==
0)
{\n
createDomainTree(gadget,
domain_tree_map,
"--");\n
}\n
}
else
{\n
createDomainTree(gadget);\n
}\n
\n
\n
\n
if
(query
!==
"")
{\n
query_list =
QueryFactory.create(query);\n
if
(
query_list.operator =
==
"OR"
||
query_list.operator =
==
"NOT")
{\n
...
...
@@ -545,39 +599,23 @@
}\n
//OR
built
by
itself\n
if
(or.checked
&&
query_list.operator =
==
"NOT")
{\n
query_item_list =
query_list.query_list[0].query_list
||
[];\n
query_item_list =
query_list.query_list[0].query_list
||
[];\n
}
else
{\n
query_item_list =
query_list.query_list
||
[query_list];\n
}\n
for
(
i =
0;
i
<
query_item_list.length;
i
+=
1)
{\n
if
(or.checked
&&
query_list.operator =
==
"NOT")
{\n
item =
createFilterItem(gadget,
query_item_list[i].query_list[0]
);\n
queue.push(createTranslatedItem(gadget,
query_item_list[i].query_list[0])
);\n
}
else
{\n
item =
createFilterItem(gadget,
query_item_list[i]
);\n
queue.push(createTranslatedItem(gadget,
query_item_list[i])
);\n
}\n
container.insertBefore(item,
container.lastChild);\n
}\n
}
else
{\n
and.checked =
true;\n
and.parentElement.children[0].setAttribute("class",
"ui-btn
ui-corner-all
ui-btn-inherit
ui-btn-icon-left
ui-radio-on");\n
container.insertBefore(createFilterItem(gadget),
container.lastChild);\n
}\n
\n
if
(domain_tree
!==
"")
{\n
domain_tree_query_list =
QueryFactory.create(domain_tree);\n
domain_tree_query_list =
domain_tree_query_list.query_list
||
[domain_tree_query_list];\n
for
(
i =
0;
i
<
domain_tree_query_list.length;
i
+=
1)
{\n
if
(Object.keys(domain_tree_map).length
!==
0)
{\n
createDomainTree(gadget,
domain_tree_map,
domain_tree_query_list[i].value);\n
}\n
domain_tree_map =
domain_tree_map[domain_tree_query_list[i].value].sub_categories;\n
}\n
if
(Object.keys(domain_tree_map).length
!==
0)
{\n
createDomainTree(gadget,
domain_tree_map,
"--");\n
}\n
}
else
{\n
createDomainTree(gadget);\n
queue.push(createTranslatedItem(gadget));\n
}\n
return
queue;\n
});\n
})\n
\n
...
...
@@ -585,21 +623,17 @@
//
declared
services\n
/////////////////////////////////////////////////////////////////\n
.declareService(function
()
{\n
var
gadget =
this,\n
item;\n
var
gadget =
this;\n
function
closeFilterEditor()
{\n
gadget.props.jelement.panel("toggle");\n
}\n
\n
\n
loopEventListener(\n
gadget.props.element.querySelector(".plus"),\n
"submit",\n
false,\n
function
()
{\n
var
container =
gadget.props.element.querySelector(".filter_item_container");\n
item =
createFilterItem(gadget);\n
container.insertBefore(item,
container.lastChild);\n
createTranslatedItem(gadget);\n
}\n
);\n
loopEventListener(\n
...
...
@@ -755,7 +789,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
946.
4378.65397.6826
</string>
</value>
<value>
<string>
946.
5968.16440.8482
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -773,7 +807,7 @@
</tuple>
<state>
<tuple>
<float>
1443
533150.45
</float>
<float>
1443
627977.21
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
30b6820e
...
...
@@ -234,6 +234,7 @@
select_list = [],\n
dataset,\n
counter,\n
paging_info_counter,\n
hide_item = gadget.props.hide_item,\n
sort_list = gadget.props.sort_list || [],\n
i,\n
...
...
@@ -441,6 +442,7 @@
len;\n
\n
th.setAttribute("colspan", field_json.column_list.length);\n
th.setAttribute("class", "foot_colspan");\n
// NOTE: Romain: paging menu with 3+ buttons should have another class name (like ui-paging-grid)\n
paging_menu.className = "ui-controlgroup ui-controlgroup-horizontal ui-corner-all ui-paging-menu";\n
paging_wrap.className = "ui-controlgroup-controls";\n
...
...
@@ -449,18 +451,18 @@
paging_prev.textContent = "Previous";\n
paging_prev.setAttribute("data-i18n", "Previous");\n
paging_prev.href = url_list[0];\n
paging_info.className = "ui-btn ui-disabled";\n
paging_info.className = "
paging_info
ui-btn ui-disabled";\n
if ((begin_from === 0)
&&
(counter === 0)) {\n
paging_info.textContent = "No records";\n
paging_info.setAttribute("data-i18n", "No Records");\n
} else if ((dataset.data.rows.length
<
= lines)
&&
(begin_from === 0)) {\n
paging_info.setAttribute("data-i18n", "[last]Record(s)");\n
paging_info
.appendChild(document.createTextNode(counter))
;\n
paging_info.appendChild(document.createTextNode("Record(s)"));\n
paging_info
_counter = "1 -" + counter
;\n
paging_info.appendChild(document.createTextNode("Record(s)
"));\n
} else {\n
paging_info.setAttribute("data-i18n", "[node]Record(s)");\n
paging_info.appendChild(document.createTextNode("Records "));\n
paging_info
.appendChild(document.createTextNode((((begin_from + lines) / lines - 1) * lines + 1) + " - " + (((begin_from + lines) / lines - 1) * lines + counter))
);\n
paging_info
_counter = (((begin_from + lines) / lines - 1) * lines + 1) + " - " + (((begin_from + lines) / lines - 1) * lines + counter
);\n
}\n
// paging_info.textContent = "Page " + ((begin_from + lines) / lines);\n
paging_next.className = "ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child";\n
...
...
@@ -492,15 +494,17 @@
temp_table.appendChild(fragment);\n
temp.appendChild(temp_table);\n
table.appendChild(temp.querySelector("tbody"));\n
return gadget.translateHtml(temp.querySelector("tfoot").innerHTML);\n
temp.appendChild(document.createElement("tbody"));\n
return gadget.translateHtml(temp.innerHTML);\n
})\n
.push(function (my_translated_html) {\n
var temp = document.createElement("t
foot
");\n
var temp = document.createElement("t
able
");\n
temp.innerHTML = my_translated_html;\n
table.appendChild(temp);\n
temp.querySelector(".paging_info").appendChild(document.createTextNode(paging_info_counter));\n
table.appendChild(temp.querySelector("tfoot"));\n
})\n
.fail(function (error) {\n
if (error.target.status === 500) {\n
if (error.target
&&
error.target
.status === 500) {\n
return gadget.showQueryError(" Unsupportred Query");\n
}\n
throw error;\n
...
...
@@ -537,6 +541,8 @@
hide_submit_form = document.createElement("form"),\n
hide_show_all = document.createElement("button"),\n
query_list = [],\n
translate_div,\n
colspan = gadget.props.element.querySelector(".foot_colspan"),\n
checkbox;\n
all_hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element");\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element:checked");\n
...
...
@@ -544,6 +550,7 @@
if (all_hide_form_elements.length > 0) {\n
//if nothing is selected, show all\n
if (hide_form_elements.length === 0) {\n
colspan.setAttribute("colspan", parseInt(colspan.getAttribute("colspan"), 10) - 1);\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n
...
...
@@ -553,6 +560,7 @@
//all selected\n
//no need to submit\n
if (hide_form_elements.length + 1 === all_hide_form_elements.length) {\n
colspan.setAttribute("colspan", parseInt(colspan.getAttribute("colspan"), 10) - 1);\n
for (i = 0; i
< all_hide_form_elements.length
;
i
+=
1)
{\n
all_hide_form_elements[i].parentElement.removeChild(all_hide_form_elements[i]);\n
}\n
...
...
@@ -582,32 +590,41 @@
}\n
\n
hide_show_all.setAttribute("type",
"submit");\n
hide_show_all.
textContent =
"Show All"
;\n
hide_show_all.
setAttribute("data-i18n",
"Show
All")
;\n
hide_show_all.className =
"ui-btn responsive ui-last-child"
;\n
hide_submit_form.appendChild(hide_show_all);\n
th =
document.createElement("th");\n
\n
th.setAttribute("class",
"hide_form_element");\n
th.appendChild(hide_submit_form);\n
loopEventListener(\n
hide_submit_form,\n
"submit",\n
false,\n
function
()
{\n
return
gadget.redirect({jio_key:
gadget.props.jio_key,\n
"extended_search":
gadget.props.extended_search
||
"",\n
"domain_tree":
gadget.props.domain_tree
||
"",\n
"sort_list":
gadget.props.sort_list
||
""});\n
}\n
);\n
thead_tr.insertBefore(th,
thead_tr.firstChild);\n
for
(
i =
0;
i
<
tr_list.length;
i
+=
1)
{\n
checkbox =
document.createElement("input");\n
checkbox.setAttribute("type",
"checkbox");\n
checkbox.setAttribute("checked",
true);\n
checkbox.setAttribute("class",
"hide_form_element");\n
tr_list[i].insertBefore(checkbox,
tr_list[i].firstChild);\n
}\n
translate_div =
document.createElement("div");\n
translate_div.appendChild(hide_show_all);\n
return
new
RSVP.Queue()\n
.push(function
()
{\n
return
gadget.translateHtml(translate_div.innerHTML);\n
})\n
.push(function
(innerHTML)
{\n
translate_div.innerHTML =
innerHTML;\n
hide_submit_form.innerHTML =
innerHTML;\n
th =
document.createElement("th");\n
colspan.setAttribute("colspan",
parseInt(colspan.getAttribute("colspan"),
10)
+
1);\n
th.setAttribute("class",
"hide_form_element");\n
th.appendChild(hide_submit_form);\n
loopEventListener(\n
hide_submit_form,\n
"submit",\n
false,\n
function
()
{\n
return
gadget.redirect({jio_key:
gadget.props.jio_key,\n
"extended_search":
gadget.props.extended_search
||
"",\n
"domain_tree":
gadget.props.domain_tree
||
"",\n
"sort_list":
gadget.props.sort_list
||
""});\n
}\n
);\n
thead_tr.insertBefore(th,
thead_tr.firstChild);\n
for
(
i =
0;
i
<
tr_list.length;
i
+=
1)
{\n
checkbox =
document.createElement("input");\n
checkbox.setAttribute("type",
"checkbox");\n
checkbox.setAttribute("checked",
true);\n
checkbox.setAttribute("class",
"hide_form_element");\n
tr_list[i].insertBefore(checkbox,
tr_list[i].firstChild);\n
}\n
});\n
}\n
);\n
})\n
...
...
@@ -789,7 +806,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
946.
4415.55526.9147
</string>
</value>
<value>
<string>
946.
5543.47694.6075
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -807,7 +824,7 @@
</tuple>
<state>
<tuple>
<float>
1443
535241.5
</float>
<float>
1443
622529.3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_sorteditor_html.xml
View file @
30b6820e
...
...
@@ -136,16 +136,16 @@
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<form
class=
"delete"
>
\n
<button
data-rel=
"close"
type=
"submit"
class=
"close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times"
>
Close
</button>
\n
<button
data-
i18n=
"Close"
data-
rel=
"close"
type=
"submit"
class=
"close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times"
>
Close
</button>
\n
</form>
\n
</div>
\n
</div>
\n
\n
<h1
class=
"ui-title"
role=
"heading"
aria-level=
"1"
>
Sort Editor
</h1>
\n
<h1
class=
"ui-title"
role=
"heading"
data-i18n=
"sort Editor"
aria-level=
"1"
>
Sort Editor
</h1>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-right"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<form
class=
"submit"
>
\n
<button
data-rel=
"save"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check"
>
Submit
</button>
\n
<button
data-rel=
"save"
data-i18n=
"Submit"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check"
>
Submit
</button>
\n
</form>
\n
</div>
\n
</div>
\n
...
...
@@ -299,7 +299,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
5.60934.57457.64460
</string>
</value>
<value>
<string>
94
6.4096.6867.34269
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -317,7 +317,7 @@
</tuple>
<state>
<tuple>
<float>
1443
515526.27
</float>
<float>
1443
620255.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_sorteditor_js.xml
View file @
30b6820e
...
...
@@ -153,7 +153,6 @@
}\n
}\n
select_reference.innerHTML = tmp;\n
$(select_reference).selectmenu();\n
tmp = "";\n
if (sort_value_list[1] === "ascending") {\n
tmp += selected_option_template({\n
...
...
@@ -180,18 +179,36 @@
}\n
\n
select_operator.innerHTML = tmp;\n
$(select_operator).selectmenu();\n
\n
loopEventListener(\n
minus_button,\n
"click",\n
false,\n
function () {\n
div.parentElement.removeChild(div);\n
}\n
);\n
return div;\n
}\n
\n
function createTranslatedItem(gadget, key) {\n
var container = gadget.props.element.querySelector(".sort_item_container"),\n
sort_item = createSortItem(gadget, key);\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.translateHtml(sort_item.innerHTML);\n
})\n
.push(function (innerHTML) {\n
var select_list,\n
i;\n
sort_item.innerHTML = innerHTML;\n
select_list = sort_item.querySelectorAll("select");\n
for (i = 0; i < select_list.length; i += 1) {\n
$(select_list[i]).selectmenu();\n
}\n
container.insertBefore(sort_item, container.lastChild);\n
loopEventListener(\n
sort_item.querySelector(".ui-icon-delete"),\n
"click",\n
false,\n
function () {\n
container.removeChild(sort_item);\n
}\n
);\n
});\n
}\n
\n
\n
\n
...
...
@@ -245,7 +262,6 @@
.declareMethod(\'render\', function (options) {\n
var gadget = this,\n
i,\n
container = gadget.props.element.querySelector(".sort_item_container"),\n
sort_form_list;\n
sort_form_list = gadget.props.element.querySelectorAll(".sortForm");\n
for (i = 0; i < sort_form_list.length; i += 1) {\n
...
...
@@ -259,29 +275,29 @@
return gadget.jio_getAttachment(options.jio_key, options.view);\n
})\n
.push(function (result) {\n
var key;\n
var key,\n
queue = new RSVP.Queue();\n
gadget.props.column_list = result._embedded._view.listbox.column_list;\n
for (key in options.form_definition.sort_list) {\n
if (options.form_definition.sort_list.hasOwnProperty(key)) {\n
if (options.form_definition.sort_list[key] !== "") {\n
container.insertBefore(createSortItem(gadget, options.form_definition.sort_list[key]), container.lastChild
);\n
queue.push(createTranslatedItem(gadget, options.form_definition.sort_list[key])
);\n
}\n
}\n
}\n
return queue;\n
});\n
})\n
//////////////////////////////////////////////\n
.declareService(function () {\n
var gadget = this;\n
function plusItem() {\n
var container = gadget.props.element.querySelector(".sort_item_container");\n
container.insertBefore(createSortItem(gadget), container.lastChild);\n
}\n
loopEventListener(\n
gadget.props.element.querySelector(".plus"),\n
"submit",\n
false,\n
plusItem\n
function () {\n
return createTranslatedItem(gadget);\n
}\n
);\n
\n
loopEventListener(\n
...
...
@@ -459,7 +475,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
5.62441.17317.23193
</string>
</value>
<value>
<string>
94
6.6000.3675.35362
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -477,7 +493,7 @@
</tuple>
<state>
<tuple>
<float>
1443
515446.86
</float>
<float>
1443
629882.33
</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