Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
encyclopedia-gui
Commits
4f332b41
Commit
4f332b41
authored
Oct 03, 2018
by
Iker Hurtado
Browse files
Complex search logic implementation (1)
parent
815c0721
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/bundle.js
View file @
4f332b41
...
...
@@ -410,7 +410,7 @@
let
API_HOST
=
'
http://enc-staging-nomad.esc.rzg.mpg.de/
'
;
let
USER_COOKIE_DOMAIN
=
'
localhost
'
;
let
path
=
'
current/v1.0/
'
;
// current development version of the API
// let path = 'v1.0/'; // stable staging
// let path = 'v1.0/'; // stable staging
// Case 2: production environment
if
(
document
.
location
.
href
.
indexOf
(
'
nomad-coe.eu
'
)
>
0
){
//
...
...
@@ -7645,7 +7645,7 @@
// local utility functions
function
getTagHtml
(
tag
,
isFormula
){
return
`<span class="search-label" data-el="
${
tag
}
" >
<img src="img/tag.svg" height="16px" class="remove-label"
<img src="img/
${
isFormula
?
'
info
'
:
'
tag
'
}
.svg" height="16px" class="remove-label"
style="vertical-align: bottom"/>
${
isFormula
?
util
.
getSubscriptedFormula
(
tag
)
:
tag
}
<img src="img/cross.svg" height="6px" class="remove-label"
...
...
@@ -7740,7 +7740,6 @@
this
.
elementTable
=
new
ElementTable
();
this
.
elementTable
.
setClickListener
(
elementArray
=>
{
this
.
addElementsInSearchQuery
(
elementArray
);
this
.
addFormulaButton
.
disabled
=
true
;
// Not always necessary but it simplifies the code
this
.
addMatNameButton
.
disabled
=
true
;
// Not always necessary but it simplifies the code
});
this
.
elementTable
.
setDeselectListener
(
e
=>
this
.
removeElementORFormulaInSearchQuery
(
e
));
...
...
@@ -7750,7 +7749,6 @@
this
.
formulaBox
.
setAddFormulaListener
(
formula
=>
{
if
(
formula
.
trim
()
!==
''
){
this
.
addTagInSearchQuery
(
formula
,
'
F
'
);
this
.
addElementButton
.
disabled
=
true
;
this
.
addMatNameButton
.
disabled
=
true
;
this
.
formulaBox
.
disable
(
true
);
this
.
materialNameBox
.
disable
(
true
);
...
...
client/src/common/util.js
View file @
4f332b41
...
...
@@ -75,7 +75,7 @@ let ELEMENTS = [
let
API_HOST
=
'
http://enc-staging-nomad.esc.rzg.mpg.de/
'
;
let
USER_COOKIE_DOMAIN
=
'
localhost
'
;
let
path
=
'
current/v1.0/
'
;
// current development version of the API
// let path = 'v1.0/'; // stable staging
// let path = 'v1.0/'; // stable staging
// Case 2: production environment
if
(
document
.
location
.
href
.
indexOf
(
'
nomad-coe.eu
'
)
>
0
){
//
...
...
client/src/search-mod/NewSearchMod.js
View file @
4f332b41
...
...
@@ -38,7 +38,7 @@ let SwitchComponent = require('../common/SwitchComponent.js');
// local utility functions
function
getTagHtml
(
tag
,
isFormula
){
return
`<span class="search-label" data-el="
${
tag
}
" >
<img src="img/tag.svg" height="16px" class="remove-label"
<img src="img/
${
isFormula
?
'
info
'
:
'
tag
'
}
.svg" height="16px" class="remove-label"
style="vertical-align: bottom"/>
${
isFormula
?
util
.
getSubscriptedFormula
(
tag
)
:
tag
}
<img src="img/cross.svg" height="6px" class="remove-label"
...
...
@@ -133,7 +133,6 @@ class NewSearchMod {
this
.
elementTable
=
new
ElementTable
();
this
.
elementTable
.
setClickListener
(
elementArray
=>
{
this
.
addElementsInSearchQuery
(
elementArray
);
this
.
addFormulaButton
.
disabled
=
true
;
// Not always necessary but it simplifies the code
this
.
addMatNameButton
.
disabled
=
true
;
// Not always necessary but it simplifies the code
});
this
.
elementTable
.
setDeselectListener
(
e
=>
this
.
removeElementORFormulaInSearchQuery
(
e
));
...
...
@@ -143,7 +142,6 @@ class NewSearchMod {
this
.
formulaBox
.
setAddFormulaListener
(
formula
=>
{
if
(
formula
.
trim
()
!==
''
){
this
.
addTagInSearchQuery
(
formula
,
'
F
'
);
this
.
addElementButton
.
disabled
=
true
;
this
.
addMatNameButton
.
disabled
=
true
;
this
.
formulaBox
.
disable
(
true
);
this
.
materialNameBox
.
disable
(
true
);
...
...
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