| 400 | |
| 401 | /** Der Ansichts-Schalter, sein Rahmen und was jeder Chip gerade tut. */ |
| 402 | const viewToggle = (page) => |
| 403 | page.evaluate(() => { |
| 404 | const group = document.querySelector('[data-testid="atlas-graph-mode"]'); |
| 405 | if (group === null) { |
| 406 | return null; |
| 407 | } |
| 408 | const panel = document.querySelector('[data-testid="atlas-galaxy"]'); |
| 409 | const fold = document.querySelector('[data-testid="atlas-galaxy-collapse"]'); |
| 410 | return { |
| 411 | role: group.getAttribute('role') ?? '', |
| 412 | groupOpen: group.getAttribute('data-open') ?? '', |
| 413 | visible: panel?.getAttribute('data-visible') ?? '', |
| 414 | mode: panel?.getAttribute('data-mode') ?? '', |
| 415 | foldLabel: (fold?.textContent ?? '').replace(/\s+/g, ' ').trim(), |
| 416 | foldExpanded: fold?.getAttribute('aria-expanded') ?? '', |
| 417 | chips: [...group.querySelectorAll('[data-testid="atlas-graph-mode-chip"]')].map((chip) => ({ |
| 418 | mode: chip.getAttribute('data-mode') ?? '', |
| 419 | pressed: chip.getAttribute('aria-pressed') ?? '', |
| 420 | active: chip.getAttribute('data-active') === 'true', |
| 421 | action: chip.getAttribute('data-action') ?? '', |
| 422 | available: chip.getAttribute('data-available') === 'true', |
| 423 | ariaDisabled: chip.getAttribute('aria-disabled') ?? '', |
| 424 | hint: chip.getAttribute('data-hint') ?? '', |
| 425 | })), |
| 426 | }; |
| 427 | }); |
| 428 | |
| 429 | /** Der Satz unter dem Bild, so wie er dasteht. */ |
| 430 | const noteText = (page) => |