48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
if( !document.querySelector('body.fdiff') ){
/* Don't show the diff toggle button for /fdiff because it only
has a single file to show (and also a different DOM layout). */
document.querySelectorAll('table.diff').forEach(addToggle);
}
const icm = allToggles.length>1 ? window.fossil.page.diffControlContainer : 0;
if(icm) {
const btnAll = D.addClass(D.a("#", "Toggle all diffs"), "button");
D.append( icm, btnAll );
btnAll.addEventListener('click', function(ev){
ev.preventDefault();
ev.stopPropagation();
/* Figure out whether we want to show all or hide all: if any diffs are
toggled off, show all, else hide all. */
let show = false;
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
if( !document.querySelector('body.fdiff') ){
/* Don't show the diff toggle button for /fdiff because it only
has a single file to show (and also a different DOM layout). */
document.querySelectorAll('table.diff').forEach(addToggle);
}
const icm = allToggles.length>1 ? window.fossil.page.diffControlContainer : 0;
if(icm) {
const btnAll = D.addClass(D.a("#", "Show/Hide"), "button");
D.append( icm, btnAll );
btnAll.addEventListener('click', function(ev){
ev.preventDefault();
ev.stopPropagation();
/* Figure out whether we want to show all or hide all: if any diffs are
toggled off, show all, else hide all. */
let show = false;
|
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
|
that the checkbox is to the LEFT of of its label. We store the
sync-scroll preference in F.storage (not a cookie) so that it
persists across page loads and different apps. */
cbSync = D.checkbox(keySbsScroll, F.storage.getBool(keySbsScroll,true));
D.append(eToggleParent, D.append(
D.addClass(D.create('span'), 'input-with-label'),
D.append(D.create('label'),
cbSync, "Sync side-by-side scrolling")
));
cbSync.addEventListener('change', function(e){
F.storage.set(keySbsScroll, e.target.checked);
});
}
const useSync = cbSync ? ()=>cbSync.checked : ()=>F.storage.getBool(keySbsScroll,true);
|
|
|
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
|
that the checkbox is to the LEFT of of its label. We store the
sync-scroll preference in F.storage (not a cookie) so that it
persists across page loads and different apps. */
cbSync = D.checkbox(keySbsScroll, F.storage.getBool(keySbsScroll,true));
D.append(eToggleParent, D.append(
D.addClass(D.create('span'), 'input-with-label'),
D.append(D.create('label'),
cbSync, "Scroll Sync")
));
cbSync.addEventListener('change', function(e){
F.storage.set(keySbsScroll, e.target.checked);
});
}
const useSync = cbSync ? ()=>cbSync.checked : ()=>F.storage.getBool(keySbsScroll,true);
|