diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2020-01-20 17:13:28 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-01-31 15:07:06 +0100 |
commit | 71428219389d5fe429c0bad0bd31b2cda55cdfce (patch) | |
tree | 12a337a7ff55177cc2b4373b063c746310be2793 /core/src/main/resources/dokka/scripts | |
parent | c3b911f286186a790be607e9b803e3ed63c77289 (diff) | |
download | dokka-71428219389d5fe429c0bad0bd31b2cda55cdfce.tar.gz dokka-71428219389d5fe429c0bad0bd31b2cda55cdfce.tar.bz2 dokka-71428219389d5fe429c0bad0bd31b2cda55cdfce.zip |
Adding changes to HTML UI render
Diffstat (limited to 'core/src/main/resources/dokka/scripts')
-rw-r--r-- | core/src/main/resources/dokka/scripts/scripts.js | 11 | ||||
-rw-r--r-- | core/src/main/resources/dokka/scripts/search.js | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/core/src/main/resources/dokka/scripts/scripts.js b/core/src/main/resources/dokka/scripts/scripts.js new file mode 100644 index 00000000..c2e29b9f --- /dev/null +++ b/core/src/main/resources/dokka/scripts/scripts.js @@ -0,0 +1,11 @@ +document.getElementById("navigationFilter").oninput = function (e) { + var input = e.target.value; + var menuParts = document.getElementsByClassName("sideMenuPart") + for (let part of menuParts) { + if(part.querySelector("a").textContent.startsWith(input)) { + part.classList.remove("filtered"); + } else { + part.classList.add("filtered"); + } + } +}
\ No newline at end of file diff --git a/core/src/main/resources/dokka/scripts/search.js b/core/src/main/resources/dokka/scripts/search.js new file mode 100644 index 00000000..63112ac5 --- /dev/null +++ b/core/src/main/resources/dokka/scripts/search.js @@ -0,0 +1,5 @@ +var query = new URLSearchParams(window.location.search).get("query"); + document.getElementById("searchTitle").innerHTML += '"' + query + '":'; + document.getElementById("searchTable").innerHTML = pages.filter(el => el.name.startsWith(query)).reduce((acc, element) => { return acc + + '<tr><td><a href="' + element.location + '">' + element.name + '</a></td></tr>' + }, "");
\ No newline at end of file |