Commit 9b14c824 by Bence Dányi

firewall_gui: search is now case-insensitive

parent 177bbe91
...@@ -20,10 +20,11 @@ function range(a, b) { ...@@ -20,10 +20,11 @@ function range(a, b) {
} }
function matchAnything(obj, query) { function matchAnything(obj, query) {
var expr = new RegExp(query, 'i')
for(var i in obj) { for(var i in obj) {
var prop = obj[i]; var prop = obj[i];
if(typeof prop === 'number' && prop == query) return true; if(typeof prop === 'number' && prop == query) return true;
if(typeof prop === 'string' && prop.match(query)) return true; if(typeof prop === 'string' && prop.match(expr)) return true;
if(typeof prop === 'object' && matchAnything(prop, query)) return true; if(typeof prop === 'object' && matchAnything(prop, query)) return true;
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment