diff options
Diffstat (limited to 'lib/plugins/logviewer/script.js')
-rw-r--r-- | lib/plugins/logviewer/script.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/plugins/logviewer/script.js b/lib/plugins/logviewer/script.js index 5a5303c84..ebb9478b5 100644 --- a/lib/plugins/logviewer/script.js +++ b/lib/plugins/logviewer/script.js @@ -3,6 +3,23 @@ */ jQuery(function () { var $dl = jQuery('#plugin__logviewer').find('dl'); - if(!$dl.length) return; - $dl.animate({ scrollTop: $dl.prop("scrollHeight")}, 500); + if (!$dl.length) return; + $dl.animate({scrollTop: $dl.prop("scrollHeight")}, 500); + + + var $filter = jQuery('<input>'); + $filter.on('keyup', function (e) { + var re = new RegExp($filter.val(), 'i'); + + $dl.find('dt').each(function (idx, elem) { + if (elem.innerText.match(re)) { + jQuery(elem).removeClass('hidden'); + } else { + jQuery(elem).addClass('hidden'); + } + }); + }); + $dl.before($filter); + $filter.wrap('<label></label>'); + $filter.before(LANG.plugins.logviewer.filter + ' '); }); |