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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
17995f8e
Commit
17995f8e
authored
Oct 03, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Autoresize textarea and support keyboard shortcut to save
parent
8b35f466
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
56 deletions
+49
-56
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.css
...emplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.css
+0
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.xml
...emplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_html.xml
...em/web_page_module/rjs_gadget_erp5_textareafield_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.js
...eItem/web_page_module/rjs_gadget_erp5_textareafield_js.js
+37
-48
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
+8
-2
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt
...teItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt
+0
-1
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.css
View file @
17995f8e
...
...
@@ -368,7 +368,6 @@ select:-moz-focusring {
color
:
transparent
;
}
textarea
{
height
:
15em
;
width
:
100%
;
margin
:
0
;
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.xml
View file @
17995f8e
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
2.57378.47936.47257
</string>
</value>
<value>
<string>
95
4.17329.52209.1706
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
14
69798919.15
</float>
<float>
14
75500541.53
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_html.xml
View file @
17995f8e
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
48.41883.489.3805
</string>
</value>
<value>
<string>
9
54.3930.47193.19268
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
14
53477484.04
</float>
<float>
14
75500198.61
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.js
View file @
17995f8e
/*global window, rJS
, document, RSVP, loopEventListener
*/
/*global window, rJS */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
document
,
RSVP
,
loopEventListener
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
gadget
.
property_dict
=
{
textarea_deferred
:
RSVP
.
defer
()
};
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
property_dict
.
element
=
element
;
});
.
setState
({
tag
:
'
pre
'
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
new_element
,
field_json
=
options
.
field_json
||
{},
value
=
field_json
.
value
||
field_json
.
default
||
""
;
this
.
property_dict
.
editable
=
(
field_json
.
editable
===
1
);
this
.
property_dict
.
name
=
field_json
.
key
;
if
(
this
.
property_dict
.
editable
)
{
new_element
=
document
.
createElement
(
'
textarea
'
);
var
field_json
=
options
.
field_json
||
{},
state_dict
=
{
value
:
field_json
.
value
||
field_json
.
default
||
""
,
editable
:
field_json
.
editable
,
name
:
field_json
.
key
,
title
:
field_json
.
title
};
state_dict
.
text_content
=
state_dict
.
value
;
return
this
.
changeState
(
state_dict
);
})
new_element
.
value
=
value
;
new_element
.
setAttribute
(
'
name
'
,
this
.
property_dict
.
name
);
new_element
.
setAttribute
(
'
title
'
,
field_json
.
title
);
if
(
field_json
.
required
===
1
)
{
new_element
.
setAttribute
(
'
required
'
,
'
required
'
);
}
/*
if (field_json.editable !== 1) {
textarea.setAttribute('readonly', 'readonly');
textarea.className += "ui-state-readonly";
// textarea.setAttribute('disabled', 'disabled');
}
*/
this
.
property_dict
.
textarea_deferred
.
resolve
(
new_element
);
.
declareMethod
(
'
updateDOM
'
,
function
()
{
var
element
=
this
.
element
,
gadget
=
this
,
url
;
if
(
gadget
.
state
.
editable
)
{
url
=
'
gadget_html5_textarea.html
'
;
}
else
{
new_element
=
document
.
createElement
(
'
pre
'
);
new_element
.
setAttribute
(
"
class
"
,
"
ui-content-non-editable
"
);
new_element
.
textContent
=
value
;
url
=
'
gadget_html5_element.html
'
;
}
this
.
property_dict
.
element
.
appendChild
(
new_element
);
return
this
.
declareGadget
(
url
,
{
scope
:
'
sub
'
})
.
push
(
function
(
input
)
{
// Clear first to DOM, append after to reduce flickering/manip
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
}
element
.
appendChild
(
input
.
element
);
return
input
.
render
(
gadget
.
state
);
});
})
.
declareMethod
(
'
getContent
'
,
function
()
{
var
field
,
value
,
result
=
{};
if
(
this
.
property_dict
.
editable
)
{
field
=
this
.
property_dict
.
element
.
querySelector
(
'
textarea
'
);
value
=
field
.
value
;
}
else
{
field
=
this
.
property_dict
.
element
.
querySelector
(
'
pre
'
);
value
=
field
.
textContent
;
if
(
this
.
state
.
editable
)
{
return
this
.
getDeclaredGadget
(
'
sub
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
getContent
();
});
}
result
[
this
.
property_dict
.
name
]
=
value
;
return
result
;
return
{};
});
}(
window
,
rJS
,
document
,
RSVP
,
loopEventListener
));
\ No newline at end of file
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.xml
View file @
17995f8e
...
...
@@ -63,6 +63,12 @@
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
...
...
@@ -230,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
2.10031.38084.59682
</string>
</value>
<value>
<string>
95
4.15897.25014.42086
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
14
67032882.44
</float>
<float>
14
75163059.77
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt
View file @
17995f8e
...
...
@@ -431,7 +431,6 @@ select {
}
textarea {
height: 15em;
width: 100%;
margin: 0;
// font-family: @monospace;
...
...
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