(pres, spans)
| 312 | |
| 313 | // return the <span>'s in #command that are linked to each <pre> in pres |
| 314 | function optionsselector(pres, spans) { |
| 315 | const ids = pres.map(function () { |
| 316 | return this.id; |
| 317 | }); |
| 318 | |
| 319 | const s = $('#command span.unknown'); |
| 320 | const r = Array.from(ids).reduce( |
| 321 | (s, id) => s.add(`#command span[helpref^=${id}]`), |
| 322 | s, |
| 323 | ); |
| 324 | |
| 325 | if (typeof spans === 'object') { |
| 326 | return r.filter(spans); |
| 327 | } else { |
| 328 | return r; |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | // initialize the lines logic, deciding which group of elements should be displayed |
| 333 | // |
no test coverage detected