summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Main.hs8
-rw-r--r--data/script.js13
-rw-r--r--data/style.css1
3 files changed, 20 insertions, 2 deletions
diff --git a/Main.hs b/Main.hs
index 8d65915..fd18465 100644
--- a/Main.hs
+++ b/Main.hs
@@ -160,10 +160,14 @@ introduction = section_ $ do
protocols :: Database -> Html ()
protocols db = section_ [id_ "protocols"] $ do
h2_ "Protocols"
- div_ [id_ "protosort"] $ do
+ div_ [id_ "protosort", class_ "form-inline"] $ do
+ label_ [for_ "filter"] "Filter"
+ " "
+ input_ [id_ "filter", type_ "text", class_ "form-control"]
+ " "
label_ [for_ "sort"] "Sort by"
" "
- select_ [id_ "sort"] $ do
+ select_ [id_ "sort", class_ "form-control"] $ do
option_ [value_ "name"] "Name"
option_ [value_ "year"] "Year"
forM_ (M.toList $ dalgos db) (protoentry db)
diff --git a/data/script.js b/data/script.js
index 94175b1..997a02e 100644
--- a/data/script.js
+++ b/data/script.js
@@ -18,5 +18,18 @@ $(document).ready (function () {
$('#sort').change (function () {
sortproto ($(this).val ());
});
+ $('#filter').keyup (function () {
+ var search = $(this).val ().toLowerCase ();
+ var items = $('#protocols .protocol');
+ for (var i = 0; i < items.length; i++) {
+ var e = $(items[i]);
+ if (e.data ('name').toLowerCase ().indexOf (search) >= 0) {
+ e.show ();
+ } else {
+ e.hide ();
+ }
+ }
+ });
+ $('#protosort').show ();
sortproto ('name');
});
diff --git a/data/style.css b/data/style.css
index cc65ba2..41b24dd 100644
--- a/data/style.css
+++ b/data/style.css
@@ -1,5 +1,6 @@
#protosort {
text-align: right;
+ display: hidden;
}
.protocol dt {