Fossil SCM
Coding style fixes and comment updates.
Commit
ae932acdd23980124ca6d892cd126d7c6dde7febd664b5d13904bdfaa09844bc
Parent
8d1edb82061eb09…
1 file changed
+8
-15
+8
-15
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -802,11 +802,11 @@ | ||
| 802 | 802 | }()); |
| 803 | 803 | |
| 804 | 804 | /* |
| 805 | 805 | ** Timeline keyboard navigation shortcuts: |
| 806 | 806 | ** |
| 807 | -** ### NOTE: The keyboard shortcuts are listed in /timeline help text. ### | |
| 807 | +** ### NOTE: The keyboard shortcuts are listed in the /timeline help screen. ### | |
| 808 | 808 | ** |
| 809 | 809 | ** When navigating to a page with a timeline display, such as /timeline, /info, |
| 810 | 810 | ** or /finfo, keyboard navigation mode needs to be "activated" first, i.e. if no |
| 811 | 811 | ** timeline entry is focused yet, pressing any of the listed keys (except ESC) |
| 812 | 812 | ** sets the visual focus indicator to the highlighted or current (check-out) |
| @@ -813,11 +813,11 @@ | ||
| 813 | 813 | ** entry if available, or to the topmost entry otherwise. A session cookie[0] is |
| 814 | 814 | ** used to direct pages loaded in the future to enable keyboard navigation mode |
| 815 | 815 | ** and automatically set the focus indicator to the highlighted, current, or |
| 816 | 816 | ** topmost entry. Pressing N and M on the /timeline page while the topmost or |
| 817 | 817 | ** bottommost entry is focused loads the next or previous page if available, |
| 818 | -** similar to the [↑ More] and [↓ More] links. Pressing L disables keyboard | |
| 818 | +** similar to the [↑ More] and [↓ More] links. Pressing ESC disables keyboard | |
| 819 | 819 | ** navigation, i.e. removes the focus indicator and deletes the session cookie. |
| 820 | 820 | ** When navigating backwards or forwards in browser history, the focused entry |
| 821 | 821 | ** is restored using a hidden[1] input field. |
| 822 | 822 | ** |
| 823 | 823 | ** [0]: The lifetime and values of cookies can be tracked on the /cookies page. |
| @@ -838,13 +838,10 @@ | ||
| 838 | 838 | ** the tooltip also gets this "wrong", but maybe that's acceptable, because |
| 839 | 839 | ** in order to be able to construct /file URLs, the information provided by |
| 840 | 840 | ** the timeline-data-N blocks would have to be extended). |
| 841 | 841 | ** o kFRST, kLAST: check if the previous/next page should be opened if focus is |
| 842 | 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 | 843 | */ |
| 847 | 844 | (function(){ |
| 848 | 845 | window.addEventListener('load',function(){ |
| 849 | 846 | function focusDefaultId(){ |
| 850 | 847 | var tn = document.querySelector( |
| @@ -892,20 +889,20 @@ | ||
| 892 | 889 | var ti; |
| 893 | 890 | for(var i=0; ti=timelineGetDataBlock(i); i++){ |
| 894 | 891 | for( var k=0; k<ti.rowinfo.length; k++ ){ |
| 895 | 892 | if( id=='m' + ti.rowinfo[k].id ) return { |
| 896 | 893 | 'baseurl': ti.baseUrl, |
| 897 | - 'filediff': ti.fileDiff, | |
| 894 | + 'filehash': ti.fileDiff, | |
| 898 | 895 | 'hashdigits': ti.hashDigits, |
| 899 | 896 | 'hash': ti.rowinfo[k].h, |
| 900 | 897 | 'branch': ti.rowinfo[k].br |
| 901 | 898 | }; |
| 902 | 899 | } |
| 903 | 900 | } |
| 904 | 901 | return null; |
| 905 | 902 | } |
| 906 | - function focusScrollToIntoViewTheFossilWay(e){ | |
| 903 | + function fossilScrollIntoView(e){ | |
| 907 | 904 | var y = 0; |
| 908 | 905 | do{ |
| 909 | 906 | y += e.offsetTop; |
| 910 | 907 | }while( e = e.offsetParent ); |
| 911 | 908 | window.scrollTo(0,y-window.innerHeight/2); |
| @@ -917,15 +914,11 @@ | ||
| 917 | 914 | var tn = document.getElementById(id); |
| 918 | 915 | if( tn ){ |
| 919 | 916 | td = tn.parentElement.nextElementSibling; |
| 920 | 917 | if( td ) { |
| 921 | 918 | td.classList.add('timelineFocused'); |
| 922 | - if( scroll ){ | |
| 923 | - focusScrollToIntoViewTheFossilWay(td); | |
| 924 | - //if( td.scrollIntoViewIfNeeded ) td.scrollIntoViewIfNeeded(); | |
| 925 | - //else td.scrollIntoView(false); | |
| 926 | - } | |
| 919 | + if( scroll ) fossilScrollIntoView(td); | |
| 927 | 920 | return true; |
| 928 | 921 | } |
| 929 | 922 | } |
| 930 | 923 | return false; |
| 931 | 924 | } |
| @@ -987,11 +980,11 @@ | ||
| 987 | 980 | case kDONE: break; |
| 988 | 981 | default: return; |
| 989 | 982 | } |
| 990 | 983 | if( key==kSCRL ){ |
| 991 | 984 | var td = document.querySelector('.timelineFocused'); |
| 992 | - if( td ) focusScrollToIntoViewTheFossilWay(td); | |
| 985 | + if( td ) fossilScrollIntoView(td); | |
| 993 | 986 | return; |
| 994 | 987 | } |
| 995 | 988 | else if( key==kUNTK ){ |
| 996 | 989 | var tid = focusTickedId(); |
| 997 | 990 | if( tid ){ |
| @@ -1042,15 +1035,15 @@ | ||
| 1042 | 1035 | var hh = encodeURIComponent(ri.hash.slice(0,ri.hashdigits)); |
| 1043 | 1036 | var br = encodeURIComponent(ri.branch); |
| 1044 | 1037 | var page; |
| 1045 | 1038 | switch( key ){ |
| 1046 | 1039 | case kTMLN: |
| 1047 | - page = '/timeline' + ( ri.filediff ? '?m&cf=' : '?m&c=' ) + hh; | |
| 1040 | + page = '/timeline' + ( ri.filehash ? '?m&cf=' : '?m&c=' ) + hh; | |
| 1048 | 1041 | break; |
| 1049 | 1042 | case kTMLB: |
| 1050 | 1043 | page = '/timeline?r=' + br + |
| 1051 | - ( ri.filediff ? '&m&cf=' : '&m&c=' ) + hh; | |
| 1044 | + ( ri.filehash ? '&m&cf=' : '&m&c=' ) + hh; | |
| 1052 | 1045 | break; |
| 1053 | 1046 | case kVIEW: |
| 1054 | 1047 | page = '/info/' + hh; |
| 1055 | 1048 | break; |
| 1056 | 1049 | } |
| 1057 | 1050 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -802,11 +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) |
| @@ -813,11 +813,11 @@ | |
| 813 | ** entry if available, or to the topmost entry otherwise. A session cookie[0] is |
| 814 | ** used to direct pages loaded in the future to enable keyboard navigation mode |
| 815 | ** and automatically set the focus indicator to the highlighted, current, or |
| 816 | ** topmost entry. Pressing N and M on the /timeline page while the topmost or |
| 817 | ** bottommost entry is focused loads the next or previous page if available, |
| 818 | ** similar to the [↑ More] and [↓ More] links. Pressing L disables keyboard |
| 819 | ** navigation, i.e. removes the focus indicator and deletes the session cookie. |
| 820 | ** When navigating backwards or forwards in browser history, the focused entry |
| 821 | ** is restored using a hidden[1] input field. |
| 822 | ** |
| 823 | ** [0]: The lifetime and values of cookies can be tracked on the /cookies page. |
| @@ -838,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(){ |
| 848 | window.addEventListener('load',function(){ |
| 849 | function focusDefaultId(){ |
| 850 | var tn = document.querySelector( |
| @@ -892,20 +889,20 @@ | |
| 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){ |
| 907 | var y = 0; |
| 908 | do{ |
| 909 | y += e.offsetTop; |
| 910 | }while( e = e.offsetParent ); |
| 911 | window.scrollTo(0,y-window.innerHeight/2); |
| @@ -917,15 +914,11 @@ | |
| 917 | var tn = document.getElementById(id); |
| 918 | if( tn ){ |
| 919 | td = tn.parentElement.nextElementSibling; |
| 920 | if( td ) { |
| 921 | td.classList.add('timelineFocused'); |
| 922 | if( scroll ){ |
| 923 | focusScrollToIntoViewTheFossilWay(td); |
| 924 | //if( td.scrollIntoViewIfNeeded ) td.scrollIntoViewIfNeeded(); |
| 925 | //else td.scrollIntoView(false); |
| 926 | } |
| 927 | return true; |
| 928 | } |
| 929 | } |
| 930 | return false; |
| 931 | } |
| @@ -987,11 +980,11 @@ | |
| 987 | case kDONE: break; |
| 988 | default: return; |
| 989 | } |
| 990 | if( key==kSCRL ){ |
| 991 | var td = document.querySelector('.timelineFocused'); |
| 992 | if( td ) focusScrollToIntoViewTheFossilWay(td); |
| 993 | return; |
| 994 | } |
| 995 | else if( key==kUNTK ){ |
| 996 | var tid = focusTickedId(); |
| 997 | if( tid ){ |
| @@ -1042,15 +1035,15 @@ | |
| 1042 | var hh = encodeURIComponent(ri.hash.slice(0,ri.hashdigits)); |
| 1043 | var br = encodeURIComponent(ri.branch); |
| 1044 | var page; |
| 1045 | switch( key ){ |
| 1046 | case kTMLN: |
| 1047 | page = '/timeline' + ( ri.filediff ? '?m&cf=' : '?m&c=' ) + hh; |
| 1048 | break; |
| 1049 | case kTMLB: |
| 1050 | page = '/timeline?r=' + br + |
| 1051 | ( ri.filediff ? '&m&cf=' : '&m&c=' ) + hh; |
| 1052 | break; |
| 1053 | case kVIEW: |
| 1054 | page = '/info/' + hh; |
| 1055 | break; |
| 1056 | } |
| 1057 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -802,11 +802,11 @@ | |
| 802 | }()); |
| 803 | |
| 804 | /* |
| 805 | ** Timeline keyboard navigation shortcuts: |
| 806 | ** |
| 807 | ** ### NOTE: The keyboard shortcuts are listed in the /timeline help screen. ### |
| 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) |
| @@ -813,11 +813,11 @@ | |
| 813 | ** entry if available, or to the topmost entry otherwise. A session cookie[0] is |
| 814 | ** used to direct pages loaded in the future to enable keyboard navigation mode |
| 815 | ** and automatically set the focus indicator to the highlighted, current, or |
| 816 | ** topmost entry. Pressing N and M on the /timeline page while the topmost or |
| 817 | ** bottommost entry is focused loads the next or previous page if available, |
| 818 | ** similar to the [↑ More] and [↓ More] links. Pressing ESC disables keyboard |
| 819 | ** navigation, i.e. removes the focus indicator and deletes the session cookie. |
| 820 | ** When navigating backwards or forwards in browser history, the focused entry |
| 821 | ** is restored using a hidden[1] input field. |
| 822 | ** |
| 823 | ** [0]: The lifetime and values of cookies can be tracked on the /cookies page. |
| @@ -838,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 | */ |
| 844 | (function(){ |
| 845 | window.addEventListener('load',function(){ |
| 846 | function focusDefaultId(){ |
| 847 | var tn = document.querySelector( |
| @@ -892,20 +889,20 @@ | |
| 889 | var ti; |
| 890 | for(var i=0; ti=timelineGetDataBlock(i); i++){ |
| 891 | for( var k=0; k<ti.rowinfo.length; k++ ){ |
| 892 | if( id=='m' + ti.rowinfo[k].id ) return { |
| 893 | 'baseurl': ti.baseUrl, |
| 894 | 'filehash': ti.fileDiff, |
| 895 | 'hashdigits': ti.hashDigits, |
| 896 | 'hash': ti.rowinfo[k].h, |
| 897 | 'branch': ti.rowinfo[k].br |
| 898 | }; |
| 899 | } |
| 900 | } |
| 901 | return null; |
| 902 | } |
| 903 | function fossilScrollIntoView(e){ |
| 904 | var y = 0; |
| 905 | do{ |
| 906 | y += e.offsetTop; |
| 907 | }while( e = e.offsetParent ); |
| 908 | window.scrollTo(0,y-window.innerHeight/2); |
| @@ -917,15 +914,11 @@ | |
| 914 | var tn = document.getElementById(id); |
| 915 | if( tn ){ |
| 916 | td = tn.parentElement.nextElementSibling; |
| 917 | if( td ) { |
| 918 | td.classList.add('timelineFocused'); |
| 919 | if( scroll ) fossilScrollIntoView(td); |
| 920 | return true; |
| 921 | } |
| 922 | } |
| 923 | return false; |
| 924 | } |
| @@ -987,11 +980,11 @@ | |
| 980 | case kDONE: break; |
| 981 | default: return; |
| 982 | } |
| 983 | if( key==kSCRL ){ |
| 984 | var td = document.querySelector('.timelineFocused'); |
| 985 | if( td ) fossilScrollIntoView(td); |
| 986 | return; |
| 987 | } |
| 988 | else if( key==kUNTK ){ |
| 989 | var tid = focusTickedId(); |
| 990 | if( tid ){ |
| @@ -1042,15 +1035,15 @@ | |
| 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.filehash ? '?m&cf=' : '?m&c=' ) + hh; |
| 1041 | break; |
| 1042 | case kTMLB: |
| 1043 | page = '/timeline?r=' + br + |
| 1044 | ( ri.filehash ? '&m&cf=' : '&m&c=' ) + hh; |
| 1045 | break; |
| 1046 | case kVIEW: |
| 1047 | page = '/info/' + hh; |
| 1048 | break; |
| 1049 | } |
| 1050 |