()
| 450 | } |
| 451 | |
| 452 | function selectMatching() { |
| 453 | searchAlarm = null; |
| 454 | let re = null; |
| 455 | if (search.value != '') { |
| 456 | try { |
| 457 | re = new RegExp(search.value); |
| 458 | } catch (e) { |
| 459 | // TODO: Display error state in search box |
| 460 | return; |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | function match(text) { |
| 465 | return re != null && re.test(text); |
| 466 | } |
| 467 | |
| 468 | // drop currently selected items that do not match re. |
| 469 | selected.forEach(function(v, n) { |
| 470 | if (!match(nodes[n])) { |
| 471 | unselect(n); |
| 472 | } |
| 473 | }) |
| 474 | |
| 475 | // add matching items that are not currently selected. |
| 476 | if (nodes) { |
| 477 | for (let n = 0; n < nodes.length; n++) { |
| 478 | if (!selected.has(n) && match(nodes[n])) { |
| 479 | select(n); |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | updateButtons(); |
| 485 | } |
| 486 | |
| 487 | function toggleSvgSelect(elem) { |
| 488 | // Walk up to immediate child of graph0 |
nothing calls this directly
no test coverage detected
searching dependent graphs…