diff --git a/spike/review/reinvent/ezmded/ui/index.html b/spike/review/reinvent/ezmded/ui/index.html index a1dbb93..b9087a4 100644 --- a/spike/review/reinvent/ezmded/ui/index.html +++ b/spike/review/reinvent/ezmded/ui/index.html @@ -42,10 +42,10 @@ function init() { drawTree() setInterval(drawTree, 100000) - navigateToQueryParams() + navigateToQueryParams() } - function navigateToQueryParams() { + function navigateToQueryParams() { var queryF = getParameterByName("f") var queryQ = getParameterByName("q") console.log("init query f:", queryF, "q:", queryQ) @@ -54,7 +54,7 @@ } else if (queryQ && queryQ.length > 0) { searchFilesFor(queryQ) } - } + } function getParameterByName(name, url = window.location.href) { name = name.replace(/[\[\]]/g, '\\$&'); @@ -103,7 +103,7 @@ if (!results || results.length == 0) innerHTML = "no results" disableMDE() - navigateToQuery("q", q) + navigateToQuery("q", q) document.getElementById("searchResults").innerHTML = innerHTML }) } @@ -178,30 +178,30 @@ easyMDE.meta = { id: id, } - navigateToQuery("f", id) + navigateToQuery("f", id) } - var lastNavigateToQuery = new Date() + var lastNavigateToQuery = new Date() - function navigateToQuery(k, v) { - if (new Date() - lastNavigateToQuery < .1) - return - lastNavigateToQuery = new Date() - const url = new URL(window.location) - url.searchParams.set(k, v) - var hash = "#?" - const it = url.searchParams.entries() - let result = it.next() - while (!result.done) { - hash = hash + result.value[0] + "=" + result.value[1] + "&" - result = it.next() - } - window.location.hash = hash - } + function navigateToQuery(k, v) { + if (new Date() - lastNavigateToQuery < .1) + return + lastNavigateToQuery = new Date() + const url = new URL(window.location) + url.searchParams.set(k, v) + var hash = "#?" + const it = url.searchParams.entries() + let result = it.next() + while (!result.done) { + hash = hash + result.value[0] + "=" + result.value[1] + "&" + result = it.next() + } + window.location.hash = hash + } - window.onhashchange = () => { - navigateToQueryParams() - } + window.onhashchange = () => { + navigateToQueryParams() + } function drawTree() { function htmlifyBranch(id, branch) { @@ -281,7 +281,9 @@