Highlight message

This commit is contained in:
Denis Zheleztsov 2017-12-06 16:46:04 +03:00
parent 7797c57ed8
commit 67ecfef706
3 changed files with 27 additions and 5 deletions

View File

@ -15,15 +15,16 @@
#searchButton {
position: absolute;
font-size: 20pt;
left: 0;
left: 5px;
top: 14pt;
}
#searchInput {
display: none;
position: absolute;
left: 25pt;
top: 14pt;
left: 27pt;
top: 15pt;
width: 20%;
}
a, a:visited, a:active {
@ -79,7 +80,7 @@ body {
display: block;
font-size:0.7em;
position: absolute;
right: 10px;
right: 25px;
top: 17px;
}
@ -90,6 +91,17 @@ body {
word-wrap: break-word;
}
.hsMessage {
padding-right: 10px;
padding-left: 10px;
padding-bottom: 5px;
padding-top: 5px;
margin: 3em;
border: dotted;
border-width: 1px;
border-color: red;
}
select {
font-size: 1em;
margin: 80px 0 0;

View File

@ -24,7 +24,7 @@
<a href="lessmorefaq.html">FAQ</a>
<a href="stats.html">Статистика</a>
</div>
<a href="/" style="text-decoration: none; color: #babdb6;"><u>dynamic</u> | <u>less</u></a>
<a href="/" style="text-decoration: none; color: #c9c9c9;">dynamic | less</a>
</div>
<form><select id="echoSelector" multiple size="5"></select></form>

View File

@ -1,4 +1,5 @@
// Copyright 2016-2017 Sudnitsyna Anna lessmore.pw
// Copyright 2017 Denis Zheleztsov lessmore.pw
// Licensed under GPLv3
var html = '';
var options = '';
@ -202,6 +203,11 @@ function simpleTextSearch(text) {
function callback(messages) {
var msgArray = messages["hits"]["hits"];
console.log(msgArray);
if (msgArray.length == 1) {
console.log(msgArray.length);
html += '<div class="hsMessage">';
}
for (hit in msgArray) {
var msgItem = msgArray[hit]['_source'];
@ -219,6 +225,10 @@ function callback(messages) {
+ '</p><p align="right">'
+ '<a href="?' + msgItem['msgid'] +'" onclick="requestMessage(\'' + msgItem['msgid'] + '\');">#' + msgItem['msgid'] + '</a></p></div>';
}
if (msgArray.length == 1) {
html += '</div>';
console.log(html);
}
}
// Clenaup HTML and show messages