From 1d73115c33cf542918675bf2b61d8faf10cbeb8a Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 24 Aug 2013 14:46:38 +0000 Subject: [PATCH] search box for the notificatons [close #563] --- public/script.js | 12 ++++++++++++ public/styles.css | 1 + views/report/notifies.jade | 6 ++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 9b852a5..5b2e06e 100644 --- a/public/script.js +++ b/public/script.js @@ -7,3 +7,15 @@ function search(q) quotes[i].className = quotes[i].innerHTML.indexOf(q) == -1 ? 'quotes hidden' : 'quotes'; } } + +function searchNotifies(q) { + var notifies = document.getElementById('notifies'); + for (var i=1, row; row=notifies.rows[i]; i++) { + console.log(row); + if(row.cells[3].innerHTML.indexOf(q) == -1) { + row.style.display = 'none'; + } else { + row.style.display = ''; + } + } +} diff --git a/public/styles.css b/public/styles.css index 2dc68a7..c3e5e1a 100644 --- a/public/styles.css +++ b/public/styles.css @@ -64,6 +64,7 @@ div#main { div#controls { width: 100%; + padding: 10px; } input { diff --git a/views/report/notifies.jade b/views/report/notifies.jade index b88119e..71d2763 100644 --- a/views/report/notifies.jade +++ b/views/report/notifies.jade @@ -4,8 +4,10 @@ block content div#backlink a(href='/notify/'+server) « Server Channels p - div#profile_datatable - table.table.table-hover.data + div#controls + input(type="text", name="search", id="search-text", oninput="searchNotifies(this.value)") + div#notify_datatable + table.table.table-hover.data#notifies thead tr th Date