Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
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
Show 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 {
...
@@ -1030,6 +1030,9 @@ div[data-gadget-scope='header'] .ui-header ul a {
div
[
data-gadget-scope
=
'erp5_searchfield'
]
.ui-input-text
{
div
[
data-gadget-scope
=
'erp5_searchfield'
]
.ui-input-text
{
display
:
flex
;
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
{
div
[
data-gadget-scope
=
'erp5_searchfield'
]
button
{
margin-left
:
0.5em
;
margin-left
:
0.5em
;
padding
:
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 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
17329.52209.1706
</string>
</value>
<value>
<string>
954.
22971.45413.40994
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
147550
0541.53
</float>
<float>
147550
1272.94
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_html.html
View file @
14b7cbfa
...
@@ -8,20 +8,17 @@
...
@@ -8,20 +8,17 @@
<!-- renderjs -->
<!-- renderjs -->
<script
src=
"rsvp.js"
></script>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"handlebars.js"
></script>
<!-- custom script -->
<!-- custom script -->
<script
src=
"gadget_erp5_searchfield.js"
></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>
</head>
<body>
<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>
</body>
</html>
</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 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
67032063.7
1
</float>
<float>
14
74550671.8
1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Handlebar
s
// declared method
s
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget_klass
=
rJS
(
window
),
var
state_dict
=
{
source
=
gadget_klass
.
__template_element
extended_search
:
options
.
extended_search
||
""
.
getElementById
(
"
panel-template
"
)
};
.
innerHTML
,
panel_template
=
Handlebars
.
compile
(
source
);
gadget_klass
return
this
.
changeState
(
state_dict
);
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
})
// Assign the element to a variable
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
ready
(
function
(
g
)
{
var
gadget
=
this
;
return
g
.
getElement
()
return
gadget
.
getDeclaredGadget
(
'
input
'
)
.
push
(
function
(
element
)
{
.
push
(
function
(
input_gadget
)
{
g
.
props
.
element
=
element
;
var
focus
=
false
;
});
if
(
!
gadget
.
state
.
extended_search
)
{
})
focus
=
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
;
if
(
is_disabled
)
{
append_class
=
"
ui-disabled
"
;
append_attribute
=
'
disabled="disabled
'
;
}
}
search_gadget
.
props
.
extended_search
=
option_dict
.
extended_search
;
return
input_gadget
.
render
({
return
new
RSVP
.
Queue
()
type
:
"
search
"
,
.
push
(
function
()
{
value
:
gadget
.
state
.
extended_search
,
return
search_gadget
.
translateHtml
(
panel_template
({
focus
:
focus
,
widget_value
:
option_dict
.
extended_search
||
placeholder
,
name
:
"
search
"
,
widget_theme
:
option_dict
.
theme
||
"
c
"
,
editable
:
true
widget_status_attribute
:
append_attribute
||
placeholder
,
});
widget_status_class
:
append_class
||
placeholder
}));
})
.
push
(
function
(
my_translated_html
)
{
search_gadget
.
props
.
element
.
querySelector
(
"
div
"
).
innerHTML
=
my_translated_html
;
return
search_gadget
;
});
});
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
allowPublicAcquisition
(
"
notifyValid
"
,
function
()
{
return
;
})
var
input
=
this
.
props
.
element
.
querySelector
(
'
input
'
),
value
=
input
.
value
,
result
=
{};
if
(
value
)
{
.
declareMethod
(
'
getContent
'
,
function
()
{
value
=
value
.
trim
();
return
this
.
getDeclaredGadget
(
'
input
'
)
.
push
(
function
(
input_gadget
)
{
return
input_gadget
.
getContent
();
})
.
push
(
function
(
result
)
{
if
(
result
.
search
)
{
// XXX trim from input gadget?
result
.
search
=
result
.
search
.
trim
();
}
}
result
[
input
.
getAttribute
(
'
name
'
)]
=
value
;
return
result
;
return
result
;
});
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
));
}(
window
,
rJS
));
\ No newline at end of file
\ 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 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
69806120.58
</float>
<float>
14
75248801.1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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 {
...
@@ -1203,6 +1203,9 @@ div[data-gadget-scope='header'] .ui-header {
div[data-gadget-scope='erp5_searchfield'] {
div[data-gadget-scope='erp5_searchfield'] {
.ui-input-text {
.ui-input-text {
display: flex;
display: flex;
div[data-gadget-scope='input'] {
width: 100%;
}
}
}
button {
button {
margin-left: 0.5em;
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