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
Léo-Paul Géneau
erp5
Commits
2b842d3a
Commit
2b842d3a
authored
Jan 08, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do translation in form gadget
now each gadget should do translation by itself for the iframe reason
parent
9295c722
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
39 deletions
+24
-39
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+14
-7
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_html.xml
...age_module/rjs_gadget_erp5_pt_form_view_editable_html.xml
+6
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
..._page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
+4
-26
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
2b842d3a
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
})\n
})\n
\n
\n
.declareAcquiredMethod("aq_put", "jio_put")\n
.declareAcquiredMethod("aq_put", "jio_put")\n
\n
.declareAcquiredMethod("translateHtml", "translateHtml")
\n
.allowPublicAcquisition("notifyInvalid", function (param_list, scope) {\n
.allowPublicAcquisition("notifyInvalid", function (param_list, scope) {\n
return this.getDeclaredGadget(scope)\n
return this.getDeclaredGadget(scope)\n
.push(function (gadget) {\n
.push(function (gadget) {\n
...
@@ -214,8 +214,6 @@
...
@@ -214,8 +214,6 @@
if (group[0] !== "bottom") {\n
if (group[0] !== "bottom") {\n
field_element.appendChild(label_element);\n
field_element.appendChild(label_element);\n
}\n
}\n
field_element.appendChild(gadget_element);\n
fieldset_element.appendChild(field_element);\n
if (renderered_field.type === \'ListField\') {\n
if (renderered_field.type === \'ListField\') {\n
// (renderered_field.type === \'ParallelListField\') ||\n
// (renderered_field.type === \'ParallelListField\') ||\n
// (renderered_field.type === \'MultiListField\')) {\n
// (renderered_field.type === \'MultiListField\')) {\n
...
@@ -237,6 +235,14 @@
...
@@ -237,6 +235,14 @@
}\n
}\n
\n
\n
return field_queue\n
return field_queue\n
.push(function () {\n
return form_gadget.translateHtml(field_element.innerHTML);\n
})\n
.push(function (my_translate_html) {\n
field_element.innerHTML = my_translate_html;\n
field_element.appendChild(gadget_element);\n
fieldset_element.appendChild(field_element);\n
})\n
.push(function () {\n
.push(function () {\n
return form_gadget.declareGadget(field_url, {\n
return form_gadget.declareGadget(field_url, {\n
scope: renderered_field.key,\n
scope: renderered_field.key,\n
...
@@ -277,6 +283,7 @@
...
@@ -277,6 +283,7 @@
}\n
}\n
dom_element.appendChild(parent_element);\n
dom_element.appendChild(parent_element);\n
//
return
$(parent_element).trigger("create");\n
//
return
$(parent_element).trigger("create");\n
\n
});\n
});\n
})\n
})\n
\n
\n
...
@@ -465,7 +472,7 @@
...
@@ -465,7 +472,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
super_sven
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -479,7 +486,7 @@
...
@@ -479,7 +486,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
940.
2226.16128.23057
</string>
</value>
<value>
<string>
940.
10454.31463.21265
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -497,8 +504,8 @@
...
@@ -497,8 +504,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1420
242897.6
</float>
<float>
1420
736435.02
</float>
<string>
GMT
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_html.xml
View file @
2b842d3a
...
@@ -132,8 +132,8 @@
...
@@ -132,8 +132,8 @@
<!-- XXX action, method, fieldset -->
\n
<!-- XXX action, method, fieldset -->
\n
<!-- XXX needs a theme -->
\n
<!-- XXX needs a theme -->
\n
<form
class=
"save_form ui-body-c"
novalidate
>
\n
<form
class=
"save_form ui-body-c"
novalidate
>
\n
<button
data-i18n=
"save"
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline\n
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right ui-screen-hidden"
>
Save
</button>
\n
ui-icon-edit ui-btn-icon-right ui-screen-hidden"
></button>
\n
\n
\n
<div
data-gadget-url=
"gadget_erp5_form.html"
\n
<div
data-gadget-url=
"gadget_erp5_form.html"
\n
data-gadget-scope=
"erp5_form"
\n
data-gadget-scope=
"erp5_form"
\n
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
super_sven
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -278,7 +278,7 @@
...
@@ -278,7 +278,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.51440.6706.38775
</string>
</value>
<value>
<string>
9
40.10457.48901.33450
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -296,8 +296,8 @@
...
@@ -296,8 +296,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
19417591.82
</float>
<float>
14
20736835.67
</float>
<string>
GMT
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
View file @
2b842d3a
...
@@ -99,9 +99,7 @@
...
@@ -99,9 +99,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
text_content
</string>
</key>
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string>
/*global window, rJS, RSVP, loopEventListener, URI, document */\n
/*global window, rJS, RSVP, loopEventListener, URI, document */\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, RSVP, loopEventListener, URI) {\n
(function (window, rJS, RSVP, loopEventListener, URI) {\n
"use strict";\n
"use strict";\n
...
@@ -191,24 +189,6 @@
...
@@ -191,24 +189,6 @@
breadcrumb_url: all_result[4],\n
breadcrumb_url: all_result[4],\n
save_action: true\n
save_action: true\n
});\n
});\n
})\n
// XXX: DOM touches\n
.push(function () {\n
return form_gadget.translateHtml(form_gadget.props.element.innerHTML);\n
})\n
.push(function (my_translated_html) {\n
//Can\'t use form_gadget.props.element.innerHTML = my_translated_html\n
// which will change dom then service will not be started\n
var temp = document.createElement("div"),\n
elements1,\n
i,\n
elements2;\n
temp.innerHTML = my_translated_html;\n
elements1 = form_gadget.props.element.querySelectorAll("[data-i18n]");\n
elements2 = temp.querySelectorAll("[data-i18n]");\n
for (i = 0; i < elements1.length; i += 1) {\n
elements1[i].innerHTML = elements2[i].innerHTML;\n
}\n
});\n
});\n
})\n
})\n
\n
\n
...
@@ -250,9 +230,7 @@
...
@@ -250,9 +230,7 @@
);\n
);\n
});\n
});\n
\n
\n
}(window, rJS, RSVP, loopEventListener, URI));
}(window, rJS, RSVP, loopEventListener, URI));
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
@@ -387,7 +365,7 @@
...
@@ -387,7 +365,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
940.
9016.5643.56644
</string>
</value>
<value>
<string>
940.
10421.7831.40686
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -405,7 +383,7 @@
...
@@ -405,7 +383,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14207
23492.34
</float>
<float>
14207
36076.72
</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