Search initial
This commit is contained in:
parent
98b021e27b
commit
3d12d99fdb
@ -3,13 +3,29 @@
|
|||||||
right: 0px;
|
right: 0px;
|
||||||
font-size: 20pt;
|
font-size: 20pt;
|
||||||
}
|
}
|
||||||
select {height: 50px}
|
select {
|
||||||
|
height: 50px
|
||||||
|
}
|
||||||
.msg {
|
.msg {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#searchButton {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 20pt;
|
||||||
|
left: 0;
|
||||||
|
top: 14pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchInput {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
left: 25pt;
|
||||||
|
top: 14pt;
|
||||||
|
}
|
||||||
|
|
||||||
a, a:visited, a:active {
|
a, a:visited, a:active {
|
||||||
color: #eeeeec;
|
color: #eeeeec;
|
||||||
text-decoration-style: dotted;
|
text-decoration-style: dotted;
|
||||||
|
@ -14,6 +14,9 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="lessmore">
|
<div class="lessmore">
|
||||||
|
<a id="searchButton" href="javascript:void(0)" onclick="showSearch()"><i class="fa fa-search"></i></a>
|
||||||
|
<input type="text" id="searchInput">
|
||||||
|
|
||||||
<a id="menu" href="javascript:void(0)" onclick="showMenu()"><i class="fa fa-bars"></i></a>
|
<a id="menu" href="javascript:void(0)" onclick="showMenu()"><i class="fa fa-bars"></i></a>
|
||||||
<div id="dropdown-content">
|
<div id="dropdown-content">
|
||||||
<a href="filter.html">Настроить фильтр</a>
|
<a href="filter.html">Настроить фильтр</a>
|
||||||
|
20
js/script.js
20
js/script.js
@ -42,8 +42,8 @@ $(function() {
|
|||||||
url: "https://dynamic.lessmore.pw/search",
|
url: "https://dynamic.lessmore.pw/search",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: '{"sort": [{ "date": { "order": "desc" }}, { "_score": { "order": "desc" }}],"aggs": {"my_fields": { "terms": { "field": "echo","size": 1000}}}}}',
|
data: '{"sort": [{ "date": { "order": "desc" }}, { "_score": { "order": "desc" }}],"aggs": {"my_fields": { "terms": { "field": "echo","size": 1000}}}}}',
|
||||||
success:function(messages){for (i in messages['aggregations']['my_fields']['buckets']){
|
success:function(messages) {
|
||||||
|
for (i in messages['aggregations']['my_fields']['buckets']) {
|
||||||
var msg = messages['aggregations']['my_fields']['buckets'][i]['key'];
|
var msg = messages['aggregations']['my_fields']['buckets'][i]['key'];
|
||||||
var doc_count = messages['aggregations']['my_fields']['buckets'][i]['doc_count'];
|
var doc_count = messages['aggregations']['my_fields']['buckets'][i]['doc_count'];
|
||||||
|
|
||||||
@ -96,10 +96,10 @@ $(function() {
|
|||||||
if (echo == "") requestEmptyEcho();
|
if (echo == "") requestEmptyEcho();
|
||||||
});
|
});
|
||||||
|
|
||||||
// $('#searchInput').on('change', function() {
|
$('#searchInput').on('change', function() {
|
||||||
// text = $(this).val();
|
text = $(this).val();
|
||||||
// simpleTextSearch(text);
|
simpleTextSearch(text);
|
||||||
// })
|
})
|
||||||
|
|
||||||
//scroll to show more messages
|
//scroll to show more messages
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
@ -289,6 +289,14 @@ function showMenu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showSearch() {
|
||||||
|
if ($("#searchInput").css("display") == "none") {
|
||||||
|
$("#searchInput").css("display","block");
|
||||||
|
} else {
|
||||||
|
$("#searchInput").css("display","none");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Parsing functions
|
// Parsing functions
|
||||||
function parseLocationHash() {
|
function parseLocationHash() {
|
||||||
|
Loading…
Reference in New Issue
Block a user