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
399925e5
Commit
399925e5
authored
Aug 06, 2018
by
Iker Hurtado
Browse files
Add the checkboxes that modify the search by Elements and Formula
parent
bd7b7018
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/bundle.js
View file @
399925e5
...
...
@@ -7684,7 +7684,7 @@
</div>
<button class="search-btn" >Search</button>
</div>
...
...
@@ -7816,13 +7816,17 @@
}
else
if
(
this
.
queryTypes
[
i
]
===
'
MN
'
){
queryObj
.
bool
.
filter
.
push
(
this
.
_getESSimpleMatch
(
'
material_name
'
,
item
));
}
else
if
(
this
.
queryTypes
[
i
]
===
'
E
'
)
elements
.
push
(
item
);
else
if
(
this
.
queryTypes
[
i
]
===
'
E
'
)
elements
.
push
(
item
);
//else if (this.queryTypes[i] !== 'S'){ // property }
});
if
(
elements
.
length
>
0
)
// If there are elements (there is no formula or material name)
if
(
elements
.
length
>
0
)
{
// If there are elements (there is no formula or material name)
queryObj
.
bool
.
filter
.
push
(
this
.
_getFieldESMatch
(
'
atom_labels
'
,
elements
,
true
));
//getAtomsESMatch(elements));
console
.
log
(
'
getAllowOtherElementsYYYYYYYYYYYYY:
'
+
this
.
elementTable
.
getAllowOtherElements
());
}
///atom_labels": { "operator": "and",
...
...
@@ -8173,6 +8177,14 @@
this
.
element
.
innerHTML
=
`
<div style="padding-bottom: 20px;">
<input type="checkbox" class="allow-other-elements" value="">
Allow other elements
<br>
<input type="checkbox" class="multiples-of-formula" value="">
Include multiples of formula
<br>
<input type="text" class="formula-text-field"
placeholder="Add formula to the search query above" >
<button class="adding-formula-btn" disabled>Add to query</button>
...
...
@@ -8610,8 +8622,11 @@
this
.
element
=
document
.
createElement
(
'
div
'
);
this
.
element
.
setAttribute
(
'
id
'
,
'
elementable
'
);
let
tempHtml
=
`<input type="checkbox" class="allow-other-elements" value="">
Allow other elements`
;
// header with dropdown
let
tempHtml
=
'
<div class="element-info"></div>
'
;
tempHtml
+
=
'
<div class="element-info"></div>
'
;
tempHtml
+=
'
<div class="ptWrapper">
'
;
...
...
@@ -8809,6 +8824,11 @@
}
}
getAllowOtherElements
(){
return
this
.
element
.
querySelector
(
'
.allow-other-elements
'
).
checked
;
}
}
// class ElemenTable
...
...
@@ -8835,6 +8855,9 @@
}
}
// EXPORTS
module
.
exports
=
ElemenTable
;
...
...
client/src/search-mod/ElemenTable.view.js
View file @
399925e5
...
...
@@ -158,8 +158,11 @@ class ElemenTable{
this
.
element
=
document
.
createElement
(
'
div
'
);
this
.
element
.
setAttribute
(
'
id
'
,
'
elementable
'
);
let
tempHtml
=
`<input type="checkbox" class="allow-other-elements" value="">
Allow other elements`
;
// header with dropdown
let
tempHtml
=
'
<div class="element-info"></div>
'
;
tempHtml
+
=
'
<div class="element-info"></div>
'
;
tempHtml
+=
'
<div class="ptWrapper">
'
;
...
...
@@ -357,6 +360,11 @@ class ElemenTable{
}
}
getAllowOtherElements
(){
return
this
.
element
.
querySelector
(
'
.allow-other-elements
'
).
checked
;
}
}
// class ElemenTable
...
...
@@ -383,5 +391,8 @@ function getElement(e){
}
}
// EXPORTS
module
.
exports
=
ElemenTable
;
client/src/search-mod/NewSearchMod.js
View file @
399925e5
...
...
@@ -77,7 +77,7 @@ class NewSearchMod {
</div>
<button class="search-btn" >Search</button>
</div>
...
...
@@ -209,13 +209,17 @@ class NewSearchMod {
}
else
if
(
this
.
queryTypes
[
i
]
===
'
MN
'
){
queryObj
.
bool
.
filter
.
push
(
this
.
_getESSimpleMatch
(
'
material_name
'
,
item
));
}
else
if
(
this
.
queryTypes
[
i
]
===
'
E
'
)
elements
.
push
(
item
);
else
if
(
this
.
queryTypes
[
i
]
===
'
E
'
)
elements
.
push
(
item
);
//else if (this.queryTypes[i] !== 'S'){ // property }
});
if
(
elements
.
length
>
0
)
// If there are elements (there is no formula or material name)
if
(
elements
.
length
>
0
)
{
// If there are elements (there is no formula or material name)
queryObj
.
bool
.
filter
.
push
(
this
.
_getFieldESMatch
(
'
atom_labels
'
,
elements
,
true
));
//getAtomsESMatch(elements));
console
.
log
(
'
getAllowOtherElementsYYYYYYYYYYYYY:
'
+
this
.
elementTable
.
getAllowOtherElements
());
}
///atom_labels": { "operator": "and",
...
...
@@ -566,6 +570,14 @@ class FormulaBox{
this
.
element
.
innerHTML
=
`
<div style="padding-bottom: 20px;">
<input type="checkbox" class="allow-other-elements" value="">
Allow other elements
<br>
<input type="checkbox" class="multiples-of-formula" value="">
Include multiples of formula
<br>
<input type="text" class="formula-text-field"
placeholder="Add formula to the search query above" >
<button class="adding-formula-btn" disabled>Add to query</button>
...
...
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