Search initial
This commit is contained in:
parent
98b021e27b
commit
3d12d99fdb
|
@ -3,13 +3,29 @@
|
|||
right: 0px;
|
||||
font-size: 20pt;
|
||||
}
|
||||
select {height: 50px}
|
||||
select {
|
||||
height: 50px
|
||||
}
|
||||
.msg {
|
||||
padding: 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 {
|
||||
color: #eeeeec;
|
||||
text-decoration-style: dotted;
|
||||
|
|
25
index.html
25
index.html
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<head>
|
||||
<title>dynamic|LESS</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.7">
|
||||
|
@ -10,10 +10,13 @@
|
|||
<script src="js/autolink.js"></Script>
|
||||
<!-- <script src="https://unpkg.com/vue"></script> -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
</head>
|
||||
<body>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="lessmore">
|
||||
<a id="searchButton" href="javascript:void(0)" onclick="showSearch()"><i class="fa fa-search"></i></a>
|
||||
<input type="text" id="searchInput">
|
||||
|
||||
<div class="lessmore">
|
||||
<a id="menu" href="javascript:void(0)" onclick="showMenu()"><i class="fa fa-bars"></i></a>
|
||||
<div id="dropdown-content">
|
||||
<a href="filter.html">Настроить фильтр</a>
|
||||
|
@ -22,16 +25,16 @@
|
|||
<a href="stats.html">Статистика</a>
|
||||
</div>
|
||||
<a href="/" style="text-decoration: none; color: #babdb6;"><u>dynamic</u> | <u>less</u></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form><select id="echoSelector" multiple size="5"></select></form>
|
||||
<div id="echoSelected"></div>
|
||||
<form><select id="echoSelector" multiple size="5"></select></form>
|
||||
<div id="echoSelected"></div>
|
||||
|
||||
<div id="mes"></div>
|
||||
<div id="mes"></div>
|
||||
|
||||
<div id="preloader" align="center">
|
||||
<div id="preloader" align="center">
|
||||
<img src="/img/preload.gif" onclick="showMore()" height="20em">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
22
js/script.js
22
js/script.js
|
@ -41,9 +41,9 @@ $(function() {
|
|||
$.ajax({
|
||||
url: "https://dynamic.lessmore.pw/search",
|
||||
type: "POST",
|
||||
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']){
|
||||
|
||||
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']) {
|
||||
var msg = messages['aggregations']['my_fields']['buckets'][i]['key'];
|
||||
var doc_count = messages['aggregations']['my_fields']['buckets'][i]['doc_count'];
|
||||
|
||||
|
@ -96,10 +96,10 @@ $(function() {
|
|||
if (echo == "") requestEmptyEcho();
|
||||
});
|
||||
|
||||
// $('#searchInput').on('change', function() {
|
||||
// text = $(this).val();
|
||||
// simpleTextSearch(text);
|
||||
// })
|
||||
$('#searchInput').on('change', function() {
|
||||
text = $(this).val();
|
||||
simpleTextSearch(text);
|
||||
})
|
||||
|
||||
//scroll to show more messages
|
||||
$(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
|
||||
function parseLocationHash() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user