aboutsummaryrefslogtreecommitdiff
path: root/174bg/handbook/source/search.js
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2026-07-16 16:48:48 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2026-07-16 16:48:48 +0100
commit1768191b23e2ab224cb584f3301da66db75acdc9 (patch)
tree4a072e14e0301a5eaae878b5ab5980d3e442eebe /174bg/handbook/source/search.js
parentd723827b91cbe59a7ccbb12942172ed00cc2006e (diff)
downloadunnamed-group-1768191b23e2ab224cb584f3301da66db75acdc9.tar
unnamed-group-1768191b23e2ab224cb584f3301da66db75acdc9.tar.gz
unnamed-group-1768191b23e2ab224cb584f3301da66db75acdc9.tar.bz2
unnamed-group-1768191b23e2ab224cb584f3301da66db75acdc9.tar.xz
unnamed-group-1768191b23e2ab224cb584f3301da66db75acdc9.zip
replace handbook with vitepress
Diffstat (limited to '174bg/handbook/source/search.js')
-rw-r--r--174bg/handbook/source/search.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/174bg/handbook/source/search.js b/174bg/handbook/source/search.js
deleted file mode 100644
index d42337f..0000000
--- a/174bg/handbook/source/search.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * search.js
- *
- * Provides simple client-side filtering of the handbook's articles.
- *
- * How it works:
- * 1. Pressing the "/" key anywhere on the page focuses the search input
- * (id "search-input"), unless focus is already needed elsewhere.
- * 2. As the user types, every `<article>` in `<main>` is shown or hidden
- * based on whether its text content includes the (case-insensitive)
- * query string.
- */
-document.addEventListener("keypress", function (event) {
- if (event.key === "/") {
- const searchInput = document.getElementById("search-input");
- if (searchInput) {
- searchInput.focus();
- event.preventDefault();
- }
- }
-});
-
-document
- .querySelector("#search-input")
- .addEventListener("input", function (event) {
- const query = event.target.value.toLowerCase();
- const articles = document.querySelectorAll("main article");
- articles.forEach((article) => {
- const text = article.textContent.toLowerCase();
- if (text.includes(query)) {
- article.style.display = "";
- } else {
- article.style.display = "none";
- }
- });
- });