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
Ekaterina
erp5
Commits
14b7cbfa
Commit
14b7cbfa
authored
Oct 03, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Search: use an input gadget
parent
17995f8e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
82 deletions
+55
-82
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
+3
-0
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_searchfield_html.html
...tem/web_page_module/rjs_gadget_erp5_searchfield_html.html
+6
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_html.xml
...Item/web_page_module/rjs_gadget_erp5_searchfield_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
...ateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
+37
-67
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
+2
-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
+3
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.css
View file @
14b7cbfa
...
...
@@ -1030,6 +1030,9 @@ div[data-gadget-scope='header'] .ui-header ul a {
div
[
data-gadget-scope
=
'erp5_searchfield'
]
.ui-input-text
{
display
:
flex
;
}
div
[
data-gadget-scope
=
'erp5_searchfield'
]
.ui-input-text
div
[
data-gadget-scope
=
'input'
]
{
width
:
100%
;
}
div
[
data-gadget-scope
=
'erp5_searchfield'
]
button
{
margin-left
:
0.5em
;
padding
:
0.5em
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_nojqm_css.xml
View file @
14b7cbfa
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
17329.52209.1706
</string>
</value>
<value>
<string>
954.
22971.45413.40994
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
147550
0541.53
</float>
<float>
147550
1272.94
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_html.html
View file @
14b7cbfa
...
...
@@ -8,20 +8,17 @@
<!-- renderjs -->
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"handlebars.js"
></script>
<!-- custom script -->
<script
src=
"gadget_erp5_searchfield.js"
></script>
<script
id=
"panel-template"
type=
"text/x-handlebars-template"
>
<
div
class
=
"
ui-input-text ui-body-{{theme}} ui-input-has-icon ui-corner-all ui-shadow-inset ui-input-has-clear
"
>
<
input
type
=
"
search
"
data
-
enhanced
=
"
true
"
value
=
"
{{widget_value}}
"
name
=
"
search
"
{{
widget_status_attribute
}}
>
<
button
class
=
"
search_button ui-shadow-inset ui-btn ui-btn-inline ui-corner-all ui-btn-{{theme}} ui-btn-icon-notext ui-icon-search ui-override-theme ui-input-btn
"
data
-
role
=
"
button
"
data
-
enhanced
=
"
true
"
type
=
"
submit
"
/>
<
/div
>
</script>
</head>
<body>
<div
class=
"save_form document_form"
></div>
<div
class=
"ui-input-text ui-input-has-icon ui-corner-all ui-shadow-inset ui-input-has-clear"
>
<div
data-gadget-url=
"gadget_html5_input.html"
data-gadget-scope=
"input"
data-gadget-sandbox=
"public"
></div>
<button
class=
"search_button ui-shadow-inset ui-btn ui-btn-inline ui-corner-all ui-btn-icon-notext ui-icon-search ui-override-theme ui-input-btn"
data-role=
"button"
data-enhanced=
"true"
type=
"submit"
/>
</div>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_html.xml
View file @
14b7cbfa
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
2.1567.50811.55193
</string>
</value>
<value>
<string>
95
4.5699.4335.63061
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
14
67032063.7
1
</float>
<float>
14
74550671.8
1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
View file @
14b7cbfa
/*global window, rJS
, RSVP, Handlebars
*/
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
/////////////////////////////////////////////////////////////////
// Handlebars
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var
gadget_klass
=
rJS
(
window
),
source
=
gadget_klass
.
__template_element
.
getElementById
(
"
panel-template
"
)
.
innerHTML
,
panel_template
=
Handlebars
.
compile
(
source
);
gadget_klass
rJS
(
window
)
/////////////////////////////////////////////////////////////////
//
ready
//
declared methods
/////////////////////////////////////////////////////////////////
// Init local properties
.
ready
(
function
(
g
)
{
g
.
props
=
{};
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
state_dict
=
{
extended_search
:
options
.
extended_search
||
""
};
return
this
.
changeState
(
state_dict
);
})
// Assign the element to a variable
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
.
declareMethod
(
'
updateDOM
'
,
function
()
{
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
'
input
'
)
.
push
(
function
(
input_gadget
)
{
var
focus
=
false
;
if
(
!
gadget
.
state
.
extended_search
)
{
focus
=
true
;
}
return
input_gadget
.
render
({
type
:
"
search
"
,
value
:
gadget
.
state
.
extended_search
,
focus
:
focus
,
name
:
"
search
"
,
editable
:
true
});
});
})
//////////////////////////////////////////////
// acquired method
//////////////////////////////////////////////
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
'
render
'
,
function
(
option_dict
)
{
var
append_class
,
append_attribute
,
placeholder
=
""
,
is_disabled
=
option_dict
.
disabled
,
search_gadget
=
this
;
.
allowPublicAcquisition
(
"
notifyValid
"
,
function
()
{
return
;
})
if
(
is_disabled
)
{
append_class
=
"
ui-disabled
"
;
append_attribute
=
'
disabled="disabled
'
;
}
search_gadget
.
props
.
extended_search
=
option_dict
.
extended_search
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
search_gadget
.
translateHtml
(
panel_template
({
widget_value
:
option_dict
.
extended_search
||
placeholder
,
widget_theme
:
option_dict
.
theme
||
"
c
"
,
widget_status_attribute
:
append_attribute
||
placeholder
,
widget_status_class
:
append_class
||
placeholder
}));
.
declareMethod
(
'
getContent
'
,
function
()
{
return
this
.
getDeclaredGadget
(
'
input
'
)
.
push
(
function
(
input_gadget
)
{
return
input_gadget
.
getContent
();
})
.
push
(
function
(
my_translated_html
)
{
search_gadget
.
props
.
element
.
querySelector
(
"
div
"
).
innerHTML
=
my_translated_html
;
return
search_gadget
;
.
push
(
function
(
result
)
{
if
(
result
.
search
)
{
// XXX trim from input gadget?
result
.
search
=
result
.
search
.
trim
();
}
return
result
;
});
})
.
declareMethod
(
'
getContent
'
,
function
()
{
var
input
=
this
.
props
.
element
.
querySelector
(
'
input
'
),
value
=
input
.
value
,
result
=
{};
if
(
value
)
{
value
=
value
.
trim
();
}
result
[
input
.
getAttribute
(
'
name
'
)]
=
value
;
return
result
;
});
}(
window
,
rJS
,
RSVP
,
Handlebars
));
\ 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_searchfield_js.xml
View file @
14b7cbfa
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
2.57378.47936.47257
</string>
</value>
<value>
<string>
95
4.17331.42805.29064
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
14
69806120.58
</float>
<float>
14
75248801.1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt
View file @
14b7cbfa
...
...
@@ -1203,6 +1203,9 @@ div[data-gadget-scope='header'] .ui-header {
div[data-gadget-scope='erp5_searchfield'] {
.ui-input-text {
display: flex;
div[data-gadget-scope='input'] {
width: 100%;
}
}
button {
margin-left: 0.5em;
...
...
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