Fossil SCM
Also fix URLs for non-filtered /timeline links opened from /finfo pages, plus some code and comment cleanups.
Commit
3ae1390f1792683122cd605ec5328fadfca076138114a6cc67ee2631d7ad1d48
Parent
7bbd1b99183068b…
1 file changed
+17
-23
+17
-23
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -802,15 +802,11 @@ | ||
| 802 | 802 | }()); |
| 803 | 803 | |
| 804 | 804 | /* |
| 805 | 805 | ** Timeline keyboard navigation shortcuts: |
| 806 | 806 | ** |
| 807 | -** N - Select next (newer) entry. | |
| 808 | -** M - Select previous (older) entry. | |
| 809 | -** J - View timeline of selected entry. | |
| 810 | -** K - View details of selected entry. | |
| 811 | -** ESC - Disable keyboard navigation mode. | |
| 807 | +** ### NOTE: The keyboard shortcuts are listed in /timeline help text. ### | |
| 812 | 808 | ** |
| 813 | 809 | ** When navigating to a page with a timeline display, such as /timeline, /info, |
| 814 | 810 | ** or /finfo, keyboard navigation mode needs to be "activated" first, i.e. if no |
| 815 | 811 | ** timeline entry is focused yet, pressing any of the listed keys (except ESC) |
| 816 | 812 | ** sets the visual focus indicator to the highlighted or current (check-out) |
| @@ -842,13 +838,10 @@ | ||
| 842 | 838 | ** the tooltip also gets this "wrong", but maybe that's acceptable, because |
| 843 | 839 | ** in order to be able to construct /file URLs, the information provided by |
| 844 | 840 | ** the timeline-data-N blocks would have to be extended). |
| 845 | 841 | ** o kFRST, kLAST: check if the previous/next page should be opened if focus is |
| 846 | 842 | ** already at the top/bottom. |
| 847 | -** o Tweak the focus indicator background color and opacity to be suitable for | |
| 848 | -** the light-background skins, and override it for the dark-background skins | |
| 849 | -** (Ardoise, Dark Mode, Eagle, Xekri). | |
| 850 | 843 | ** o Improve scrolling the focused element into view for browsers without the |
| 851 | 844 | ** Element.scrollIntoViewIfNeeded() function, maybe with a Polyfill, or |
| 852 | 845 | ** something similar to the scrollToSelected() function in this source file. |
| 853 | 846 | */ |
| 854 | 847 | (function(){ |
| @@ -897,16 +890,17 @@ | ||
| 897 | 890 | } |
| 898 | 891 | function timelineGetRowInfo(id){ |
| 899 | 892 | var ti; |
| 900 | 893 | for(var i=0; ti=timelineGetDataBlock(i); i++){ |
| 901 | 894 | for( var k=0; k<ti.rowinfo.length; k++ ){ |
| 902 | - if( id=='m' + ti.rowinfo[k].id ) return { | |
| 903 | - 'baseurl': ti.baseUrl, | |
| 904 | - 'filediff': ti.fileDiff, | |
| 905 | - 'hashdigits': ti.hashDigits, | |
| 906 | - 'hash': ti.rowinfo[k].h, | |
| 907 | - 'branch': ti.rowinfo[k].br }; | |
| 895 | + if( id=='m' + ti.rowinfo[k].id ) return { | |
| 896 | + 'baseurl': ti.baseUrl, | |
| 897 | + 'filediff': ti.fileDiff, | |
| 898 | + 'hashdigits': ti.hashDigits, | |
| 899 | + 'hash': ti.rowinfo[k].h, | |
| 900 | + 'branch': ti.rowinfo[k].br | |
| 901 | + }; | |
| 908 | 902 | } |
| 909 | 903 | } |
| 910 | 904 | return null; |
| 911 | 905 | } |
| 912 | 906 | function focusScrollToIntoViewTheFossilWay(e){ |
| @@ -978,18 +972,18 @@ | ||
| 978 | 972 | switch( key ){ |
| 979 | 973 | case kFRST: dx = -2; break; |
| 980 | 974 | case kNEXT: dx = -1; break; |
| 981 | 975 | case kPREV: dx = +1; break; |
| 982 | 976 | case kLAST: dx = +2; break; |
| 983 | - case kCYCL: break; | |
| 984 | - case kTICK: break; | |
| 985 | - case kUNTK: break; | |
| 986 | - case kCPYH: break; | |
| 987 | - case kCPYB: break; | |
| 988 | - case kTMLN: break; | |
| 989 | - case kTMLB: break; | |
| 990 | - case kVIEW: break; | |
| 977 | + case kCYCL: | |
| 978 | + case kTICK: | |
| 979 | + case kUNTK: | |
| 980 | + case kCPYH: | |
| 981 | + case kCPYB: | |
| 982 | + case kTMLN: | |
| 983 | + case kTMLB: | |
| 984 | + case kVIEW: | |
| 991 | 985 | case kDONE: break; |
| 992 | 986 | default: return; |
| 993 | 987 | } |
| 994 | 988 | if( key==kUNTK ){ |
| 995 | 989 | var tid = focusTickedId(); |
| @@ -1041,11 +1035,11 @@ | ||
| 1041 | 1035 | var hh = encodeURIComponent(ri.hash.slice(0,ri.hashdigits)); |
| 1042 | 1036 | var br = encodeURIComponent(ri.branch); |
| 1043 | 1037 | var page; |
| 1044 | 1038 | switch( key ){ |
| 1045 | 1039 | case kTMLN: |
| 1046 | - page = '/timeline?m&c=' + hh; | |
| 1040 | + page = '/timeline' + ( ri.filediff ? '?m&cf=' : '?m&c=' ) + hh; | |
| 1047 | 1041 | break; |
| 1048 | 1042 | case kTMLB: |
| 1049 | 1043 | page = '/timeline?r=' + br + |
| 1050 | 1044 | ( ri.filediff ? '&m&cf=' : '&m&c=' ) + hh; |
| 1051 | 1045 | break; |
| 1052 | 1046 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -802,15 +802,11 @@ | |
| 802 | }()); |
| 803 | |
| 804 | /* |
| 805 | ** Timeline keyboard navigation shortcuts: |
| 806 | ** |
| 807 | ** N - Select next (newer) entry. |
| 808 | ** M - Select previous (older) entry. |
| 809 | ** J - View timeline of selected entry. |
| 810 | ** K - View details of selected entry. |
| 811 | ** ESC - Disable keyboard navigation mode. |
| 812 | ** |
| 813 | ** When navigating to a page with a timeline display, such as /timeline, /info, |
| 814 | ** or /finfo, keyboard navigation mode needs to be "activated" first, i.e. if no |
| 815 | ** timeline entry is focused yet, pressing any of the listed keys (except ESC) |
| 816 | ** sets the visual focus indicator to the highlighted or current (check-out) |
| @@ -842,13 +838,10 @@ | |
| 842 | ** the tooltip also gets this "wrong", but maybe that's acceptable, because |
| 843 | ** in order to be able to construct /file URLs, the information provided by |
| 844 | ** the timeline-data-N blocks would have to be extended). |
| 845 | ** o kFRST, kLAST: check if the previous/next page should be opened if focus is |
| 846 | ** already at the top/bottom. |
| 847 | ** o Tweak the focus indicator background color and opacity to be suitable for |
| 848 | ** the light-background skins, and override it for the dark-background skins |
| 849 | ** (Ardoise, Dark Mode, Eagle, Xekri). |
| 850 | ** o Improve scrolling the focused element into view for browsers without the |
| 851 | ** Element.scrollIntoViewIfNeeded() function, maybe with a Polyfill, or |
| 852 | ** something similar to the scrollToSelected() function in this source file. |
| 853 | */ |
| 854 | (function(){ |
| @@ -897,16 +890,17 @@ | |
| 897 | } |
| 898 | function timelineGetRowInfo(id){ |
| 899 | var ti; |
| 900 | for(var i=0; ti=timelineGetDataBlock(i); i++){ |
| 901 | for( var k=0; k<ti.rowinfo.length; k++ ){ |
| 902 | if( id=='m' + ti.rowinfo[k].id ) return { |
| 903 | 'baseurl': ti.baseUrl, |
| 904 | 'filediff': ti.fileDiff, |
| 905 | 'hashdigits': ti.hashDigits, |
| 906 | 'hash': ti.rowinfo[k].h, |
| 907 | 'branch': ti.rowinfo[k].br }; |
| 908 | } |
| 909 | } |
| 910 | return null; |
| 911 | } |
| 912 | function focusScrollToIntoViewTheFossilWay(e){ |
| @@ -978,18 +972,18 @@ | |
| 978 | switch( key ){ |
| 979 | case kFRST: dx = -2; break; |
| 980 | case kNEXT: dx = -1; break; |
| 981 | case kPREV: dx = +1; break; |
| 982 | case kLAST: dx = +2; break; |
| 983 | case kCYCL: break; |
| 984 | case kTICK: break; |
| 985 | case kUNTK: break; |
| 986 | case kCPYH: break; |
| 987 | case kCPYB: break; |
| 988 | case kTMLN: break; |
| 989 | case kTMLB: break; |
| 990 | case kVIEW: break; |
| 991 | case kDONE: break; |
| 992 | default: return; |
| 993 | } |
| 994 | if( key==kUNTK ){ |
| 995 | var tid = focusTickedId(); |
| @@ -1041,11 +1035,11 @@ | |
| 1041 | var hh = encodeURIComponent(ri.hash.slice(0,ri.hashdigits)); |
| 1042 | var br = encodeURIComponent(ri.branch); |
| 1043 | var page; |
| 1044 | switch( key ){ |
| 1045 | case kTMLN: |
| 1046 | page = '/timeline?m&c=' + hh; |
| 1047 | break; |
| 1048 | case kTMLB: |
| 1049 | page = '/timeline?r=' + br + |
| 1050 | ( ri.filediff ? '&m&cf=' : '&m&c=' ) + hh; |
| 1051 | break; |
| 1052 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -802,15 +802,11 @@ | |
| 802 | }()); |
| 803 | |
| 804 | /* |
| 805 | ** Timeline keyboard navigation shortcuts: |
| 806 | ** |
| 807 | ** ### NOTE: The keyboard shortcuts are listed in /timeline help text. ### |
| 808 | ** |
| 809 | ** When navigating to a page with a timeline display, such as /timeline, /info, |
| 810 | ** or /finfo, keyboard navigation mode needs to be "activated" first, i.e. if no |
| 811 | ** timeline entry is focused yet, pressing any of the listed keys (except ESC) |
| 812 | ** sets the visual focus indicator to the highlighted or current (check-out) |
| @@ -842,13 +838,10 @@ | |
| 838 | ** the tooltip also gets this "wrong", but maybe that's acceptable, because |
| 839 | ** in order to be able to construct /file URLs, the information provided by |
| 840 | ** the timeline-data-N blocks would have to be extended). |
| 841 | ** o kFRST, kLAST: check if the previous/next page should be opened if focus is |
| 842 | ** already at the top/bottom. |
| 843 | ** o Improve scrolling the focused element into view for browsers without the |
| 844 | ** Element.scrollIntoViewIfNeeded() function, maybe with a Polyfill, or |
| 845 | ** something similar to the scrollToSelected() function in this source file. |
| 846 | */ |
| 847 | (function(){ |
| @@ -897,16 +890,17 @@ | |
| 890 | } |
| 891 | function timelineGetRowInfo(id){ |
| 892 | var ti; |
| 893 | for(var i=0; ti=timelineGetDataBlock(i); i++){ |
| 894 | for( var k=0; k<ti.rowinfo.length; k++ ){ |
| 895 | if( id=='m' + ti.rowinfo[k].id ) return { |
| 896 | 'baseurl': ti.baseUrl, |
| 897 | 'filediff': ti.fileDiff, |
| 898 | 'hashdigits': ti.hashDigits, |
| 899 | 'hash': ti.rowinfo[k].h, |
| 900 | 'branch': ti.rowinfo[k].br |
| 901 | }; |
| 902 | } |
| 903 | } |
| 904 | return null; |
| 905 | } |
| 906 | function focusScrollToIntoViewTheFossilWay(e){ |
| @@ -978,18 +972,18 @@ | |
| 972 | switch( key ){ |
| 973 | case kFRST: dx = -2; break; |
| 974 | case kNEXT: dx = -1; break; |
| 975 | case kPREV: dx = +1; break; |
| 976 | case kLAST: dx = +2; break; |
| 977 | case kCYCL: |
| 978 | case kTICK: |
| 979 | case kUNTK: |
| 980 | case kCPYH: |
| 981 | case kCPYB: |
| 982 | case kTMLN: |
| 983 | case kTMLB: |
| 984 | case kVIEW: |
| 985 | case kDONE: break; |
| 986 | default: return; |
| 987 | } |
| 988 | if( key==kUNTK ){ |
| 989 | var tid = focusTickedId(); |
| @@ -1041,11 +1035,11 @@ | |
| 1035 | var hh = encodeURIComponent(ri.hash.slice(0,ri.hashdigits)); |
| 1036 | var br = encodeURIComponent(ri.branch); |
| 1037 | var page; |
| 1038 | switch( key ){ |
| 1039 | case kTMLN: |
| 1040 | page = '/timeline' + ( ri.filediff ? '?m&cf=' : '?m&c=' ) + hh; |
| 1041 | break; |
| 1042 | case kTMLB: |
| 1043 | page = '/timeline?r=' + br + |
| 1044 | ( ri.filediff ? '&m&cf=' : '&m&c=' ) + hh; |
| 1045 | break; |
| 1046 |