Fossil

Check-in [2ed74216fb]
Login

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

Overview
Comment:Shortcuts G and SHIFT+G to load the default timeline, or the timeline around the current check-out.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline-keyboard-navigation
Files: files | file ages | folders
SHA3-256: 2ed74216fb54c2d5a1ff4d08fad2830ae7282f42765be9ff15f50cccd443eb4c
User & Date: florian 2022-10-02 09:15:00.000
Context
2022-10-03
11:18
Check the meta key modifier (⊞|⌘|◆) when processing keyboard events. ... (check-in: 11bb41e09e user: florian tags: timeline-keyboard-navigation)
2022-10-02
09:15
Shortcuts G and SHIFT+G to load the default timeline, or the timeline around the current check-out. ... (check-in: 2ed74216fb user: florian tags: timeline-keyboard-navigation)
2022-10-01
06:48
Sync with trunk. ... (check-in: e5c5e6f0e9 user: florian tags: timeline-keyboard-navigation)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.js.
1009
1010
1011
1012
1013
1014
1015


1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034


1035
1036
1037
1038
1039
1040
1041
        kTICK = 72 /* H */,
        kUNTK = mSHIFT | 72 /* SHIFT+H */,
        kCPYH = 66 /* B */,
        kCPYB = mSHIFT | 66 /* SHIFT+B */,
        kTMLN = 76 /* L */,
        kTMLB = mSHIFT | 76 /* SHIFT+L */,
        kVIEW = 75 /* K */,


        kDONE = 27 /* ESC */,
        mod = evt.altKey<<15 | evt.ctrlKey<<14 | evt.shiftKey<<13,
        key = ( evt.which || evt.keyCode ) | mod;
      var dx = 0;
      switch( key ){
        case kFRST: dx = -2; break;
        case kNEXT: dx = -1; break;
        case kPREV: dx = +1; break;
        case kLAST: dx = +2; break;
        case kCYCL:
        case kCNTR:
        case kSCRL:
        case kTICK:
        case kUNTK:
        case kCPYH:
        case kCPYB:
        case kTMLN:
        case kTMLB:
        case kVIEW:


        case kDONE: break;
        default: return;
      }
      evt.preventDefault();
      evt.stopPropagation();
      if( key==kCNTR ){
        var cid = focusViewportCenterId();







>
>



















>
>







1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
        kTICK = 72 /* H */,
        kUNTK = mSHIFT | 72 /* SHIFT+H */,
        kCPYH = 66 /* B */,
        kCPYB = mSHIFT | 66 /* SHIFT+B */,
        kTMLN = 76 /* L */,
        kTMLB = mSHIFT | 76 /* SHIFT+L */,
        kVIEW = 75 /* K */,
        kVDEF = 71 /* G */,
        kVCUR = mSHIFT | 71 /* SHIFT+G */,
        kDONE = 27 /* ESC */,
        mod = evt.altKey<<15 | evt.ctrlKey<<14 | evt.shiftKey<<13,
        key = ( evt.which || evt.keyCode ) | mod;
      var dx = 0;
      switch( key ){
        case kFRST: dx = -2; break;
        case kNEXT: dx = -1; break;
        case kPREV: dx = +1; break;
        case kLAST: dx = +2; break;
        case kCYCL:
        case kCNTR:
        case kSCRL:
        case kTICK:
        case kUNTK:
        case kCPYH:
        case kCPYB:
        case kTMLN:
        case kTMLB:
        case kVIEW:
        case kVDEF:
        case kVCUR:
        case kDONE: break;
        default: return;
      }
      evt.preventDefault();
      evt.stopPropagation();
      if( key==kCNTR ){
        var cid = focusViewportCenterId();
1065
1066
1067
1068
1069
1070
1071

















1072
1073
1074
1075
1076
1077
1078
          var ri = timelineGetRowInfo(fid);
          if( ri ){
            copyTextToClipboard(
              key==kCPYH ? ri.hash.slice(0,ri.hashdigits) : ri.branch);
          }
        }
        return;

















      }
      else if( key==kDONE ){
        focusCacheSet(null);
        focusVisualize(null,false);
        focusCookieClear();
        return;
      }







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
          var ri = timelineGetRowInfo(fid);
          if( ri ){
            copyTextToClipboard(
              key==kCPYH ? ri.hash.slice(0,ri.hashdigits) : ri.branch);
          }
        }
        return;
      }
      else if( key==kVDEF || key==kVCUR ){
        var ri = timelineGetRowInfo('m1');
        if( ri ){
          var page;
          switch( key ){
            case kVDEF:
              page = '/timeline';
              break;
            case kVCUR:
              page = '/timeline?c=current';
              break;
          }
          var href = ri.baseurl + page;
          if( href!=location.href.slice(-href.length) ) location.href = href;
        }
        return;
      }
      else if( key==kDONE ){
        focusCacheSet(null);
        focusVisualize(null,false);
        focusCookieClear();
        return;
      }
Changes to src/timeline.c.
1644
1645
1646
1647
1648
1649
1650


1651
1652
1653
1654
1655
1656
1657
**    h     Tick/untick focused entry, or open diff if two entries ticked.
**    H     Untick all entries.
**    b     Copy commit hash of focused entry to clipboard.
**    B     Copy branch name of focused entry to clipboard.
**    l     View timeline of focused entry.
**    L     View timeline of focused entry filtered by branch.
**    k     View details of focused entry.


**    ESC   Disable keyboard navigation mode.
*/
void page_timeline(void){
  Stmt q;                            /* Query used to generate the timeline */
  Blob sql;                          /* text of SQL used to generate timeline */
  Blob desc;                         /* Description of the timeline */
  int nEntry;                        /* Max number of entries on timeline */







>
>







1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
**    h     Tick/untick focused entry, or open diff if two entries ticked.
**    H     Untick all entries.
**    b     Copy commit hash of focused entry to clipboard.
**    B     Copy branch name of focused entry to clipboard.
**    l     View timeline of focused entry.
**    L     View timeline of focused entry filtered by branch.
**    k     View details of focused entry.
**    g     View default timeline.
**    G     View timeline around current (check-out) entry.
**    ESC   Disable keyboard navigation mode.
*/
void page_timeline(void){
  Stmt q;                            /* Query used to generate the timeline */
  Blob sql;                          /* text of SQL used to generate timeline */
  Blob desc;                         /* Description of the timeline */
  int nEntry;                        /* Max number of entries on timeline */