Version 1.2 ()
------------------------------------------------------------------------
+ * Improve Livesearch-Plugin to abort search on outside-of-box
+ click, fetch proper "not found" message on zero results
+ (Lars Strojny)
+
+ * Change bbCode plugin to use "white-space: pre". Thanks to jtb!
+
* Moved drag+drop and YahooUI library into templates/default/ to
be used in shared installation environments (garvinhicking)
document.getElementById('searchform').setAttribute('autocomplete','off');
document.getElementById('serendipityQuickSearchTermField').setAttribute('autocomplete','off');
}
- document.getElementById('serendipityQuickSearchTermField').style.border = '1px solid green';
+
+ document.onclick = liveSearchKeyPress
}
function liveSearchKeyPress(event) {
}
if (!isIE) { event.preventDefault(); }
}
- //ESC
- else if (event.keyCode == 27) {
+ //ESC or mouse click
+ else if (event.keyCode == 27 || (event.clientX)) {
highlight = document.getElementById("LSHighlight");
if (highlight) {
highlight.removeAttribute("id");
}
document.getElementById("LSResult").style.display = "none";
- } else {
+ } else {
liveSearchStart();
}
}
function liveSearchDoSearch() {
v = document.getElementById('serendipityQuickSearchTermField').value;
if (liveSearchLast != v && v.length > 3) {
- if (liveSearchReq && liveSearchReq.readyState < 4) {
+ if (liveSearchReq && liveSearchReq.readyState < 3) {
liveSearchReq.abort();
}
if (liveSearchReq.readyState == 4) {
var res = document.getElementById("LSResult");
res.style.display = "block";
- res.firstChild.innerHTML = liveSearchReq.responseText;
+ rawResult = liveSearchReq.responseText.replace(/<[^>]+>/g, '')
+ if (parseInt(rawResult) == 1) {
+ res.firstChild.innerHTML = notfoundtext
+ } else {
+ res.firstChild.innerHTML = liveSearchReq.responseText;
+ }
}
}
position: absolute;
margin-left: 4px;
margin-top: 4px;
+ background-color: #fff7e8;
}
#LSShadow {
}
#LSHighlight {
- background-color: #80FF80;
+ background-color: #bdd2ec;
color: black;
}
.serendipity_livesearch_row {
margin: 0px;
- line-height: 1.2em;
- padding-top: 0.2em;
- padding-bottom: 0.2em;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+ padding-left: 1.5em;
+ padding-right: 1.5em;
text-indent: -1em;
- padding-left: 1em;
- line-height: 1.2em;
- padding-right: 1em;
+ line-height: 1.4em;
}
.serendipity_livesearch_result {
position: relative;
bottom: 2px;
- right: 2px;
border: 1px solid black;
+ right: 2px;
padding: 2px;
}
<?php
echo '<script type="text/javascript">
lsbase = "' . $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'plugin/ls' . ($serendipity['rewrite'] == 'none' ? '_&' : '?') . '";
waittext = "' . PLUGIN_EVENT_LIVESEARCH_WAIT . '";
+ notfoundtext = "' . PLUGIN_EVENT_LIVESEARCH_NOTFOUND . '";
addLoadEvent(liveSearchInit);
</script>';
break;