-
Notifications
You must be signed in to change notification settings - Fork 0
Tami/boolean operators #10
base: master
Are you sure you want to change the base?
Changes from 3 commits
0ad5a22
9939561
02ecf21
7dd8fd2
a85102a
6a82ee5
7bf6241
dfdc314
bffc2d8
0788af3
6b90e92
fff0120
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -62,6 +62,44 @@ | |||||||||||||
}); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
window.changeText = () => { | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using global object Instead, create a local function function changeText() { ... } And add it using JS var buttons = document.getElementsByClassName('autocomplete-boolean-button');
for (var i = 0; i < buttons.length; i++) {
var button = buttons[i];
button.addEventListener('click', changeText);
} |
||||||||||||||
|
||||||||||||||
const newText = | ||||||||||||||
` | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not use ES2015+ syntax features, like arrow function, Use ES5 syntax. |
||||||||||||||
<div style="margin: 0.4em" class="row"> | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||
<span style="font-size: 10px" type="button" class="chip chip--outline chip--sm" data-toggle="tooltip" data-placement="bottom-right" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Change in every other |
||||||||||||||
data-tooltip ="Identifique as palavras ou termos que, obrigatoriamente, estejam na sua pesquisa. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this space in other elements too
Suggested change
|
||||||||||||||
Exemplo: Direitos E Humanos"> | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line breaks are ignored and collapsed when using like this. I think this is not possible 🤔 |
||||||||||||||
E | ||||||||||||||
</span> | ||||||||||||||
<span style="font-size: 10px" type="button" class="chip chip--outline chip--sm" data-toggle="tooltip" data-placement="bottom-right" | ||||||||||||||
data-tooltip ="Identifique palavras ou termos para obter resultados com pelo menos uma das palavras-chave especificadas. | ||||||||||||||
É possível utilizar parênteses para agrupar frases.Exemplo: (Dano moral) OU (Recurso Especial)" > | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
OU | ||||||||||||||
</span> | ||||||||||||||
<span style="font-size: 12px" type="button" class="chip chip--outline chip--sm" data-toggle="tooltip" data-placement="bottom-right" | ||||||||||||||
data-tooltip ="Nenhum dos resultados conterão o(s) termo(s)excludentes, indicados após o NÃO.Exemplo: (dano moral) NÃO material" > | ||||||||||||||
Não Incluir | ||||||||||||||
</span> | ||||||||||||||
<span style="font-size: 12px" type="button" class="chip chip--outline chip--sm" data-toggle="tooltip" data-placement="bottom-right" | ||||||||||||||
data-tooltip ="Os resultados conterão os termos na ordem exata e com a exata grafia indicada.Exemplo: princípio da presunção de inocência"> | ||||||||||||||
Exatamente | ||||||||||||||
</span> | ||||||||||||||
</div> ` | ||||||||||||||
|
||||||||||||||
document.getElementById('search').innerHTML = newText; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using
Suggested change
|
||||||||||||||
|
||||||||||||||
} | ||||||||||||||
var footerBooleanOperators = ` | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not use template string, for the same reason I said above. |
||||||||||||||
<hr style="margin: 0.4em"> | ||||||||||||||
<div id= "search" style="margin-left: 0.6em" > | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not use
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, all sizes using |
||||||||||||||
<button class="btn btn--flat btn--blue" style="font-size: 10px" onclick= "changeText()" > | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like I said above
Suggested change
|
||||||||||||||
DICAS PARA ESPECIFICAR SUA BUSCA | ||||||||||||||
</button> | ||||||||||||||
</div>` | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use 2 spaces for indentation level
Suggested change
|
||||||||||||||
|
||||||||||||||
|
||||||||||||||
var o = { | ||||||||||||||
selector: 0, | ||||||||||||||
source: 0, | ||||||||||||||
|
@@ -196,7 +234,7 @@ | |||||||||||||
if (data.length) { | ||||||||||||||
var s = ''; | ||||||||||||||
for (var i = 0; i < data.length; i++) s += o.renderItem(data[i], val, i); | ||||||||||||||
that.sc.innerHTML = s; | ||||||||||||||
that.sc.innerHTML = s + footerBooleanOperators; | ||||||||||||||
that.updateSC(0); | ||||||||||||||
} | ||||||||||||||
else | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't override mystique classes here, this will apply to all chips in the page, replacing the style everywhere.
Create a class for this purpose, like
autocomplete-chip
.