diff --git a/handshakes-dl.py b/handshakes-dl.py index e1d0612..9d601ad 100644 --- a/handshakes-dl.py +++ b/handshakes-dl.py @@ -18,7 +18,43 @@ TEMPLATE = """ {{ title }} {% endblock %} +{% block styles %} + {{ super() }} + +{% endblock %} +{% block script %} + var shakeList = document.getElementById('list'); + var filter = document.getElementById('filter'); + var filterVal = filter.value.toUpperCase(); + + filter.onkeyup = function() { + document.body.style.cursor = 'progress'; + var table, tr, tds, td, i, txtValue; + filterVal = filter.value.toUpperCase(); + li = shakeList.getElementsByTagName("li"); + for (i = 0; i < li.length; i++) { + txtValue = li[i].textContent || li[i].innerText; + if (txtValue.toUpperCase().indexOf(filterVal) > -1) { + li[i].style.display = "list-item"; + } else { + li[i].style.display = "none"; + } + } + document.body.style.cursor = 'default'; + } + +{% endblock %} + {% block content %} +