Add "building period" parameter

This commit is contained in:
2020-08-07 13:15:04 -05:00
parent 232784d215
commit 44df06bbfa
20 changed files with 963 additions and 427 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,7 @@ function displayResults (results) {
function doSearch () {
var query = document.getElementById('mkdocs-search-query').value;
if (query.length > 2) {
if (query.length > min_search_length) {
if (!window.Worker) {
displayResults(search(query));
} else {
@@ -73,6 +73,8 @@ function onWorkerMessage (e) {
} else if (e.data.results) {
var results = e.data.results;
displayResults(results);
} else if (e.data.config) {
min_search_length = e.data.config.min_search_length-1;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -58,6 +58,7 @@ function onScriptsLoaded () {
if (data.config && data.config.separator && data.config.separator.length) {
lunr.tokenizer.separator = new RegExp(data.config.separator);
}
if (data.index) {
index = lunr.Index.load(data.index);
data.docs.forEach(function (doc) {
@@ -84,6 +85,7 @@ function onScriptsLoaded () {
console.log('Lunr index built, search ready');
}
allowSearch = true;
postMessage({config: data.config});
postMessage({allowSearch: allowSearch});
}