19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
};
document.querySelectorAll('table.diff').forEach(addToggle);
function resetToggles(){
var cb = document.querySelectorAll(
'input[type="checkbox"].diff-toggle:not(:checked)');
for( var i=0; i<cb.length; i++ ) cb[i].checked = true;
}
if( window.requestIdleCallback ){
window.requestIdleCallback(resetToggles);
}else{
setTimeout(resetToggles);
}
});
/*
** Diff keyboard navigation shortcuts:
**
** ### NOTE: The keyboard shortcuts are listed in the /vdiff help screen. ###
**
** Ideas and TODOs:
**
** o The `timeline-keyboard-navigation' branch removes the unload handler from
** pages containing timeline snippets, so it's no longer necessary to reset
** the diff toggles on back/forward navigation in case the mentioned branch
** is merged with `diff-keyboard-navigation'.
** o The `diff-toggle' class was renamed to `toggle-diff' in my private Fossil
** patches to simplify completeness tests with my IE-compatible builds.
*/
(function(){
window.addEventListener('load',function(){
function btnScrollIntoView(e){
//setTimeout(function(){
e = e.parentElement;
var rc = e.getBoundingClientRect();
var y = 0;
do{
y += e.offsetTop;
}while( e = e.offsetParent );
window.scrollTo(0,y-6*rc.height);
//},0);
}
document.addEventListener('keydown',function(evt){
//if( evt.target.tagName=='INPUT' || evt.target.tagName=='SELECT' ) return;
var
mSHIFT = 1<<13,
kSHOW = mSHIFT | 73 /* SHIFT+I */,
kHIDE = 73 /* I */,
kNEXT = 80 /* P */,
kPREV = 79 /* O */,
mod = evt.altKey<<15 | evt.ctrlKey<<14 | evt.shiftKey<<13,
|
<
<
<
|
<
<
<
<
<
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
};
document.querySelectorAll('table.diff').forEach(addToggle);
function resetToggles(){
var cb = document.querySelectorAll(
'input[type="checkbox"].diff-toggle:not(:checked)');
for( var i=0; i<cb.length; i++ ) cb[i].checked = true;
}
setTimeout(resetToggles);
});
/*
** Diff keyboard navigation shortcuts:
**
** ### NOTE: The keyboard shortcuts are listed in the /vdiff help screen. ###
**
** Ideas and TODOs:
**
** o The `timeline-keyboard-navigation' branch removes the unload handler from
** pages containing timeline snippets, so it's no longer necessary to reset
** the diff toggles on back/forward navigation in case the mentioned branch
** is merged with `diff-keyboard-navigation'.
*/
(function(){
window.addEventListener('load',function(){
function btnScrollIntoView(e){
e = e.parentElement;
var rc = e.getBoundingClientRect();
var y = 0;
do{
y += e.offsetTop;
}while( e = e.offsetParent );
window.scrollTo(0,y-6*rc.height);
}
document.addEventListener('keydown',function(evt){
if( evt.target.tagName=='INPUT' || evt.target.tagName=='SELECT' ) return;
var
mSHIFT = 1<<13,
kSHOW = mSHIFT | 73 /* SHIFT+I */,
kHIDE = 73 /* I */,
kNEXT = 80 /* P */,
kPREV = 79 /* O */,
mod = evt.altKey<<15 | evt.ctrlKey<<14 | evt.shiftKey<<13,
|