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
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
Show 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
text-align: center;\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
html table thead tr,\n
html table tfoot tr,\n
...
...
@@ -5219,7 +5226,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
949.
1052.3508.62634
</string>
</value>
<value>
<string>
949.
22640.50771.7816
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -5237,7 +5244,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
</tuple>
<state>
<tuple>
<float>
145
4957135.5
1
</float>
<float>
145
6317267.1
1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_html.xml
View file @
125a0481
...
...
@@ -122,7 +122,6 @@
\n
</head>
\n
<body>
\n
<input
type=
\'text\'
/>
\n
</body>
\n
</html>
...
...
@@ -247,7 +246,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -261,7 +260,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -279,8 +278,8 @@
</tuple>
<state>
<tuple>
<float>
14
12257603.97
</float>
<string>
GMT
</string>
<float>
14
56252782.83
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
View file @
125a0481
...
...
@@ -99,15 +99,16 @@
</item>
<item>
<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
(function (window, rJS, RSVP, loopEventListener) {\n
(function (window, rJS, RSVP, loopEventListener
, document
) {\n
"use strict";\n
\n
rJS(window)\n
.ready(function (gadget) {\n
return gadget.getElement()\n
.push(function (element) {\n
gadget.props = {};\n
gadget.element = element;\n
});\n
})\n
...
...
@@ -116,37 +117,47 @@
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareAcquiredMethod("notifyChange", "notifyChange")\n
.declareMethod(\'getTextContent\', function () {\n
return this.
element.querySelector(\'input\').getAttribute(\'value\')
;\n
return this.
props.value
;\n
})\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
var element,\n
text,\n
field_json = options.field_json || {};\n
input.setAttribute(\n
\'value\',\n
field_json.value || field_json.default || ""\n
);\n
input.setAttribute(\'name\', field_json.key);\n
input.setAttribute(\'title\', field_json.title);\n
this.props.value = field_json.value || field_json.default || "";\n
this.props.editable = field_json.editable;\n
if (field_json.editable) {\n
element = document.createElement(\'input\');\n
element.setAttribute("type", "text");\n
element.setAttribute(\'value\', this.props.value);\n
element.setAttribute(\'name\', field_json.key);\n
element.setAttribute(\'title\', field_json.title);\n
if (field_json.required === 1) {\n
inpu
t.setAttribute(\'required\', \'required\');\n
elemen
t.setAttribute(\'required\', \'required\');\n
}\n
if (field_json.editable !== 1)
{\n
input.setAttribute(\'readonly\', \'readonly\'
);\n
input.setAttribute(\'data-wrapper-class\', \'ui-state-readonly\'
);\n
// input.setAttribute(\'disabled\', \'disabled\'
);\n
\n
} else
{\n
element = document.createElement("p"
);\n
element.setAttribute("class", "ui-content-non-editable"
);\n
text = document.createTextNode(this.props.value
);\n
element.appendChild(text);
\n
}\n
this.element.appendChild(element);\n
})\n
\n
.declareMethod(\'getContent\', function () {\n
var input
= this.element.querySelector(\'input\')
,\n
var input,\n
result = {};\n
if (this.props.editable) {\n
input = this.element.querySelector(\'input\');\n
result[input.getAttribute(\'name\')] = input.value;\n
}\n
return result;\n
})\n
\n
.declareMethod(\'checkValidity\', function () {\n
var result;\n
if (!this.props.editable) {\n
return true;\n
}\n
result = this.element.querySelector(\'input\').checkValidity();\n
if (result) {\n
return this.notifyValid()\n
...
...
@@ -162,6 +173,9 @@
// Check field validity when the value changes\n
////////////////////////////////////\n
var field_gadget = this;\n
if (!field_gadget.props.editable) {\n
return;\n
}\n
\n
function notifyChange() {\n
return RSVP.all([\n
...
...
@@ -184,7 +198,9 @@
// Inform when the field input is invalid\n
////////////////////////////////////\n
var field_gadget = this;\n
\n
if (!field_gadget.props.editable) {\n
return;\n
}\n
function notifyInvalid(evt) {\n
return field_gadget.notifyInvalid(evt.target.validationMessage);\n
}\n
...
...
@@ -198,7 +214,7 @@
);\n
});\n
\n
}(window, rJS, RSVP, loopEventListener));
</string>
</value>
}(window, rJS, RSVP, loopEventListener
, document
));
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
@@ -333,7 +349,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
949.
15479.27859.47018
</string>
</value>
<value>
<string>
949.
22535.16679.23876
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -351,7 +367,7 @@
</tuple>
<state>
<tuple>
<float>
145
5899182.71
</float>
<float>
145
6317346.39
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.xml
View file @
125a0481
...
...
@@ -140,6 +140,7 @@
this.property_dict.textarea_deferred.resolve(new_element);\n
} else {\n
new_element = document.createElement(\'pre\');\n
new_element.setAttribute("class", "ui-content-non-editable");\n
new_element.textContent = value;\n
}\n
this.property_dict.element.appendChild(new_element);\n
...
...
@@ -157,9 +158,6 @@
value = field.textContent;\n
}\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
})\n
\n
...
...
@@ -316,7 +314,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -334,7 +332,7 @@
</tuple>
<state>
<tuple>
<float>
145
3477730.87
</float>
<float>
145
6336348.49
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
View file @
125a0481
...
...
@@ -190,8 +190,8 @@
</tr>
\n
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
//
input[@title="T
itle"]
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_t
itle"]
</td>
\n
<td>
Title 3
</td>
\n
</tr>
\n
\n
...
...
@@ -217,8 +217,8 @@
</tr>
\n
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
//
input[@title="T
itle"]
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_t
itle"]
</td>
\n
<td>
Title 4
</td>
\n
</tr>
\n
\n
...
...
@@ -244,8 +244,8 @@
</tr>
\n
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
//
input[@title="T
itle"]
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_t
itle"]
</td>
\n
<td>
Title 3
</td>
\n
</tr>
\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 @@
</tr>
\n
<tr>
\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
</tr>
\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
<tr>
\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 @@
\n
<tr>
\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
</tr>
\n
\n
\n
<tr>
\n
<td>
verify
Value
</td>
\n
<td>
//
input[@title="Short T
itle"]
</td>
\n
<td>
verify
Text
</td>
\n
<td>
//
div[@data-gadget-scope="field_my_short_t
itle"]
</td>
\n
<td>
test_clone
</td>
\n
</tr>
\n
\n
...
...
@@ -262,8 +262,8 @@
</tr>
\n
\n
<tr>
\n
<td>
store
Value
</td>
\n
<td>
//
input[@nam
e=\'field_my_id\']
</td>
\n
<td>
store
Text
</td>
\n
<td>
//
div[@data-gadget-scop
e=\'field_my_id\']
</td>
\n
<td>
original_id
</td>
\n
</tr>
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testRenderjsBasicNavigation.xml
View file @
125a0481
...
...
@@ -188,7 +188,7 @@
</tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//
input[@title=\'ID
\']
</td>
\n
<td>
//
div[@data-gadget-scope=\'field_my_id
\']
</td>
\n
<td></td>
\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