Fossil SCM

Minor code cleanups and comment updates.

florian 2022-09-30 11:21 diff-keyboard-navigation
Commit d17b59763e63e636b86f0bdb0731ea69e7f9f55bda07d21d40abcc7bb1ca440f
1 file changed +2 -10
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -21,15 +21,11 @@
2121
function resetToggles(){
2222
var cb = document.querySelectorAll(
2323
'input[type="checkbox"].diff-toggle:not(:checked)');
2424
for( var i=0; i<cb.length; i++ ) cb[i].checked = true;
2525
}
26
- if( window.requestIdleCallback ){
27
- window.requestIdleCallback(resetToggles);
28
- }else{
29
- setTimeout(resetToggles);
30
- }
26
+ setTimeout(resetToggles);
3127
});
3228
3329
/*
3430
** Diff keyboard navigation shortcuts:
3531
**
@@ -39,28 +35,24 @@
3935
**
4036
** o The `timeline-keyboard-navigation' branch removes the unload handler from
4137
** pages containing timeline snippets, so it's no longer necessary to reset
4238
** the diff toggles on back/forward navigation in case the mentioned branch
4339
** is merged with `diff-keyboard-navigation'.
44
-** o The `diff-toggle' class was renamed to `toggle-diff' in my private Fossil
45
-** patches to simplify completeness tests with my IE-compatible builds.
4640
*/
4741
(function(){
4842
window.addEventListener('load',function(){
4943
function btnScrollIntoView(e){
50
- //setTimeout(function(){
5144
e = e.parentElement;
5245
var rc = e.getBoundingClientRect();
5346
var y = 0;
5447
do{
5548
y += e.offsetTop;
5649
}while( e = e.offsetParent );
5750
window.scrollTo(0,y-6*rc.height);
58
- //},0);
5951
}
6052
document.addEventListener('keydown',function(evt){
61
- //if( evt.target.tagName=='INPUT' || evt.target.tagName=='SELECT' ) return;
53
+ if( evt.target.tagName=='INPUT' || evt.target.tagName=='SELECT' ) return;
6254
var
6355
mSHIFT = 1<<13,
6456
kSHOW = mSHIFT | 73 /* SHIFT+I */,
6557
kHIDE = 73 /* I */,
6658
kNEXT = 80 /* P */,
6759
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -21,15 +21,11 @@
21 function resetToggles(){
22 var cb = document.querySelectorAll(
23 'input[type="checkbox"].diff-toggle:not(:checked)');
24 for( var i=0; i<cb.length; i++ ) cb[i].checked = true;
25 }
26 if( window.requestIdleCallback ){
27 window.requestIdleCallback(resetToggles);
28 }else{
29 setTimeout(resetToggles);
30 }
31 });
32
33 /*
34 ** Diff keyboard navigation shortcuts:
35 **
@@ -39,28 +35,24 @@
39 **
40 ** o The `timeline-keyboard-navigation' branch removes the unload handler from
41 ** pages containing timeline snippets, so it's no longer necessary to reset
42 ** the diff toggles on back/forward navigation in case the mentioned branch
43 ** is merged with `diff-keyboard-navigation'.
44 ** o The `diff-toggle' class was renamed to `toggle-diff' in my private Fossil
45 ** patches to simplify completeness tests with my IE-compatible builds.
46 */
47 (function(){
48 window.addEventListener('load',function(){
49 function btnScrollIntoView(e){
50 //setTimeout(function(){
51 e = e.parentElement;
52 var rc = e.getBoundingClientRect();
53 var y = 0;
54 do{
55 y += e.offsetTop;
56 }while( e = e.offsetParent );
57 window.scrollTo(0,y-6*rc.height);
58 //},0);
59 }
60 document.addEventListener('keydown',function(evt){
61 //if( evt.target.tagName=='INPUT' || evt.target.tagName=='SELECT' ) return;
62 var
63 mSHIFT = 1<<13,
64 kSHOW = mSHIFT | 73 /* SHIFT+I */,
65 kHIDE = 73 /* I */,
66 kNEXT = 80 /* P */,
67
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -21,15 +21,11 @@
21 function resetToggles(){
22 var cb = document.querySelectorAll(
23 'input[type="checkbox"].diff-toggle:not(:checked)');
24 for( var i=0; i<cb.length; i++ ) cb[i].checked = true;
25 }
26 setTimeout(resetToggles);
 
 
 
 
27 });
28
29 /*
30 ** Diff keyboard navigation shortcuts:
31 **
@@ -39,28 +35,24 @@
35 **
36 ** o The `timeline-keyboard-navigation' branch removes the unload handler from
37 ** pages containing timeline snippets, so it's no longer necessary to reset
38 ** the diff toggles on back/forward navigation in case the mentioned branch
39 ** is merged with `diff-keyboard-navigation'.
 
 
40 */
41 (function(){
42 window.addEventListener('load',function(){
43 function btnScrollIntoView(e){
 
44 e = e.parentElement;
45 var rc = e.getBoundingClientRect();
46 var y = 0;
47 do{
48 y += e.offsetTop;
49 }while( e = e.offsetParent );
50 window.scrollTo(0,y-6*rc.height);
 
51 }
52 document.addEventListener('keydown',function(evt){
53 if( evt.target.tagName=='INPUT' || evt.target.tagName=='SELECT' ) return;
54 var
55 mSHIFT = 1<<13,
56 kSHOW = mSHIFT | 73 /* SHIFT+I */,
57 kHIDE = 73 /* I */,
58 kNEXT = 80 /* P */,
59

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button