Fossil

Check-in [ec8b53a9bc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Comment and TODO updates.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline-keyboard-navigation
Files: files | file ages | folders
SHA3-256: ec8b53a9bc6490c666e17676e73834711ffd0658aa6bdd73567649b4553b6330
User & Date: florian 2022-08-04 06:14:00.000
Context
2022-08-04
06:57
Experimental change to scroll the focused entry into view with a Fossil-style scrolling function to keep the entry centered vertically. This is much better than `Element.scrollIntoView()' for FF (but maybe a matter of tweaking the function arguments). Kudos to the wiz who programmed the `scrollToSelected()' function! ... (check-in: ad3a8e0b87 user: florian tags: timeline-keyboard-navigation)
06:14
Comment and TODO updates. ... (check-in: ec8b53a9bc user: florian tags: timeline-keyboard-navigation)
06:09
Enhance the H shortcut to consider the secondary selection on the /vdiff page as a waypoint. ... (check-in: 0c024627dc user: florian tags: timeline-keyboard-navigation)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.js.
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
/*
** Timeline keyboard navigation shortcuts:
**
** N - Select next (newer) entry.
** M - Select previous (older) entry.
** J - View timeline of selected entry.
** K - View details of selected entry.
** L - Disable keyboard navigation mode.
**
** When navigating to a page with a timeline display, such as /timeline, /info,
** or /finfo, keyboard navigation mode needs to be "activated" first, i.e. if no
** timeline entry is focused yet, pressing any of the listed keys (except L)
** sets the visual focus indicator to the highlighted or current (check-out)
** entry if available, or to the topmost entry otherwise. A session cookie[0] is
** used to direct pages loaded in the future to enable keyboard navigation mode
** and automatically set the focus indicator to the highlighted, current, or
** topmost entry. Pressing N and M on the /timeline page while the topmost or
** bottommost entry is focused loads the next or previous page if available,
** similar to the [↑ More] and [↓ More] links. Pressing L disables keyboard







|



|







804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
/*
** Timeline keyboard navigation shortcuts:
**
** N - Select next (newer) entry.
** M - Select previous (older) entry.
** J - View timeline of selected entry.
** K - View details of selected entry.
** ESC - Disable keyboard navigation mode.
**
** When navigating to a page with a timeline display, such as /timeline, /info,
** or /finfo, keyboard navigation mode needs to be "activated" first, i.e. if no
** timeline entry is focused yet, pressing any of the listed keys (except ESC)
** sets the visual focus indicator to the highlighted or current (check-out)
** entry if available, or to the topmost entry otherwise. A session cookie[0] is
** used to direct pages loaded in the future to enable keyboard navigation mode
** and automatically set the focus indicator to the highlighted, current, or
** topmost entry. Pressing N and M on the /timeline page while the topmost or
** bottommost entry is focused loads the next or previous page if available,
** similar to the [↑ More] and [↓ More] links. Pressing L disables keyboard
834
835
836
837
838
839
840
841
842
843
844


845

846
847
848
849
850
851
852
853
** screen readers should ignore it even without an aria-hidden="true" attribute
** (which is even discouraged for hidden by CSS elements). Also, this feature
** breaks if disabled[=true] or tabindex="-1" attributes are added to the input
** field, or (in FF) if page unload handlers are present.
**
** Ideas and TODOs:
**
**  o Shortcut to select the topmost or bottommost entry, either by separate
**    key, or with modifiers (SHIFT+N, SHIFT+M)?
**  o Shortcut to toggle the tick-mark for the focused check-in node.
**  o Shortcuts to copy branch name or hash of the focused entry to clipboard.


**  o Shortcut to put the focus indicator to the default item(s), in (cyclic)

**    order ticked → highlighted → check-out → ticked → ...
**  o Improve scrolling the focused element into view for browsers without the
**    Element.scrollIntoViewIfNeeded() function, maybe with a Polyfill, or
**    something similar to the scrollToSelected() function in this source file.
*/
(function(){
  window.addEventListener('load',function(){
    function focusDefaultId(){







|
|
|
|
>
>
|
>
|







834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
** screen readers should ignore it even without an aria-hidden="true" attribute
** (which is even discouraged for hidden by CSS elements). Also, this feature
** breaks if disabled[=true] or tabindex="-1" attributes are added to the input
** field, or (in FF) if page unload handlers are present.
**
** Ideas and TODOs:
**
**  o kTMLN: ensure the correct page is opened when used from /finfo (it seems
**    the tooltip also gets this "wrong", but maybe that's acceptable, because
**    in order to be able to construct /file URLs, the information provided by
**    the timeline-data-N blocks would have to be extended).
**  o kFRST, kLAST: check if the previous/next page should be opened if focus is
**    already at the top/bottom.
**  o Tweak the focus indicator background color and opacity to be suitable for
**    the light-background skins, and override it for the dark-background skins
**    (Ardoise, Dark Mode, Eagle, Xekri).
**  o Improve scrolling the focused element into view for browsers without the
**    Element.scrollIntoViewIfNeeded() function, maybe with a Polyfill, or
**    something similar to the scrollToSelected() function in this source file.
*/
(function(){
  window.addEventListener('load',function(){
    function focusDefaultId(){