|
|
|
@ -1573,6 +1573,10 @@ lunr.TokenStore.prototype.expand = function (token, memo) {
|
|
|
|
|
|
|
|
|
|
return memo; |
|
|
|
|
} |
|
|
|
|
/*! |
|
|
|
|
* lunr.ratchetintegration |
|
|
|
|
* Copyright (C) 2013 Simon Waldherr |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
var searchindexes = new Array(); |
|
|
|
|
|
|
|
|
@ -1593,7 +1597,6 @@ function indexList(listid, searchid) {
|
|
|
|
|
if(typeof listeles[i].innerText !== 'undefined') { |
|
|
|
|
if(listeles[i].innerText.length > 2) { |
|
|
|
|
text = {"text" : listeles[i].innerText, "id" : i} |
|
|
|
|
//console.log(listeles[i].innerText);
|
|
|
|
|
searchindexes[lunrid].add(text); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1606,25 +1609,37 @@ function searchList(listid, searchid, searchstring) {
|
|
|
|
|
var lunrid = document.getElementById(searchid).getAttribute('data-lid'), |
|
|
|
|
listeles = document.getElementById(listid).getElementsByTagName('li'), |
|
|
|
|
found = searchindexes[lunrid].search(searchstring), |
|
|
|
|
foundbool; |
|
|
|
|
foundbool, score; |
|
|
|
|
|
|
|
|
|
for(var i = 0; i < listeles.length; i++) { |
|
|
|
|
foundbool = false; |
|
|
|
|
for(var j = 0; j < found.length; j++) { |
|
|
|
|
if(parseInt(found[j].ref) === i) { |
|
|
|
|
foundbool = true; |
|
|
|
|
if(searchstring.length > 1) { |
|
|
|
|
foundbool = false; |
|
|
|
|
score = 0; |
|
|
|
|
for(var j = 0; j < found.length; j++) { |
|
|
|
|
if(parseInt(found[j].ref) === i) { |
|
|
|
|
foundbool = true; |
|
|
|
|
score = found[j].score; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(listeles[i].hasAttribute('data-noindex') !== true) { |
|
|
|
|
if(foundbool) { |
|
|
|
|
listeles[i].style.backgroundColor = '#e1dac7'; |
|
|
|
|
//listeles[i].style.opacity = 1;
|
|
|
|
|
listeles[i].style.display = 'list-item'; |
|
|
|
|
} else { |
|
|
|
|
listeles[i].style.backgroundColor = '#f5bca3'; |
|
|
|
|
//listeles[i].style.opacity = 0.5;
|
|
|
|
|
listeles[i].style.display = 'none'; |
|
|
|
|
if(listeles[i].hasAttribute('data-noindex') !== true) { |
|
|
|
|
if(foundbool) { |
|
|
|
|
if(score > 0.3) { |
|
|
|
|
listeles[i].style.opacity = 1; |
|
|
|
|
} else { |
|
|
|
|
listeles[i].style.opacity = 0.5; |
|
|
|
|
} |
|
|
|
|
//listeles[i].style.backgroundColor = '#e1dac7';
|
|
|
|
|
//listeles[i].style.opacity = 1;
|
|
|
|
|
listeles[i].style.display = 'list-item'; |
|
|
|
|
} else { |
|
|
|
|
//listeles[i].style.backgroundColor = '#f5bca3';
|
|
|
|
|
//listeles[i].style.opacity = 0.5;
|
|
|
|
|
listeles[i].style.display = 'none'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
listeles[i].style.opacity = 1; |
|
|
|
|
listeles[i].style.display = 'list-item'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|