summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authordweller <dweller@cabin.digital>2024-02-27 20:48:15 +0200
committerdweller <dweller@cabin.digital>2024-02-27 20:48:15 +0200
commit2a66021e508fe2ff6912e6e6578eaf035e1ffdd8 (patch)
tree6a2066ac5a617ef3b02798e1e27d89d5368889fb /index.php
parentcd0894ddefbc9c0be2d59b9160fc911e16b67bd2 (diff)
add section and arch dropdowns, wow that was a pain
Diffstat (limited to 'index.php')
-rw-r--r--index.php42
1 files changed, 34 insertions, 8 deletions
diff --git a/index.php b/index.php
index c31c733..d83456b 100644
--- a/index.php
+++ b/index.php
@@ -23,6 +23,9 @@
<link rel="stylesheet" href="style/normalize.css"/>
<link rel="stylesheet" href="style/main.css"/>
+ <noscript>
+ <style>.jsonly{ display: none; }</style>
+ </noscript>
</head>
<body>
<div id="main">
@@ -50,13 +53,35 @@
<nav id="search_pane">
<form action="/search.php">
<div id="query_wrap">
- <div id="query_icon"></div>
- <input id="query" type='search' value='<?php if($action === 'lmmtfy') echo $query;?>' name='query' required autofocus/>
- <button id="def" type='submit' value='man' name='action' class="btn-def" aria-hidden="true" tabindex="-1"></button>
- <?php
- if($action === 'lmmtfy')
- echo '<input id="sect" type="hidden" value="' . $section . '" name= "section"/>';
- ?>
+ <div id="query_icon"></div>
+ <input id="query" type='search' value='<?php if($action === 'lmmtfy') echo $query;?>' name='query' required autofocus/>
+ <button id="def" type='submit' value='man' name='action' class="btn-def" aria-hidden="true" tabindex="-1"></button>
+ <span class="query_opt" title="section">-s</span>
+ <select id="sect" name='section' title="section" autocomplete="off">
+ <option value=""></option>
+ <?php
+ for($i = 1; $i <= 9; $i++)
+ {
+ $sel = "";
+ if((strlen($section) > 0) && ($section[0] == $i))
+ $sel = 'selected="selected"';
+ echo "<option value='$i' $sel>$i</option>";
+ }
+ ?>
+ </select>
+ <span class="query_opt" title="architecture">-S</span>
+ <select id="arch" name='arch' title="architecture" autocomplete="off">
+ <option value=""></option>
+ <?php
+ foreach($archs as $a)
+ {
+ $sel = "";
+ if((strlen($arch) > 0) && ($arch == $a))
+ $sel = 'selected="selected"';
+ echo "<option value='$a' $sel>$a</option>";
+ }
+ ?>
+ </select>
</div>
<div>
<button id="mank" type='submit' value='apropos' name='action' title="apropos(1)">man -k</button>
@@ -90,8 +115,9 @@
</section>
</nav>
</div>
+ <div id="js_tmp"></div>
</body>
-
+ <script src="js/query_opts.js"></script>
<?php
if($action === 'lmmtfy') echo '<script src="js/lmmtfy.js"></script>';
?>