projects
/
web
/
firmware-selector-openwrt-org.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58353ee
)
ignore underscore, hyphen and dot in match
author
Moritz Warning
<moritzwarning@web.de>
Fri, 19 Jun 2020 14:19:13 +0000
(16:19 +0200)
committer
Moritz Warning
<moritzwarning@web.de>
Fri, 19 Jun 2020 14:19:13 +0000
(16:19 +0200)
www/index.js
patch
|
blob
|
history
diff --git
a/www/index.js
b/www/index.js
index 7562da4f1c1aa9e9ae5f376f7b2b8600dea3075c..e6082fb3564eebcd2c68b206068210be5d7cf23b 100644
(file)
--- a/
www/index.js
+++ b/
www/index.js
@@
-165,12
+165,17
@@
function setupAutocompleteList(input, items, as_list, onbegin, onend) {
// append the DIV element as a child of the autocomplete container:
this.parentNode.appendChild(list);
+ function normalize(s) {
+ return s.toUpperCase().replace(/[-_.]/g, ' ');
+ }
+
+ var match = normalize(value);
var c = 0;
for (var i = 0; i < items.length; i += 1) {
var item = items[i];
// match
- var j =
item.toUpperCase().indexOf(value.toUpperCase()
);
+ var j =
normalize(item).indexOf(match
);
if (j < 0) {
continue;
}