diff --git a/FHEM/01_FHEMWEB.pm b/FHEM/01_FHEMWEB.pm index 111bf9a01..bf46049a0 100755 --- a/FHEM/01_FHEMWEB.pm +++ b/FHEM/01_FHEMWEB.pm @@ -2220,6 +2220,7 @@ FW_iconTable($$$$) FW_addContent(); FW_pO "
"; + FW_pO "Filter: ".FW_textfieldv("icon-filter",20,"iconTable","")."
"; if($textfield) { FW_pO "$textfield: ".FW_textfieldv("data",20,"iconTable",".*")."
"; } diff --git a/www/pgm2/fhemweb.js b/www/pgm2/fhemweb.js index f877e6961..0ee041392 100644 --- a/www/pgm2/fhemweb.js +++ b/www/pgm2/fhemweb.js @@ -223,12 +223,32 @@ FW_jqueryReadyFn() }); }); + $("[name=icon-filter]").on("change keyup paste", function() { + clearTimeout($.data(this, 'delayTimer')); + var wait = setTimeout(FW_filterIcons, 300); + $(this).data('delayTimer', wait); + }); FW_smallScreenCommands(); FW_inlineModify(); FW_rawDef(); } +function +FW_filterIcons() +{ + var icons = $('.dist[title]'); + icons.show(); + + var filterText = $('[name=icon-filter]').val(); + if (filterText != '') { + var re = RegExp(filterText,"i"); + icons.filter(function() { + return !re.test(this.title); + }).hide(); + } +} + function FW_confirmDelete() {