summaryrefslogtreecommitdiff
path: root/view/static
diff options
context:
space:
mode:
Diffstat (limited to 'view/static')
-rw-r--r--view/static/ceres.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/view/static/ceres.js b/view/static/ceres.js
index a6b5591..3bfeb6c 100644
--- a/view/static/ceres.js
+++ b/view/static/ceres.js
@@ -47,3 +47,21 @@ function del(url) {
console.error('Network error:', error);
});
}
+
+function filter() {
+ var input, query, ul, li, a, i, txtValue;
+ input = document.getElementById('search');
+ query = input.value.toUpperCase();
+ ul = document.getElementById("recipes");
+ li = ul.getElementsByTagName('li');
+
+ for (i = 0; i < li.length; i++) {
+ a = li[i].getElementsByTagName("a")[0];
+ txtValue = a.textContent || a.innerText;
+ if (txtValue.toUpperCase().indexOf(query) > -1) {
+ li[i].style.display = "";
+ } else {
+ li[i].style.display = "none";
+ }
+ }
+}