From 5214c9c09320e43f1f754b306be588028e9d1426 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sat, 22 Mar 2025 18:05:09 +0300 Subject: Auto-commit 2025-03-22 --- static/js/search.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 static/js/search.js (limited to 'static/js/search.js') diff --git a/static/js/search.js b/static/js/search.js deleted file mode 100644 index 62bcbbb..0000000 --- a/static/js/search.js +++ /dev/null @@ -1,27 +0,0 @@ -fetch('/index.json') - .then(response => response.json()) - .then(data => { - const fuse = new Fuse(data, { - keys: ['title', 'contents', 'tags'], - includeScore: true - }); - document.getElementById('search-input').addEventListener('input', function (e) { - const results = fuse.search(e.target.value); - displayResults(results); - }); - }); - -function displayResults(results) { - const searchResults = document.getElementById('search-results'); - searchResults.innerHTML = ''; - if (results.length > 0) { - searchResults.classList.remove("hidden"); - } else { - searchResults.classList.add("hidden"); - } - results.forEach(result => { - const elem = document.createElement('div'); - elem.innerHTML = `${result.item.title}