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
Yoji TAKEUCHI
erp5
Commits
125a0481
Commit
125a0481
authored
Feb 23, 2016
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: display all texts in view mode
parent
854e8e3e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
49 deletions
+76
-49
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_css.xml
.../PathTemplateItem/web_page_module/rjs_gadget_erp5_css.xml
+9
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_html.xml
...Item/web_page_module/rjs_gadget_erp5_stringfield_html.xml
+4
-5
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
+40
-24
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.xml
...Item/web_page_module/rjs_gadget_erp5_textareafield_js.xml
+3
-5
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
...ts/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
+6
-6
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewField.xml
...ts/renderjs_ui_page_templates_zuite/testFormViewField.xml
+8
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testCloneDocument.xml
...Item/portal_tests/renderjs_ui_zuite/testCloneDocument.xml
+5
-5
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testRenderjsBasicNavigation.xml
...l_tests/renderjs_ui_zuite/testRenderjsBasicNavigation.xml
+1
-1
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_css.xml
View file @
125a0481
...
@@ -1125,6 +1125,13 @@ html .ui-listbox-error {\n
...
@@ -1125,6 +1125,13 @@ html .ui-listbox-error {\n
text-align: center;\n
text-align: center;\n
}\n
}\n
\n
\n
\n
\n
html .ui-content-non-editable {\n
word-wrap: break-word;\n
white-space: pre-line;\n
}\n
\n
/* cell background */\n
/* cell background */\n
html table thead tr,\n
html table thead tr,\n
html table tfoot tr,\n
html table tfoot tr,\n
...
@@ -5219,7 +5226,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
...
@@ -5219,7 +5226,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
949.
1052.3508.62634
</string>
</value>
<value>
<string>
949.
22640.50771.7816
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -5237,7 +5244,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
...
@@ -5237,7 +5244,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
145
4957135.5
1
</float>
<float>
145
6317267.1
1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_html.xml
View file @
125a0481
...
@@ -122,7 +122,6 @@
...
@@ -122,7 +122,6 @@
\n
\n
</head>
\n
</head>
\n
<body>
\n
<body>
\n
<input
type=
\'text\'
/>
\n
</body>
\n
</body>
\n
</html>
</html>
...
@@ -247,7 +246,7 @@
...
@@ -247,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -261,7 +260,7 @@
...
@@ -261,7 +260,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
37.51526.35217.14489
</string>
</value>
<value>
<string>
9
49.22501.55314.65245
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -279,8 +278,8 @@
...
@@ -279,8 +278,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
12257603.97
</float>
<float>
14
56252782.83
</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_stringfield_js.xml
View file @
125a0481
...
@@ -99,15 +99,16 @@
...
@@ -99,15 +99,16 @@
</item>
</item>
<item>
<item>
<key>
<string>
text_content
</string>
</key>
<key>
<string>
text_content
</string>
</key>
<value>
<string>
/*global window, rJS, RSVP, loopEventListener */\n
<value>
<string>
/*global window, rJS, RSVP, loopEventListener
, document
*/\n
/*jslint indent: 2, maxerr: 3 */\n
/*jslint indent: 2, maxerr: 3 */\n
(function (window, rJS, RSVP, loopEventListener) {\n
(function (window, rJS, RSVP, loopEventListener
, document
) {\n
"use strict";\n
"use strict";\n
\n
\n
rJS(window)\n
rJS(window)\n
.ready(function (gadget) {\n
.ready(function (gadget) {\n
return gadget.getElement()\n
return gadget.getElement()\n
.push(function (element) {\n
.push(function (element) {\n
gadget.props = {};\n
gadget.element = element;\n
gadget.element = element;\n
});\n
});\n
})\n
})\n
...
@@ -116,37 +117,47 @@
...
@@ -116,37 +117,47 @@
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyChange", "notifyChange")\n
.declareAcquiredMethod("notifyChange", "notifyChange")\n
.declareMethod(\'getTextContent\', function () {\n
.declareMethod(\'getTextContent\', function () {\n
return this.
element.querySelector(\'input\').getAttribute(\'value\')
;\n
return this.
props.value
;\n
})\n
})\n
.declareMethod(\'render\', function (options) {\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
var element,\n
text,\n
field_json = options.field_json || {};\n
field_json = options.field_json || {};\n
input.setAttribute(\n
this.props.value = field_json.value || field_json.default || "";\n
\'value\',\n
this.props.editable = field_json.editable;\n
field_json.value || field_json.default || ""\n
if (field_json.editable) {\n
);\n
element = document.createElement(\'input\');\n
input.setAttribute(\'name\', field_json.key);\n
element.setAttribute("type", "text");\n
input.setAttribute(\'title\', field_json.title);\n
element.setAttribute(\'value\', this.props.value);\n
if (field_json.required === 1) {\n
element.setAttribute(\'name\', field_json.key);\n
input.setAttribute(\'required\', \'required\');\n
element.setAttribute(\'title\', field_json.title);\n
}\n
if (field_json.required === 1) {\n
if (field_json.editable !== 1) {\n
element.setAttribute(\'required\', \'required\');\n
input.setAttribute(\'readonly\', \'readonly\');\n
}\n
input.setAttribute(\'data-wrapper-class\', \'ui-state-readonly\');\n
} else {\n
// input.setAttribute(\'disabled\', \'disabled\');\n
element = document.createElement("p");\n
\n
element.setAttribute("class", "ui-content-non-editable");\n
text = document.createTextNode(this.props.value);\n
element.appendChild(text);\n
}\n
}\n
this.element.appendChild(element);\n
})\n
})\n
\n
\n
.declareMethod(\'getContent\', function () {\n
.declareMethod(\'getContent\', function () {\n
var input
= this.element.querySelector(\'input\')
,\n
var input,\n
result = {};\n
result = {};\n
result[input.getAttribute(\'name\')] = input.value;\n
if (this.props.editable) {\n
input = this.element.querySelector(\'input\');\n
result[input.getAttribute(\'name\')] = input.value;\n
}\n
return result;\n
return result;\n
})\n
})\n
\n
\n
.declareMethod(\'checkValidity\', function () {\n
.declareMethod(\'checkValidity\', function () {\n
var result;\n
var result;\n
if (!this.props.editable) {\n
return true;\n
}\n
result = this.element.querySelector(\'input\').checkValidity();\n
result = this.element.querySelector(\'input\').checkValidity();\n
if (result) {\n
if (result) {\n
return this.notifyValid()\n
return this.notifyValid()\n
...
@@ -162,6 +173,9 @@
...
@@ -162,6 +173,9 @@
// Check field validity when the value changes\n
// Check field validity when the value changes\n
////////////////////////////////////\n
////////////////////////////////////\n
var field_gadget = this;\n
var field_gadget = this;\n
if (!field_gadget.props.editable) {\n
return;\n
}\n
\n
\n
function notifyChange() {\n
function notifyChange() {\n
return RSVP.all([\n
return RSVP.all([\n
...
@@ -184,7 +198,9 @@
...
@@ -184,7 +198,9 @@
// Inform when the field input is invalid\n
// Inform when the field input is invalid\n
////////////////////////////////////\n
////////////////////////////////////\n
var field_gadget = this;\n
var field_gadget = this;\n
\n
if (!field_gadget.props.editable) {\n
return;\n
}\n
function notifyInvalid(evt) {\n
function notifyInvalid(evt) {\n
return field_gadget.notifyInvalid(evt.target.validationMessage);\n
return field_gadget.notifyInvalid(evt.target.validationMessage);\n
}\n
}\n
...
@@ -198,7 +214,7 @@
...
@@ -198,7 +214,7 @@
);\n
);\n
});\n
});\n
\n
\n
}(window, rJS, RSVP, loopEventListener));
</string>
</value>
}(window, rJS, RSVP, loopEventListener
, document
));
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
@@ -333,7 +349,7 @@
...
@@ -333,7 +349,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
949.
15479.27859.47018
</string>
</value>
<value>
<string>
949.
22535.16679.23876
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -351,7 +367,7 @@
...
@@ -351,7 +367,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
145
5899182.71
</float>
<float>
145
6317346.39
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.xml
View file @
125a0481
...
@@ -140,6 +140,7 @@
...
@@ -140,6 +140,7 @@
this.property_dict.textarea_deferred.resolve(new_element);\n
this.property_dict.textarea_deferred.resolve(new_element);\n
} else {\n
} else {\n
new_element = document.createElement(\'pre\');\n
new_element = document.createElement(\'pre\');\n
new_element.setAttribute("class", "ui-content-non-editable");\n
new_element.textContent = value;\n
new_element.textContent = value;\n
}\n
}\n
this.property_dict.element.appendChild(new_element);\n
this.property_dict.element.appendChild(new_element);\n
...
@@ -157,9 +158,6 @@
...
@@ -157,9 +158,6 @@
value = field.textContent;\n
value = field.textContent;\n
}\n
}\n
result[this.property_dict.name] = value;\n
result[this.property_dict.name] = value;\n
console.log(result);\n
console.log(field);\n
console.log(this.property_dict.element);\n
return result;\n
return result;\n
})\n
})\n
\n
\n
...
@@ -316,7 +314,7 @@
...
@@ -316,7 +314,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
8.41930.30032.34201
</string>
</value>
<value>
<string>
94
9.24043.58938.21367
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -334,7 +332,7 @@
...
@@ -334,7 +332,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
145
3477730.87
</float>
<float>
145
6336348.49
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
View file @
125a0481
...
@@ -190,8 +190,8 @@
...
@@ -190,8 +190,8 @@
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
input[@title="T
itle"]
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_t
itle"]
</td>
\n
<td>
Title 3
</td>
\n
<td>
Title 3
</td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
@@ -217,8 +217,8 @@
...
@@ -217,8 +217,8 @@
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
input[@title="T
itle"]
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_t
itle"]
</td>
\n
<td>
Title 4
</td>
\n
<td>
Title 4
</td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
@@ -244,8 +244,8 @@
...
@@ -244,8 +244,8 @@
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
input[@title="T
itle"]
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_t
itle"]
</td>
\n
<td>
Title 3
</td>
\n
<td>
Title 3
</td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewField.xml
View file @
125a0481
...
@@ -92,10 +92,17 @@
...
@@ -92,10 +92,17 @@
</tr>
\n
</tr>
\n
<tr>
\n
<tr>
\n
<td>
assertElementPresent
</td>
\n
<td>
assertElementPresent
</td>
\n
<td>
//
input[@value=\'1\' and @name=\'field_my_id\' and @readonly=\'readonly
\']
</td>
\n
<td>
//
div[@data-gadget-scope=\'field_my_id
\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyText
</td>
\n
<td>
//div[@data-gadget-scope=\'field_my_id\']
</td>
\n
<td>
1
</td>
\n
</tr>
\n
\n
\n
<!-- Listbox are always displayed without label -->
\n
<!-- Listbox are always displayed without label -->
\n
<tr>
\n
<tr>
\n
<td>
assertElementNotPresent
</td>
\n
<td>
assertElementNotPresent
</td>
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testCloneDocument.xml
View file @
125a0481
...
@@ -232,14 +232,14 @@
...
@@ -232,14 +232,14 @@
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//
input[@title="Short T
itle"]
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_short_t
itle"]
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
input[@title="Short T
itle"]
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_short_t
itle"]
</td>
\n
<td>
test_clone
</td>
\n
<td>
test_clone
</td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
@@ -262,8 +262,8 @@
...
@@ -262,8 +262,8 @@
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
store
Value
</td>
\n
<td>
store
Text
</td>
\n
<td>
//
input[@nam
e=\'field_my_id\']
</td>
\n
<td>
//
div[@data-gadget-scop
e=\'field_my_id\']
</td>
\n
<td>
original_id
</td>
\n
<td>
original_id
</td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testRenderjsBasicNavigation.xml
View file @
125a0481
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
</tr>
\n
</tr>
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//
input[@title=\'ID
\']
</td>
\n
<td>
//
div[@data-gadget-scope=\'field_my_id
\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
<tr>
\n
<tr>
\n
...
...
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