Fix formatting in search-data
This commit is contained in:
parent
df8d186d38
commit
424ff16092
5 changed files with 5 additions and 5 deletions
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
{"Target":"search-data.min.c533c453016d71fbd7fb228486a062cd64dfc3987b3d5c118b93c450abba2bc7.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-xTPEUwFtcfvX+yKEhqBizWTfw5h7PVwRi5PEUKu6K8c="}}
|
{"Target":"search-data.min.613ed83747ddaa2f75aeac976f9f2a6612611b9c9d57468f57147a9a5233a14a.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-YT7YN0fdqi91rqyXb58qZhJhG5ydV0aPVxR6mlIzoUo="}}
|
|
@ -1,4 +1,4 @@
|
||||||
(function(){const input=document.querySelector("#book-search-input");const results=document.querySelector("#book-search-results");input.addEventListener("focus",init);input.addEventListener("keyup",search);function init(){input.removeEventListener("focus",init);input.required=true;loadScript("/example/lunr.min.js");loadScript("/example/search-data.min.c533c453016d71fbd7fb228486a062cd64dfc3987b3d5c118b93c450abba2bc7.js",function(){input.readOnly=false;input.required=false;search();});}
|
(function(){const input=document.querySelector("#book-search-input");const results=document.querySelector("#book-search-results");input.addEventListener("focus",init);input.addEventListener("keyup",search);function init(){input.removeEventListener("focus",init);input.required=true;loadScript("/example/lunr.min.js");loadScript("/example/search-data.min.613ed83747ddaa2f75aeac976f9f2a6612611b9c9d57468f57147a9a5233a14a.js",function(){input.readOnly=false;input.required=false;search();});}
|
||||||
function search(){while(results.firstChild){results.removeChild(results.firstChild);}
|
function search(){while(results.firstChild){results.removeChild(results.firstChild);}
|
||||||
if(!input.value){return;}
|
if(!input.value){return;}
|
||||||
const terms=lunr.tokenizer(input.value);const searchHits=window.bookSearch.idx.query(function(query){query.term(terms,{boost:100});query.term(terms,{boost:10,wildcard:lunr.Query.wildcard.LEADING|lunr.Query.wildcard.TRAILING});query.term(terms,{editDistance:2});});searchHits.slice(0,10).forEach(function(hit){const page=window.bookSearch.pages[hit.ref];const li=document.createElement("li"),a=li.appendChild(document.createElement("a"));a.href=page.href;a.textContent=page.title;results.appendChild(li);});}
|
const terms=lunr.tokenizer(input.value);const searchHits=window.bookSearch.idx.query(function(query){query.term(terms,{boost:100});query.term(terms,{boost:10,wildcard:lunr.Query.wildcard.LEADING|lunr.Query.wildcard.TRAILING});query.term(terms,{editDistance:2});});searchHits.slice(0,10).forEach(function(hit){const page=window.bookSearch.pages[hit.ref];const li=document.createElement("li"),a=li.appendChild(document.createElement("a"));a.href=page.href;a.textContent=page.title;results.appendChild(li);});}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"Target":"search.min.edaedcc6b2019bf664c7f86c5194c481866cf4d4be6e95edab005a627efefda1.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-7a7cxrIBm/Zkx/hsUZTEgYZs9NS+bpXtqwBaYn7+/aE="}}
|
{"Target":"search.min.0447761fc68ec7ed1cdd2551765f48f51d0a1c93a5cd3775b1785b1a9fae79bc.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-BEd2H8aOx+0c3SVRdl9I9R0KHJOlzTd1sXhbGp+uebw="}}
|
Loading…
Reference in a new issue