Skip to content

Commit 0b77d21

Browse files
add scenes search to app.html
1 parent bd02da6 commit 0b77d21

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -673,23 +673,22 @@
673673
.then(res => res.json())
674674
.then(scenesJson => {
675675
return s => {
676+
console.log("scenes.json");
676677
const maxResults = 12;
677678
if (s) {
678679
const regexps = s.split(/\s/).filter(s => !!s).map(s => new RegExp(escapeRegExp(s), 'i'));
679-
const sceneResults = [];
680+
const results = [];
680681
for (let i = 0; i < scenesJson.length; i++) {
681682
const site = scenesJson[i];
682683
if (regexps.some(regexp => regexp.test(site.label) || regexp.test(site.url))) {
683-
sceneResults.push(site);
684-
if (sceneResults.length >= maxResults) {
684+
results.push(site);
685+
if (results.length >= maxResults) {
685686
break;
686687
}
687688
}
688689
}
689-
console.log("scenes.json --- sceneResults = " + sceneResults);
690-
return sceneResults;
690+
return results;
691691
} else {
692-
console.log("scenes.json --- maxResults = " + maxResults);
693692
return scenesJson.slice(0, maxResults);
694693
}
695694
};

0 commit comments

Comments
 (0)