commit e6a1fe0054eaa705acdba12b4348b7d7d8ead91e
parent 08996e9dc96b7e56c3ca95a38b6a603251356955
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Fri, 18 Oct 2024 10:42:26 +0200
fix: add code comments; fix: avoid "search" term confusion
Diffstat:
M | index.php | | | 60 | +++++++++++++++++++++++++++++++++++++----------------------- |
1 file changed, 37 insertions(+), 23 deletions(-)
diff --git a/index.php b/index.php
@@ -177,19 +177,19 @@
<!-- Search Engine Searchbar -->
<input
- id="engines_searchbar"
+ id="engines_filterbar"
name="engines"
type="text"
- placeholder="Explore the available Search Engines..."
- oninput="search_engines('engines_searchbar');"
+ placeholder="Filter available Search Engines..."
+ oninput="filter_engines('engines_filterbar');"
>
<noscript>
<div class="notice">
<p>
- Exploring the available search engines with the search bar
+ Exploring the available search engines with the filter bar
above as well as choosing your default search engine
- requires javascript. However,
- <strong>using serĉi itself does not</strong>!
+ requires javascript.
+ <strong>However, using serĉi itself does not</strong>!
</p>
<p>
Read the <a href="#faqs">FAQs</a> on how to choose a default
@@ -201,54 +201,63 @@
<!-- Search Engine Category Buttons -->
<details id="categories">
<summary>Categories</summary>
+
<div class="row">
+
<!-- Always insert a "Default" category button -->
- <button onclick="search_for_category('Default');">
+ <button onclick="filter_category('Default');">
#Default
</button>
+
+ <!-- List all configured categories -->
<?php
foreach (array_keys($categories) as $catid) {
$cat_name = $categories[$catid]["name"];
?>
-
- <button
- onclick="search_for_category('<?php echo $cat_name; ?>');"
- >
+ <button onclick="filter_category('<?php echo $cat_name; ?>');">
<?php echo "#" . $cat_name; ?>
</button>
-
<?php
}
?>
+
</div>
+
</details>
<!-- Search Engine List -->
<?php
- foreach (array_keys($searches) as $searchid) {
- $search = $searches[$searchid];
+ foreach (array_keys($searches) as $sid) {
+ $search = $searches[$sid];
?>
<article
- <?php
- echo "id=\"" . $searchid . "\"";
- if ($searchid == $default_search) {
- echo " class=\"selected\"";
- }
- ?>
+ id="<?php echo $sid; ?>"
+ class="<?php if ($sid == $default_search) { echo "selected"; }?>"
>
+ <!-- Entry-Head -->
<h3>
<a href="<?php echo $search["website"]; ?>" target="_blank">
<?php echo $search["name"]; ?>
</a>
</h3>
+
+ <!-- Entry-Description -->
<p><?php echo $search["description"]; ?></p>
+
+ <!-- Entry-Categories -->
<div class="categories">
+
<?php
- if ($searchid == $default_search) {
+ /* If current entry is the default search, add the Mark */
+ if ($sid == $default_search) {
?>
<mark id="default_category">#Default</mark>
<?php
}
+ ?>
+
+ <?php
+ /* List all categories of current entry */
foreach ($search["categories"] as $catid) {
$cat_name = $categories[$catid]["name"];
?>
@@ -256,8 +265,10 @@
<?php
}
?>
+
</div>
- <br>
+
+ <!-- Entry-Keywords -->
<strong>Keywords: </strong>
<code>
<?php
@@ -269,9 +280,12 @@
?>
</code>
<br><br>
- <button onclick="make_default('<?php echo $searchid; ?>')">
+
+ <!-- "Make-Default" Button -->
+ <button onclick="make_default('<?php echo $sid; ?>')">
Choose as Default
</button>
+
</article>
<?php
}