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
Levin Zimmermann
erp5
Commits
0f305253
Commit
0f305253
authored
Jan 26, 2022
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: clean up
parent
cd369929
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
69 deletions
+55
-69
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+18
-11
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
+12
-30
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.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
+19
-22
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
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
0f305253
...
@@ -539,8 +539,11 @@
...
@@ -539,8 +539,11 @@
}
}
}
}
}
}
return
gadget
.
getUrlParameter
(
"
graphic_type
"
)
return
new
RSVP
.
Queue
(
RSVP
.
all
([
.
push
(
function
(
graphic_type
)
{
gadget
.
getUrlParameter
(
"
graphic_type
"
),
gadget
.
getUrlParameter
(
"
only_graphic
"
)
]))
.
push
(
function
(
parameter_list
)
{
return
gadget
.
changeState
({
return
gadget
.
changeState
({
jio_key
:
options
.
jio_key
,
jio_key
:
options
.
jio_key
,
key
:
field_json
.
key
,
key
:
field_json
.
key
,
...
@@ -599,7 +602,8 @@
...
@@ -599,7 +602,8 @@
// graphic
// graphic
enable_graphic
:
options
.
enable_graphic
,
enable_graphic
:
options
.
enable_graphic
,
graphic_type
:
graphic_type
||
getDefaultGraphicType
(
option_list
)
graphic_type
:
parameter_list
[
0
]
||
getDefaultGraphicType
(
option_list
),
only_graphic
:
parameter_list
[
1
]
});
});
});
});
});
});
...
@@ -933,7 +937,7 @@
...
@@ -933,7 +937,7 @@
}
}
domsugar
(
table_element
.
querySelector
(
'
tr
'
),
th_element_list
);
domsugar
(
table_element
.
querySelector
(
'
tr
'
),
th_element_list
);
if
(
gadget
.
state
.
extended_search
||
!
gadget
.
state
.
option_list
.
length
)
{
if
(
gadget
.
state
.
extended_search
&&
!
gadget
.
state
.
only_graphic
)
{
domsugar
(
container
,
[
domsugar
(
container
,
[
domsugar
(
'
div
'
,
{
domsugar
(
'
div
'
,
{
"
class
"
:
'
ui-table-header ui-header
'
"
class
"
:
'
ui-table-header ui-header
'
...
@@ -1201,8 +1205,11 @@
...
@@ -1201,8 +1205,11 @@
loading_element_classList
.
remove
.
apply
(
loading_element_classList
,
loading_class_list
);
loading_element_classList
.
remove
.
apply
(
loading_element_classList
,
loading_class_list
);
loading_element
.
textContent
=
'
(
'
+
pagination_message
+
'
)
'
;
loading_element
.
textContent
=
'
(
'
+
pagination_message
+
'
)
'
;
}
}
if
(
gadget
.
state
.
option_list
.
length
>
0
&&
// XXX if is duplicated. Look at line 1222
gadget
.
state
.
enable_graphic
)
{
if
(
gadget
.
state
.
enable_graphic
&&
((
gadget
.
state
.
graphic_type
&&
!
gadget
.
state
.
extended_search
)
||
(
gadget
.
state
.
graphic_type
&&
gadget
.
state
.
extended_search
&&
gadget
.
state
.
only_graphic
)))
{
domsugar
(
gadget
.
element
.
querySelector
(
"
.graphic_section
"
),
[
domsugar
(
gadget
.
element
.
querySelector
(
"
.graphic_section
"
),
[
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic_area
"
})
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic_area
"
})
]);
]);
...
@@ -1210,11 +1217,11 @@
...
@@ -1210,11 +1217,11 @@
});
});
});
});
if
(
gadget
.
state
.
enable_graphic
&&
if
(
gadget
.
state
.
enable_graphic
&&
((
gadget
.
state
.
graphic_type
&&
gadget
.
state
.
graphic_type
&&
!
gadget
.
state
.
extended_search
!
gadget
.
state
.
extended_search
&&
)
||
(
gadget
.
state
.
option_list
.
length
>
0
&&
gadget
.
state
.
graphic_type
&&
gadget
.
state
.
extended_search
&&
gadget
.
state
.
only_graphic
gadget
.
state
.
graphic_type
!==
""
)
{
))
)
{
result_queue
result_queue
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
return
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
0f305253
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
997.
49726.7840.16145
</string>
</value>
<value>
<string>
997.
50830.31540.53299
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
16432
13057.93
</float>
<float>
16432
30974.76
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
View file @
0f305253
...
@@ -9,23 +9,6 @@
...
@@ -9,23 +9,6 @@
declareGadgetClassCanHandleListboxClipboardAction
,
RSVP
)
{
declareGadgetClassCanHandleListboxClipboardAction
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
function
getDefaultGraphicType
(
option_list
)
{
var
i
,
default_option_list
=
[
"
translated_simulation_state_title
"
,
"
translated_validation_state_title
"
];
if
(
!
option_list
.
length
)
{
return
;
}
for
(
i
=
0
;
i
<
option_list
.
length
;
i
+=
1
)
{
if
(
default_option_list
.
indexOf
(
option_list
[
i
][
0
])
!==
-
1
)
{
return
option_list
[
i
][
0
];
}
}
return
option_list
[
0
][
0
];
}
function
updateSearchQueryFromSelection
(
extended_search
,
checked_uid_list
,
function
updateSearchQueryFromSelection
(
extended_search
,
checked_uid_list
,
key
,
to_include
)
{
key
,
to_include
)
{
var
i
,
var
i
,
...
@@ -162,7 +145,8 @@
...
@@ -162,7 +145,8 @@
form_options
.
enable_graphic
=
false
;
form_options
.
enable_graphic
=
false
;
if
(
graphic_type
||
(
if
(
graphic_type
||
(
!
form_gadget
.
state
.
extended_search
&&
!
graphic_type
))
{
!
form_gadget
.
state
.
extended_search
&&
!
graphic_type
))
{
form_options
.
enable_graphic
=
true
;
form_options
.
enable_graphic
=
true
;
}
}
...
@@ -170,7 +154,7 @@
...
@@ -170,7 +154,7 @@
})
})
// render the search field
// render the search field
.
push
(
function
(
result
)
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
RSVP
.
all
([
form_gadget
.
getDeclaredGadget
(
"
erp5_searchfield
"
),
form_gadget
.
getDeclaredGadget
(
"
erp5_searchfield
"
),
erp5_form
.
getGraphicType
()
erp5_form
.
getGraphicType
()
...
@@ -184,8 +168,9 @@
...
@@ -184,8 +168,9 @@
search_options
.
extended_search
=
form_gadget
.
state
.
extended_search
;
search_options
.
extended_search
=
form_gadget
.
state
.
extended_search
;
}
}
search_options
.
enable_graphic
=
false
;
search_options
.
enable_graphic
=
false
;
if
(
graphic_type
||
(
if
(
graphic_type
||
!
form_gadget
.
state
.
extended_search
&&
!
graphic_type
))
{
(
!
form_gadget
.
state
.
extended_search
&&
!
graphic_type
)
)
{
search_options
.
enable_graphic
=
true
;
search_options
.
enable_graphic
=
true
;
}
}
...
@@ -309,7 +294,7 @@
...
@@ -309,7 +294,7 @@
return
result_list
;
return
result_list
;
});
});
})
})
.
allowPublicAcquisition
(
"
triggerListboxGraphicSelection
"
,
function
triggerListboxGraphicSelection
()
{
.
allowPublicAcquisition
(
"
triggerListboxGraphicSelection
"
,
function
triggerListboxGraphicSelection
()
{
var
gadget
=
this
;
var
gadget
=
this
;
return
this
.
getDeclaredGadget
(
"
erp5_form
"
)
return
this
.
getDeclaredGadget
(
"
erp5_form
"
)
.
push
(
function
(
declared_gadget
)
{
.
push
(
function
(
declared_gadget
)
{
...
@@ -319,14 +304,11 @@
...
@@ -319,14 +304,11 @@
]);
]);
})
})
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
var
result_dict
=
result_list
[
0
],
return
gadget
.
renderEditorPanel
(
"
gadget_erp5_graphic_editor.html
"
,
{
graphic_type
=
result_list
[
1
];
graphic_option_list
:
result_list
[
0
].
graphic_option_list
,
return
gadget
.
renderEditorPanel
(
jio_key
:
gadget
.
state
.
jio_key
,
"
gadget_erp5_graphic_editor.html
"
,
{
graphic_type
:
result_list
[
1
]
graphic_option_list
:
result_dict
.
graphic_option_list
,
});
jio_key
:
gadget
.
state
.
jio_key
,
graphic_type
:
result_list
[
1
]
});
});
});
})
})
.
allowPublicAcquisition
(
"
triggerListboxSelectAction
"
,
function
triggerListboxSelectAction
(
argument_list
)
{
.
allowPublicAcquisition
(
"
triggerListboxSelectAction
"
,
function
triggerListboxSelectAction
(
argument_list
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
0f305253
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
997.50
436.16456.5555
2
</string>
</value>
<value>
<string>
997.50
840.41905.6282
2
</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>
16432
08720.28
</float>
<float>
16432
31574.6
</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 @
0f305253
/*global window, rJS,
document,
Node,
/*global window, rJS, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar*/
QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
document
,
Node
,
(
function
(
window
,
rJS
,
Node
,
QueryFactory
,
SimpleQuery
,
ComplexQuery
,
Query
,
domsugar
)
{
QueryFactory
,
SimpleQuery
,
ComplexQuery
,
Query
,
domsugar
)
{
"
use strict
"
;
"
use strict
"
;
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
button_graphic
=
gadget
.
element
.
querySelector
(
"
.graphic-button
"
),
button_graphic
=
gadget
.
element
.
querySelector
(
"
.graphic-button
"
),
change_button_graphic
=
gadget
.
element
.
querySelector
(
"
.change-graphic-button
"
),
change_button_graphic
=
gadget
.
element
.
querySelector
(
"
.change-graphic-button
"
),
graphic_css_class
=
"
ui-screen-hidden
"
,
graphic_css_class
=
"
ui-screen-hidden
"
,
button
,
operator
=
'
AND
'
,
operator
=
'
AND
'
,
jio_query_list
=
[],
jio_query_list
=
[],
query_text_list
=
[],
query_text_list
=
[],
...
@@ -60,15 +59,8 @@
...
@@ -60,15 +59,8 @@
continue_full_text_query_search
=
true
;
continue_full_text_query_search
=
true
;
if
(
gadget
.
state
.
extended_search
)
{
if
(
gadget
.
state
.
extended_search
)
{
if
(
modification_dict
.
graphic_type
)
{
if
(
modification_dict
.
enable_graphic
&&
modification_dict
.
extended_search
&&
modification_dict
.
graphic_type
)
{
button_graphic
.
classList
.
remove
(
graphic_css_class
);
change_button_graphic
.
classList
.
add
(
graphic_css_class
);
}
else
{
button_graphic
.
classList
.
remove
(
graphic_css_class
);
button_graphic
.
classList
.
remove
(
graphic_css_class
);
change_button_graphic
.
classList
.
add
(
graphic_css_class
);
}
}
// Parse the raw query
// Parse the raw query
...
@@ -128,13 +120,8 @@
...
@@ -128,13 +120,8 @@
}
}
}
}
}
else
if
(
modification_dict
.
enable_graphic
&&
}
else
if
(
modification_dict
.
enable_graphic
&&
button_graphic
&&
!
button_graphic
.
classList
.
contains
(
modification_dict
.
graphic_type
&&
graphic_css_class
))
{
!
modification_dict
.
extended_search
)
{
button_graphic
.
classList
.
add
(
graphic_css_class
);
change_button_graphic
.
classList
.
remove
(
graphic_css_class
);
}
else
if
(
change_button_graphic
&&
modification_dict
.
enable_graphic
&&
!
modification_dict
.
extended_search
){
change_button_graphic
.
classList
.
remove
(
graphic_css_class
);
change_button_graphic
.
classList
.
remove
(
graphic_css_class
);
}
}
...
@@ -261,19 +248,29 @@
...
@@ -261,19 +248,29 @@
// Open the filter panel if one 'search' button is clicked
// Open the filter panel if one 'search' button is clicked
evt
.
preventDefault
();
evt
.
preventDefault
();
return
this
.
triggerSubmit
({
focus_on
:
parseInt
(
evt
.
target
.
value
,
10
)});
return
this
.
triggerSubmit
({
focus_on
:
parseInt
(
evt
.
target
.
value
,
10
)});
}
else
if
(
evt
.
target
.
classList
.
contains
(
"
graphic-button
"
))
{
}
if
(
evt
.
target
.
classList
.
contains
(
"
graphic-button
"
))
{
evt
.
target
.
classList
.
add
(
"
ui-screen-hidden
"
);
gadget
.
element
.
querySelector
(
"
.change-graphic-button
"
).
classList
.
remove
(
"
ui-screen-hidden
"
);
return
gadget
.
redirect
({
return
gadget
.
redirect
({
command
:
"
display_with_history
"
,
command
:
"
display_with_history
"
,
options
:
{
options
:
{
jio_key
:
gadget
.
state
.
jio_key
,
jio_key
:
gadget
.
state
.
jio_key
,
graphic_type
:
gadget
.
state
.
graphic_type
graphic_type
:
gadget
.
state
.
graphic_type
,
extended_search
:
gadget
.
state
.
extended_search
,
only_graphic
:
true
}
}
});
});
}
else
if
(
evt
.
target
.
classList
.
contains
(
"
change-graphic-button
"
))
{
}
if
(
evt
.
target
.
classList
.
contains
(
"
change-graphic-button
"
))
{
evt
.
target
.
classList
.
add
(
"
ui-screen-hidden
"
);
return
gadget
.
triggerListboxGraphicSelection
();
return
gadget
.
triggerListboxGraphicSelection
();
}
}
}
}
},
false
,
false
);
},
false
,
false
);
}(
window
,
rJS
,
document
,
Node
,
}(
window
,
rJS
,
Node
,
QueryFactory
,
SimpleQuery
,
ComplexQuery
,
Query
,
domsugar
));
QueryFactory
,
SimpleQuery
,
ComplexQuery
,
Query
,
domsugar
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
View file @
0f305253
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
997.50
526.4785.59750
</string>
</value>
<value>
<string>
997.50
833.30307.35925
</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>
16432
13115.75
</float>
<float>
16432
31133.68
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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