pub / serci

Search the web with !keywords
git clone https://https://src.jayvii.de/pub/serci.git
Home | Log | Files | Exports | Refs | README | RSS

commit 0e6c1bb29eff9923767ddad9e6c14275e96b8a74
parent e2dcfb7465ec912dfbc0d99b51a3aa73bf0e1489
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Fri, 18 Oct 2024 11:55:15 +0200

fixup! fix: add code comments; fix: avoid "search" term confusion

Diffstat:
Massets/js/filter_engines.js | 18+++++++++---------
Mindex.php | 2+-
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/assets/js/filter_engines.js b/assets/js/filter_engines.js @@ -9,7 +9,7 @@ make_default = function(selection) { "SameSite=Strict;"; // Set value in searchbar - document.getElementById("default_search").value = selection; + document.querySelector("input[name=default_search]").value = selection; // Gather Entries of Search Engines list var entries = document.querySelectorAll("article"); @@ -36,17 +36,17 @@ make_default = function(selection) { } -/* Script to search through the list of search engines ---------------------- */ +/* Script to filter through the list of search engines ---------------------- */ -search_engines = function(bar) { +filter_engines = function(bar) { - // Get text from search bar + // Get text from filter bar var pat = document.getElementById(bar).value.toLowerCase(); // Gather article objects that contain the search engines var entries = document.querySelectorAll("article"); - // Compare text in article objects with text in search bar + // Compare text in article objects with text in filter bar // Mark those hidden that do not match for (let i = 0; i < entries.length; i++) { if (entries[i].innerText.toLowerCase().match(pat) === null) { @@ -60,16 +60,16 @@ search_engines = function(bar) { /* Script to search through search engines via category buttons ------------- */ -search_for_category = function(category) { +filter_category = function(category) { - // Insert category name into category-searchbar - document.getElementById("engines_searchbar").value = "#" + category; + // Insert category name into category-filterbar + document.getElementById("engines_filterbar").value = "#" + category; // collapse category summary document.getElementById("categories").open = false; // filter through search engines list - search_engines("engines_searchbar"); + filter_engines("engines_filterbar"); // Scroll back to search bar setTimeout(function() { document.location = "#engines"; }, 10); diff --git a/index.php b/index.php @@ -175,7 +175,7 @@ <mark><?php echo count($searchkeys); ?> keywords</mark>. </p> - <!-- Search Engine Searchbar --> + <!-- Search Engine Filterbar --> <input id="engines_filterbar" name="engines"