diff --git a/css/style.css b/css/style.css index 2daeaa6..c18a2ef 100644 --- a/css/style.css +++ b/css/style.css @@ -1,84 +1,100 @@ @media screen and (max-width: 600px){ - .lessmore { - right: 0px; - font-size: 20pt; - } - select {height: 50px} - .msg { - padding: 0; - margin: 0; - } + .lessmore { + right: 0px; + font-size: 20pt; + } + 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; + color: #eeeeec; + text-decoration-style: dotted; } body { - background-color: #2E3436; - color: #eeeeec; - font: normal 1em Arial, sans-serif; - //font-family: "Arial", sans-serif; - //font-size: 1em; + background-color: #2E3436; + color: #eeeeec; + font: normal 1em Arial, sans-serif; + //font-family: "Arial", sans-serif; + //font-size: 1em; } #dropdown-content { - background-color:#2E3436; - display: none; - font-size: 0.5em; - position:absolute; - right: 0; - top: 70px; - width: 300px; - //z-index:1; + background-color:#2E3436; + display: none; + font-size: 0.5em; + position:absolute; + right: 0; + top: 70px; + width: 300px; + //z-index:1; } #dropdown-content>a { - border:1px solid #eeeeec; - display: block; - padding: 10px + border:1px solid #eeeeec; + display: block; + padding: 10px } #faq { - margin: 80px 0 0; + margin: 80px 0 0; } .lessmore { - background-color: #2E3436; - border-bottom: none; - color: #babdb6; - display: block; - font-size: 40pt; - height:70px; - position:fixed; - text-align: center; - text-decoration: none; - top: 0px; - margin-bottom: 5pt; - width:100%; + background-color: #2E3436; + border-bottom: none; + color: #babdb6; + display: block; + font-size: 40pt; + height:70px; + position:fixed; + text-align: center; + text-decoration: none; + top: 0px; + margin-bottom: 5pt; + width:100%; } #menu { - display: block; - font-size:0.7em; - position: absolute; - right: 10px; - top: 17px; + display: block; + font-size:0.7em; + position: absolute; + right: 10px; + top: 17px; } .msg { - background-color:#272C2D; - display: block; margin: 1em 0; - padding: 1.5em 3em 1.5em; - word-wrap: break-word; + background-color:#272C2D; + display: block; margin: 1em 0; + padding: 1.5em 3em 1.5em; + word-wrap: break-word; } - + select { - font-size: 1em; - margin: 80px 0 0; - padding:9px 0; - width: 100%; + font-size: 1em; + margin: 80px 0 0; + padding:9px 0; + width: 100%; } diff --git a/index.html b/index.html index 6a4e7d5..cd04db1 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ - + dynamic|LESS @@ -10,28 +10,31 @@ - - + + -
- - -
-
+
+
-
+
-
- -
+
+ +
- + diff --git a/js/script.js b/js/script.js index d90ae23..aaf22f5 100644 --- a/js/script.js +++ b/js/script.js @@ -41,31 +41,31 @@ $(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']){ - - var msg = messages['aggregations']['my_fields']['buckets'][i]['key']; - var doc_count = messages['aggregations']['my_fields']['buckets'][i]['doc_count']; + 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']; - msg_test = msg + " "; - echo_test = echo + " "; - if((echo_test).indexOf(msg_test) > -1 && echo != '') { - options += '"; - checks += ' ('+ doc_count - + ')
'; - } else { - options += '"; - checks += ' ('+ doc_count - + ')
';} - } + msg_test = msg + " "; + echo_test = echo + " "; + if((echo_test).indexOf(msg_test) > -1 && echo != '') { + options += '"; + checks += ' ('+ doc_count + + ')
'; + } else { + options += '"; + checks += ' ('+ doc_count + + ')
';} + } - $('#echoSelected').html("Выбранные эхи: " + document.cookie); - $('#echoSelector').html(options); - $('#echoCheckBox').html(checks);} + $('#echoSelected').html("Выбранные эхи: " + document.cookie); + $('#echoSelector').html(options); + $('#echoCheckBox').html(checks);} }) $('.echoes:checked').each(function() { @@ -96,11 +96,11 @@ $(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() { hash = parseLocationHash(); @@ -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() {