From 0007d077cce39982016eff9faae4e057ea08127d Mon Sep 17 00:00:00 2001 From: abaevbog Date: Tue, 27 Feb 2024 01:00:14 -0500 Subject: [PATCH] accessibility improvements for quick format dialog (#3464) - removed all cursor-related logic. Instead, insert a new input component each time the user wants to type. The input remain between bubbles and focusing on one will open the reference panel. Leaving the input hides the reference panel. - during drag-drop reordering, lock the editor height so that it doesn't get out of sync with the window. - removed the iframe, since it was no longer needed. - keyboard navigation: Home/End will place an input at the start/end of the editor and focus it. Tab focuses the last active input if any, or the input in the end otherwise. Shift-Tab from the editor focuses the dropdown button if it is active. Tab from the input will focus the first entry of the reference list. Tab from the reference list will focus the active input. Shift-ArrowLeft/Right from focused bubble will swap the bubble with its neighbor. ArrowDown/Up from bubble will open/close the citation dialog. - when a reference item is selected, previously active input is re-focused. - aria-properties to have voiceover, JAWS and NVDA read bubbles, inputs and reference items, as well as announce hints about available keypresses. - typing from bubble or the reference panel will refocus previously active input - different minor updates to make the functionality less janky - refactoring of refreshing and resizing of the reference panel to be more straightforward and to only do it when necessary. E.g. clicking on a bubble and closing the popover after will not rerun search and just display the old results. - some throttling logic so that two escape keypresses one after another when the itemPopover is open do not close the entire dialog - renamed variables: qfb=dialog, qfe=editor, panel=itemPopover - use short form of locator string for bubbles --- .../zotero-platform/mac/integration.css | 7 - .../zotero-platform/unix/integration.css | 3 +- .../integration/citationDialogIframe.html | 33 - .../zotero/integration/insertNoteDialog.xhtml | 19 +- .../content/zotero/integration/quickFormat.js | 1387 +++++++++++------ .../zotero/integration/quickFormat.xhtml | 80 +- chrome/content/zotero/xpcom/cite.js | 46 +- chrome/locale/en-US/zotero/zotero.ftl | 4 + chrome/skin/default/zotero/integration.css | 87 +- 9 files changed, 1069 insertions(+), 597 deletions(-) delete mode 100644 chrome/content/zotero/integration/citationDialogIframe.html diff --git a/chrome/content/zotero-platform/mac/integration.css b/chrome/content/zotero-platform/mac/integration.css index 2bce2b8afd..0a45fd42c9 100644 --- a/chrome/content/zotero-platform/mac/integration.css +++ b/chrome/content/zotero-platform/mac/integration.css @@ -26,9 +26,6 @@ window.citation-dialog { border-radius: 10px; } -.citation-dialog.search:not([multiline="true"]) { - height: 32px !important; -} .citation-dialog.entry { background: -moz-linear-gradient(-90deg, rgb(243,123,119) 0, rgb(180,47,38) 50%, rgb(156,36,27) 50%); @@ -95,8 +92,4 @@ panel button:hover:active { panel button:-moz-focusring { box-shadow: 0 0 1px -moz-mac-focusring inset, 0 0 4px 1px -moz-mac-focusring, 0 0 2px 1px -moz-mac-focusring; -} - -.citation-dialog.bubble { - padding: 1px 6px 1px 6px; } \ No newline at end of file diff --git a/chrome/content/zotero-platform/unix/integration.css b/chrome/content/zotero-platform/unix/integration.css index cfed6efacf..6213774b4b 100644 --- a/chrome/content/zotero-platform/unix/integration.css +++ b/chrome/content/zotero-platform/unix/integration.css @@ -18,6 +18,7 @@ window.citation-dialog { } #zotero-icon { - margin: 0 0 0 2px; + padding: 4px 4px 6px 4px !important; + margin: 2px 0; -moz-appearance: none; } diff --git a/chrome/content/zotero/integration/citationDialogIframe.html b/chrome/content/zotero/integration/citationDialogIframe.html deleted file mode 100644 index 656c6958f3..0000000000 --- a/chrome/content/zotero/integration/citationDialogIframe.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/chrome/content/zotero/integration/insertNoteDialog.xhtml b/chrome/content/zotero/integration/insertNoteDialog.xhtml index 58c3285963..a48cb2cb47 100644 --- a/chrome/content/zotero/integration/insertNoteDialog.xhtml +++ b/chrome/content/zotero/integration/insertNoteDialog.xhtml @@ -26,6 +26,7 @@ + @@ -39,7 +40,7 @@ xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" persist="screenX screenY" - onkeypress="Zotero_QuickFormat.onKeyPress(event)" + onkeypress="Zotero_QuickFormat.onWindowKeyPress(event)" onunload="Zotero_QuickFormat.onUnload()">