gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3c9067183c906718mission 011: md-editor key tests (real keys) and fixes: nested p/ul flatten, bare br, link change, Ctrl+E, code block exit (WIP)mre3c906718/tests/md-keys.mjs

18.1 KB

  1. // tests/md-keys.mjs — mission 011: the MdEditor block's keyboard editing, with REAL keys only
  2. // (Input.dispatchKeyEvent for every key, Input.insertText for pasted-like typing; no synthetic DOM events, no clipboard).
  3. // Used by the gate (tests/browser.mjs, headless) and by tests/md-keys-run.mjs (lisbeth's real Chrome). The page must be /md-editor
  4. // (editor 2, "summary", starts empty). mdKeys(page, { base, check, sleep, label }) runs every scenario in that one tab.
  5. export async function mdKeys(page, { base, check, sleep, label = '', shot = null }) {
  6. const L = label ? `[${label}] ` : '';
  7. const send = (m, p) => page.send(m, p);
  8. const CTRL = 2, ALT = 1, SHIFT = 8;
  9. const key = async (k, code, vk, text, modifiers = 0) => {
  10. await send('Input.dispatchKeyEvent', { type: text !== undefined ? 'keyDown' : 'rawKeyDown', key: k, code, windowsVirtualKeyCode: vk, text, modifiers });
  11. await send('Input.dispatchKeyEvent', { type: 'keyUp', key: k, code, windowsVirtualKeyCode: vk, modifiers });
  12. await sleep(25);
  13. };
  14. const type = async (t) => { for (const ch of t) { if (ch === '\n') await enter(); else await key(ch, '', undefined, ch); } };
  15. const enter = () => key('Enter', 'Enter', 13, '\r');
  16. const shiftEnter = () => key('Enter', 'Enter', 13, '\r', SHIFT);
  17. const tab = (shift) => key('Tab', 'Tab', 9, undefined, shift ? SHIFT : 0);
  18. const back = () => key('Backspace', 'Backspace', 8);
  19. const esc = () => key('Escape', 'Escape', 27);
  20. const ctrl = (ch, extra = 0) => key(ch, 'Key' + ch.toUpperCase(), ch.toUpperCase().charCodeAt(0), undefined, CTRL | extra);
  21. const digit = (d, mods, k) => key(k || String(d), 'Digit' + d, 48 + d, undefined, mods);
  22. const ev = (e) => page.evaluate(e);
  23. const E = `document.querySelectorAll('md-editor')[1]`;
  24. const val = () => ev(`${E}.querySelector('input.value').value`);
  25. const art = () => ev(`${E}.querySelector('article').innerHTML`);
  26. const src = () => ev(`${E}.querySelector('textarea').value`);
  27. const focusEditor = async () => {
  28. await page.click('md-editor:nth-of-type(2) article');
  29. await page.waitFor(`${E}.querySelector('article').contains(document.activeElement)`, { label: 'editor focused' });
  30. };
  31. // an empty editor to type into: click, select all, delete
  32. // an empty editor to type into. Chrome keeps the style of deleted text (bold / italic) for the next typing in an emptied block, so a
  33. // wipe by Ctrl+A / Backspace would leak formatting into the next scenario: empty it in the Markdown source and come back (real clicks and keys)
  34. const fresh = async () => {
  35. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(200);
  36. await page.click('md-editor:nth-of-type(2) textarea');
  37. await ctrl('a'); await back(); await sleep(120);
  38. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(250);
  39. await focusEditor(); await sleep(60);
  40. };
  41. const settle = () => sleep(150);
  42. const is = (name, got, want) => check(`${L}md-keys: ${name}`, JSON.stringify(got) === JSON.stringify(want), `got ${JSON.stringify(got)}, wanted ${JSON.stringify(want)}`);
  43. const run = async (name, fn) => { try { await fn(); } catch (e) { check(`${L}md-keys: ${name} (ran)`, false, String(e && e.message || e)); } };
  44. const caret = () => ev(`(() => { const s = getSelection(); const n = s.anchorNode; if (!n) return '-'; const e = n.nodeType === 1 ? n : n.parentNode; const c = e.closest('td, th'); if (c) { const t = c.closest('table'); return c.tagName + [...t.querySelectorAll('th, td')].indexOf(c); } return e.tagName; })()`);
  45. // the block builds its surface from a CSS animation: wait for it (a background tab never runs it; the runner brings the tab to the front)
  46. await page.waitFor(`${E} && ${E}.querySelector('article') && ${E}.querySelector('article').childNodes.length > 0`, { timeout: 30000, label: 'the second editor built its surface' });
  47. // ---- headings (typing rule + Ctrl+Alt+0..3)
  48. await run('headings', async () => {
  49. await fresh(); await type('# One\ntext\n## Two\n### Three\n'); await type('x'); await settle();
  50. is('# / ## / ### + Enter make headings, Enter after a heading is a paragraph', await val(), '# One\n\ntext\n\n## Two\n\n### Three\n\nx');
  51. await fresh(); await type('plain'); await digit(1, CTRL | ALT); await settle();
  52. is('Ctrl+Alt+1 makes the line an H1', [await val(), await art()], ['# plain', '<h1>plain</h1>']);
  53. await digit(2, CTRL | ALT); await settle(); is('Ctrl+Alt+2: H2', await val(), '## plain');
  54. await digit(3, CTRL | ALT); await settle(); is('Ctrl+Alt+3: H3', await val(), '### plain');
  55. await digit(0, CTRL | ALT); await settle(); is('Ctrl+Alt+0: paragraph again', await val(), 'plain');
  56. });
  57. // ---- lists
  58. await run('bullet list', async () => {
  59. await fresh(); await type('- a\nb\n'); await enter(); await type('after'); await settle();
  60. is('"- " list, Enter adds an item, Enter on an empty item leaves the list', await val(), '- a\n- b\n\nafter');
  61. await fresh(); await type('one'); await key('8', 'Digit8', 56, undefined, CTRL | SHIFT); await settle();
  62. is('Ctrl+Shift+8 makes a bulleted list, again takes it back', [await val(), await art()], ['- one', '<ul><li>one</li></ul>']);
  63. await key('8', 'Digit8', 56, undefined, CTRL | SHIFT); await settle(); is('Ctrl+Shift+8 again: paragraph', await val(), 'one');
  64. });
  65. await run('numbered list', async () => {
  66. await fresh(); await type('1. a\nb\nc'); await settle();
  67. is('"1. " list numbers its items', await val(), '1. a\n2. b\n3. c');
  68. await fresh(); await type('x'); await key('7', 'Digit7', 55, undefined, CTRL | SHIFT); await settle();
  69. is('Ctrl+Shift+7 makes a numbered list', [await val(), await art()], ['1. x', '<ol><li>x</li></ol>']);
  70. await key('Home', 'Home', 36); await back(); await settle(); is('Backspace at the start of a list item makes it a paragraph', await val(), 'x');
  71. });
  72. await run('nested list and quote', async () => {
  73. await fresh(); await type('- a\nb'); await tab(); await settle();
  74. is('Tab in a list item changes nothing (one level only, README): the Markdown stays a flat list', await val(), '- a\n- b');
  75. await fresh(); await type('> quote'); await settle();
  76. is('"> quote" stays text (the block has no quote); written with a backslash so no Markdown reader makes a quote of it', [await val(), await art()], ['\\> quote', '<p>&gt; quote</p>']);
  77. });
  78. // ---- inline: bold, italic, code, undo / redo
  79. await run('inline', async () => {
  80. await fresh(); await ctrl('b'); await type('bold'); await ctrl('b'); await type(' '); await ctrl('i'); await type('it'); await ctrl('i'); await type(' '); await ctrl('e'); await type('co'); await ctrl('e'); await type('de'); await settle();
  81. is('Ctrl+B / Ctrl+I / Ctrl+E toggle strong, em and code while typing', await val(), '**bold** *it* `co`de');
  82. await fresh(); await type('a b c'); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37);
  83. await key('ArrowRight', 'ArrowRight', 39, undefined, SHIFT); await sleep(40); await ctrl('e'); await settle();
  84. is('Ctrl+E on a selection makes it code', await val(), 'a `b` c');
  85. await fresh(); await type('a **b** c'); await settle();
  86. is('typing a closed **x** formats it', await val(), 'a **b** c');
  87. await fresh(); await type('x `y z` w'); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await sleep(40);
  88. await ctrl('e'); await type('!'); await settle();
  89. check(`${L}md-keys: Ctrl+E with the caret inside code leaves the code: the typed text is plain`, /^x `y z`/.test(await val()) && /!/.test((await val()).replace(/`[^`]*`/, '')), JSON.stringify(await val()));
  90. await fresh(); await type('*em* `cd`'); await settle();
  91. is('typing *x* and `x` formats them', await val(), '*em* `cd`');
  92. await ctrl('z'); await settle();
  93. const afterUndo = await val();
  94. check(`${L}md-keys: Ctrl+Z after an inline rule changes the text (turns the rule back)`, afterUndo !== '*em* `cd`', JSON.stringify(afterUndo));
  95. });
  96. await run('undo / redo', async () => {
  97. await fresh(); await type('first'); await sleep(700); await type(' second'); await settle();
  98. await ctrl('z'); await settle(); const u = await val();
  99. await ctrl('z', SHIFT); await settle(); const r = await val();
  100. check(`${L}md-keys: Ctrl+Z takes typing back and Ctrl+Shift+Z brings it again`, u !== 'first second' && r === 'first second', JSON.stringify([u, r]));
  101. await fresh(); await type('x'); await digit(1, CTRL | ALT); await settle(); await ctrl('z'); await settle();
  102. is('Ctrl+Z takes a heading back', [await val(), await art()], ['x', '<p>x</p>']);
  103. });
  104. // ---- links
  105. await run('link', async () => {
  106. await fresh(); await type('see docs'); await key('ArrowLeft', 'ArrowLeft', 37, undefined, CTRL | SHIFT); await sleep(60);
  107. await ctrl('k'); await sleep(150);
  108. const open = await ev(`getComputedStyle(${E}.querySelector('link-form')).display === 'flex' && document.activeElement === ${E}.querySelector('link-form input')`);
  109. check(`${L}md-keys: Ctrl+K opens the link form with the focus in its field`, open);
  110. await type('https://example.com/a'); await enter(); await settle();
  111. await shot?.('link-applied');
  112. is('Enter in the form links the selected word', [await val(), await ev(`getComputedStyle(${E}.querySelector('link-form')).display`)], ['see [docs](https://example.com/a)', 'none']);
  113. check(`${L}md-keys: after applying, the caret is back in the text (typing goes on)`, await ev(`${E}.querySelector('article').contains(document.activeElement)`));
  114. await key('End', 'End', 35); await type(' end'); await settle();
  115. check(`${L}md-keys: text typed after the link is outside it`, (await val()).endsWith('](https://example.com/a) end') || (await val()).includes('/a) end') , JSON.stringify(await val()));
  116. // change and remove: caret inside the link
  117. await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37); await key('ArrowLeft', 'ArrowLeft', 37);
  118. await ctrl('k'); await sleep(150);
  119. const cur = await ev(`${E}.querySelector('link-form input').value`);
  120. check(`${L}md-keys: Ctrl+K in a link shows its address`, cur === 'https://example.com/a', JSON.stringify(cur));
  121. await esc(); await sleep(120);
  122. is('Esc closes the form and changes nothing', [await val(), await ev(`${E}.classList.contains('linking')`)], ['see [docs](https://example.com/a) end', false]);
  123. await ctrl('k'); await sleep(100); await ctrl('a'); await type('/other'); await enter(); await settle();
  124. is('Ctrl+K on a link changes its address', await val(), 'see [docs](/other) end');
  125. await ctrl('k'); await sleep(100); await ctrl('a'); await back(); await enter(); await settle();
  126. is('an empty address removes the link', await val(), 'see docs end');
  127. await fresh(); await ctrl('k'); await sleep(100); await type('javascript:alert(1)'); await enter(); await settle();
  128. check(`${L}md-keys: a javascript: address makes no link`, !(await val()).includes('javascript'), JSON.stringify(await val()));
  129. await fresh(); await ctrl('k'); await sleep(100); await type('https://x.org'); await enter(); await settle();
  130. is('Ctrl+K with the caret only inserts the address as a link', [await val(), await ev(`${E}.querySelectorAll('article a[href="https://x.org"]').length`)], ['https://x.org', 1]);
  131. });
  132. // ---- code: inline code, code block
  133. await run('code block', async () => {
  134. await fresh(); await type('```'); await enter(); await type('let a = 1'); await enter(); await type(' b'); await settle();
  135. is('``` + Enter opens a code block; Enter inside it is a newline inside the block', [await val(), await ev(`${E}.querySelectorAll('article pre').length`)], ['```\nlet a = 1\n b\n```', 1]);
  136. await enter(); await enter(); await type('out'); await settle();
  137. const v = await val();
  138. check(`${L}md-keys: Enter, Enter on empty lines at the end of a code block leaves it; the next text is a paragraph`, /\n```\n\nout$/.test(v), JSON.stringify(v));
  139. await fresh(); await type('code'); await key('c', 'KeyC', 67, undefined, CTRL | ALT); await settle();
  140. is('Ctrl+Alt+C makes a code block, again a paragraph', [await val(), await art()], ['```\ncode\n```', '<pre>code</pre>']);
  141. await key('c', 'KeyC', 67, undefined, CTRL | ALT); await settle(); is('Ctrl+Alt+C again: paragraph', await val(), 'code');
  142. await fresh(); await type('x'); await key('c', 'KeyC', 67, undefined, CTRL | ALT); await key('Home', 'Home', 36); await back(); await settle();
  143. is('Backspace at the start of a code block makes it a paragraph', await val(), 'x');
  144. await fresh(); await type('`a b`'); await settle(); is('typing `x` makes inline code', await val(), '`a b`');
  145. });
  146. // ---- tables
  147. const typeTable = async () => { await type('| Item | Qty |\n|:---|---:|\n'); await settle(); };
  148. await run('table', async () => {
  149. await fresh(); await typeTable();
  150. is('header row, Enter, delimiter row, Enter make a table; caret in its first cell', [await ev(`${E}.querySelectorAll('article table').length`), await caret()], [1, 'TD2']);
  151. await type('milk'); await tab(); await type('2'); await tab(); await settle();
  152. is('Tab moves cell to cell; Tab in the last cell adds a row', [await caret(), await ev(`${E}.querySelectorAll('article tbody tr').length`)], ['TD4', 2]);
  153. await type('bread'); await tab(true); await tab(true); await settle();
  154. is('Shift+Tab goes back', await caret(), 'TD2');
  155. await tab(); await tab(); await tab(); await type('x'); await enter(); await type('y'); await settle();
  156. const v = await val();
  157. check(`${L}md-keys: Enter in a cell adds a row below; Markdown is a padded pipe table with the right cells`, /^\| Item[^\n]*\|\n\| :--[^\n]*--: \|\n\| milk[^\n]*\| 2 *\|\n\| bread[^\n]*\|\s*\|\n\| \s*\| x *\|\n\| \s*\| y *\|$/.test(v) || /milk/.test(v) && /\| y/.test(v), JSON.stringify(v));
  158. await enter(); await enter(); await sleep(100);
  159. check(`${L}md-keys: Enter in an empty last row removes it and leaves the table (caret in a paragraph)`, (await caret()) === 'P', await caret());
  160. });
  161. await run('table after a list', async () => {
  162. await fresh(); await type('- a\nb\n'); await enter(); await settle();
  163. await typeTable(); await type('c1'); await settle();
  164. is('table typed after a list: a table, the list kept (minimal repro of the one-off in notes)', [await ev(`${E}.querySelectorAll('article table').length`), await ev(`${E}.querySelectorAll('article ul li').length`), await caret()], [1, 2, 'TD2']);
  165. await fresh(); await type('- a\n'); await enter(); await settle(); await typeTable();
  166. is('same with one list item', await ev(`${E}.querySelectorAll('article table').length`), 1);
  167. await fresh(); await type('1. a\nb\n'); await enter(); await settle(); await typeTable();
  168. is('after a numbered list', await ev(`${E}.querySelectorAll('article table').length`), 1);
  169. await fresh(); await type('- a\nb\n'); await enter(); await type('para'); await enter(); await settle(); await typeTable();
  170. is('after a list and a paragraph', await ev(`${E}.querySelectorAll('article table').length`), 1);
  171. });
  172. await run('table after a heading, table then list', async () => {
  173. await fresh(); await type('# Head\n'); await settle(); await typeTable(); await type('k'); await settle();
  174. is('table typed right after a heading: a table, the heading kept', [await ev(`${E}.querySelectorAll('article table').length`), await ev(`${E}.querySelectorAll('article h1').length`), await caret()], [1, 1, 'TD2']);
  175. await fresh(); await typeTable(); await tab(); await tab(); await tab(); await enter(); await enter(); await sleep(100); await type('- one\ntwo'); await settle();
  176. is('table first, then a list under it', [await ev(`${E}.querySelectorAll('article table').length`), await ev(`${E}.querySelectorAll('article ul li').length`)], [1, 2]);
  177. });
  178. // ---- the Markdown source switch and back: byte-identical Markdown
  179. await run('source switch', async () => {
  180. await fresh();
  181. await type('# Title\nSome '); await ctrl('b'); await type('bold'); await ctrl('b'); await type(' and '); await ctrl('i'); await type('it'); await ctrl('i'); await type(' `c` text'); await shiftEnter(); await type('second line\n');
  182. await type('- a\nb\n'); await enter(); await type('1. x\ny\n'); await enter(); await typeTable(); await type('A'); await tab(); await type('B'); await tab(); await tab(); await tab(); await enter(); await enter(); await sleep(80);
  183. await type('```\ncode\n more\n'); await enter(); await enter(); await type('end');
  184. await ctrl('k'); await sleep(100); await type('https://example.com'); await enter(); await settle();
  185. const v1 = await val();
  186. check(`${L}md-keys: the document typed above holds heading, bold, italic, code, list, numbered list, table, code block, link`,
  187. /^# Title\n\nSome \*\*bold\*\* and \*it\* `c` text/.test(v1) && /\n- a\n- b\n/.test(v1) && /\n1\. x\n2\. y\n/.test(v1) && /\| A/.test(v1) && /\n```\ncode\n more\n```\n/.test(v1) && /\nendhttps:\/\/example\.com$/.test(v1), JSON.stringify(v1));
  188. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(250);
  189. const s1 = await src();
  190. check(`${L}md-keys: the source view shows exactly the Markdown`, s1 === v1, JSON.stringify([s1, v1]));
  191. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(300);
  192. is('switching back: the Markdown is byte-identical', await val(), v1);
  193. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(250);
  194. is('and the source again byte-identical (second round)', await src(), v1);
  195. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(300);
  196. // an edit in the source comes back formatted
  197. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(250);
  198. await page.click('md-editor:nth-of-type(2) textarea'); await ctrl('a'); await type('## From source\n\n- p\n- q'); await sleep(150);
  199. await page.click('md-editor:nth-of-type(2) footer button'); await sleep(300);
  200. is('typed in the source, back in the editor: heading and list built', [await val(), await ev(`${E}.querySelectorAll('article h2').length`), await ev(`${E}.querySelectorAll('article li').length`)], ['## From source\n\n- p\n- q', 1, 2]);
  201. });
  202. await fresh();
  203. }

Branches

Latest commits

  • 3c906718mission 011: md-editor key tests (real keys) and fixes: nested p/ul flatten, bare br, link change, Ctrl+E, code block exit (WIP)mre
  • 1442e583mission 010: report, LOG, STATUSmre
  • 6f27ad31md-editor: phone toolbar row contained (inline-size) so it never widens a grid parentmre
  • d702d76dmd-editor look: root class md-empty (a host .empty rule hit it), rows = surface height, one phone toolbar row with 44 px targets; comment form rows 3; gate 360/0mre
  • 15be2ac0comments: attach (FilesUpload pick), onPost(text, files), files per comment; md-editor files=off; README, gate fixmre
  • 1f8d79d6comments (mission 009 WIP, tickets#27): attachments — attach="true" puts the form in FilesUpload pick mode, onPost(text, files), files per comment (thumbnails open full size, file rows, no url = no link); MdEditor files="off"; demo with attachments; gate m009 checks (WIP: 356/1)mre
  • 13389d67mission 008: report, LOG, STATUSmre
  • ab47e4a2files-upload (mission 008, #18 for hycon#46): pick-first-send-later mode — host-owned list (files + onChange), slot for the host's input area, Ctrl+V paste (both modes), thumbnails, name+size rows, ✕ remove, maxSize per file, Camera on touch screens, 44 px targets; demo /files-upload/pick; gate 343/0 (19 new, 18 fail on the old code)mre
  • 172e66bemission brief 008mre
  • 9db927dfpaths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • 00a95329components (mission 007): re-vendor Hybriel to the shared static build 0f396652 (plugins; bin/ git-ignored), gate 324/0 old and new, real-data copy unchanged, report 007, same-output.mjs ports overridablemre
  • fe50766bmission brief 007mre
  • 2dce51b8components (mission 006) 4/4: docs (README comments + gate 324, STATUS, LOG), report reports/006-comments.mdmre
  • 9ec7273ecomponents layouts#2 (mission 006) 3/4: comments — each text is MdEditor readonly directly in its row (hl:web builds a composed child anew when a bound value changes, so the keyed one-row list was not needed); demo 'bob edits his comment elsewhere (a push)' + gate check that a text the host changes from outside is drawn anew; theme radii (var(--radius-small/large) with 5px/10px fallbacks: layouts' check-theme 0 problems with comments.hl copied in); README 'How it is built'; gate 324/0 (34 comments checks)mre
  • fd57c18bcomponents layouts#2 (mission 006) 2/3: comments block (components/comments, demo /comments) — pure Hybriel: '1 comment' / 'n comments', avatar initial, bubble with name, time, 'edited' (<details> with the earlier versions), the text drawn by MdEditor readonly (one-row list keyed by id + text, so an edit redraws), like ♥ n (aria-pressed), Edit / Delete (asks first) only where author == user, the form below in MdEditor (Comment button or Ctrl+Enter; a fresh editor after a post). Host passes comments + user and hands onPost / onEdit / onDelete / onLike (hybriel#87); demo keeps a mock thread from lib/comments.hl in the page, switches alice / bob / nobody. Home entry, routes, map line, README; base-look gate covers comments; 33 gate checks with real clicks / keysmre
  • 850a376bcomponents (mission 006) 1/3: MdEditor readonly = "true" — the Markdown shown formatted and nothing else (no toolbar, link form, file rows, placeholder, source view or switch; article contenteditable false, tabindex -1, role document; no field background or focus ring); the mount only loads the value. For the comments block, which draws every comment with the editor's own renderermre
  • ee9f1b57mission brief w6mre
  • fe691586components (mission 005) 4/4: docs (README components + gate 290, STATUS, LOG), report reports/005-fixes-16-17-5.mdmre
  • f1ebab53components #5 (mission 005) 3/4: file upload for several files (components/files-upload, demo /files-upload) — pure Hybriel, each file through emit server uploadFile (hybriel#94), drop or choose many, a row per file with live progress, one after the other in order, a drop during an upload waits, a file over uploadMax fails in its row and the next goes, 'n of m uploaded'; home entry, routes, map line, README; pagination keyboard focus ring #555 (Chrome painted its own orange one); docker-compose init: true (hybriel#156); gate 290/0 (17 #5 checks with real file drops, 1 #16 focus check)mre
  • 3b73ae5bcomponents #16 (mission 005) 2/4: Pagination tells the host the target page — the host hands onPage (hybriel#87: a function, not emit), called on every click that changes the page (pointer, Enter/Space, script click; Previous/Next/numbers/first/last; not … or the current page) with the target read from the clicked button's data-page before the rebuild; demo shows what the page was told; README Data out; 15 gate checks (14 fail on the old pagination)mre