Fossil

Check-in [7bbd1b9918]
Login

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

Overview
Comment:Shortcut SHIFT+J to view the timeline of the focused entry filtered by branch. Add the 'm' query parameter to /timeline links.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline-keyboard-navigation
Files: files | file ages | folders
SHA3-256: 7bbd1b99183068b04c9344ed6646f3ed11875f50de4eba4d7803dde3f5e4f3de
User & Date: florian 2022-08-05 06:22:00.000
Context
2022-08-05
06:39
Also fix URLs for non-filtered /timeline links opened from /finfo pages, plus some code and comment cleanups. ... (check-in: 3ae1390f17 user: florian tags: timeline-keyboard-navigation)
06:22
Shortcut SHIFT+J to view the timeline of the focused entry filtered by branch. Add the 'm' query parameter to /timeline links. ... (check-in: 7bbd1b9918 user: florian tags: timeline-keyboard-navigation)
2022-08-04
12:02
The smart "scroll to" routine also needs to scroll upwards when used for their new purpose. ... (check-in: fff09df34f user: florian tags: timeline-keyboard-navigation)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.js.
897
898
899
900
901
902
903

904
905
906
907
908
909
910
    }
    function timelineGetRowInfo(id){
      var ti;
      for(var i=0; ti=timelineGetDataBlock(i); i++){
        for( var k=0; k<ti.rowinfo.length; k++ ){
        if( id=='m' + ti.rowinfo[k].id ) return {
          'baseurl': ti.baseUrl,

          'hashdigits': ti.hashDigits,
          'hash': ti.rowinfo[k].h,
          'branch': ti.rowinfo[k].br };
        }
      }
      return null;
    }







>







897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
    }
    function timelineGetRowInfo(id){
      var ti;
      for(var i=0; ti=timelineGetDataBlock(i); i++){
        for( var k=0; k<ti.rowinfo.length; k++ ){
        if( id=='m' + ti.rowinfo[k].id ) return {
          'baseurl': ti.baseUrl,
          'filediff': ti.fileDiff,
          'hashdigits': ti.hashDigits,
          'hash': ti.rowinfo[k].h,
          'branch': ti.rowinfo[k].br };
        }
      }
      return null;
    }
964
965
966
967
968
969
970

971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986

987
988
989
990
991
992
993
        kLAST = mSHIFT | 77 /* SHIFT+M */,
        kCYCL = 72 /* H */,
        kTICK = 188 /* , */,
        kUNTK = mSHIFT | 188 /* , */,
        kCPYH = 66 /* B */,
        kCPYB = mSHIFT | 66 /* SHIFT+B */,
        kTMLN = 74 /* J */,

        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: break;
        case kTICK: break;
        case kUNTK: break;
        case kCPYH: break;
        case kCPYB: break;
        case kTMLN: break;

        case kVIEW: break;
        case kDONE: break;
        default: return;
      }
      if( key==kUNTK ){
        var tid = focusTickedId();
        if( tid ){







>
















>







965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
        kLAST = mSHIFT | 77 /* SHIFT+M */,
        kCYCL = 72 /* H */,
        kTICK = 188 /* , */,
        kUNTK = mSHIFT | 188 /* , */,
        kCPYH = 66 /* B */,
        kCPYB = mSHIFT | 66 /* SHIFT+B */,
        kTMLN = 74 /* J */,
        kTMLB = mSHIFT | 74 /* J */,
        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: break;
        case kTICK: break;
        case kUNTK: break;
        case kCPYH: break;
        case kCPYB: break;
        case kTMLN: break;
        case kTMLB: break;
        case kVIEW: break;
        case kDONE: break;
        default: return;
      }
      if( key==kUNTK ){
        var tid = focusTickedId();
        if( tid ){
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037


1038












1039
1040
1041
1042
1043
1044
1045
1046
          else if( id==tik ) id = sel || sl2 || cur || tik;
          else id = sel || sl2 || cur || tik || id;
        }
        else if( key==kTICK ){
          var gn = document.getElementById('tln'+id.slice(1));
          if( gn ) gn.click();
        }
        else/* if( key==kTMLN || key==kVIEW )*/{
          var ri = timelineGetRowInfo(id);
          if( ri ){


            var page = key==kVIEW ? '/info/' : '/timeline?c=';












            var href = ri.baseurl + page + encodeURIComponent(ri.hash);
            if( href!=location.href.slice(-href.length) ){
              location.href = href;
              return;
            }
          }
        }
      }







|


>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|







1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
          else if( id==tik ) id = sel || sl2 || cur || tik;
          else id = sel || sl2 || cur || tik || id;
        }
        else if( key==kTICK ){
          var gn = document.getElementById('tln'+id.slice(1));
          if( gn ) gn.click();
        }
        else/* if( key==kTMLN || key==kTMLB || key==kVIEW )*/{
          var ri = timelineGetRowInfo(id);
          if( ri ){
            var hh = encodeURIComponent(ri.hash.slice(0,ri.hashdigits));
            var br = encodeURIComponent(ri.branch);
            var page;
            switch( key ){
              case kTMLN:
                page = '/timeline?m&c=' + hh;
                break;
              case kTMLB:
                page = '/timeline?r=' + br +
                  ( ri.filediff ? '&m&cf=' : '&m&c=' ) + hh;
                break;
              case kVIEW:
                page = '/info/' + hh;
                break;
            }
            var href = ri.baseurl + page;
            if( href!=location.href.slice(-href.length) ){
              location.href = href;
              return;
            }
          }
        }
      }
Changes to src/timeline.c.
1638
1639
1640
1641
1642
1643
1644

1645
1646
1647
1648
1649
1650
1651
**    M     Focus last (oldest) entry.
**    h     Move focus between selected, current (check-out) and ticked entries.
**    ,     Tick/untick the node of the focused entry.
**    ;     Untick the nodes of all entries.
**    b     Copy the commit hash of the focused entry to clipboard.
**    B     Copy the branch name of the focused entry to clipboard.
**    j     View timeline of focused entry.

**    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 */







>







1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
**    M     Focus last (oldest) entry.
**    h     Move focus between selected, current (check-out) and ticked entries.
**    ,     Tick/untick the node of the focused entry.
**    ;     Untick the nodes of all entries.
**    b     Copy the commit hash of the focused entry to clipboard.
**    B     Copy the branch name of the focused entry to clipboard.
**    j     View timeline of focused entry.
**    J     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 */