Fossil

Diff
Login

Differences From Artifact [59f86b0e4c]:

To Artifact [1da80e8853]:


804
805
806
807
808
809
810
811

812
813
814
815

816
817
818
819
820
821
822
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.
** 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 L)
** 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
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 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 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(){