Fossil SCM
Worked around, rather accidentally, the Darkmode and Xekri skin weirdness - side effects of padding. Bootstrap is still a bit funky, depending at least partially on which media query is currently active.
Commit
3480785e39431ec9b69f88463eb8310be32e60439b13b0b42081095c2b4d3079
Parent
bbc534e7a4fc3d4…
2 files changed
+14
+19
-13
+14
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -537,17 +537,31 @@ | ||
| 537 | 537 | width: 100%; |
| 538 | 538 | border-spacing: 0; |
| 539 | 539 | border: 1px solid black; |
| 540 | 540 | } |
| 541 | 541 | table.diff td.diffln{ |
| 542 | + padding: 0; | |
| 543 | +} | |
| 544 | +table.diff td.diffln > pre{ | |
| 542 | 545 | padding: 0 0.25em 0 0.5em; |
| 546 | + margin: 0; | |
| 543 | 547 | } |
| 544 | 548 | table.diff td { |
| 545 | 549 | vertical-align: top; |
| 550 | + padding: 0; | |
| 551 | + overflow: hidden /*work around inner PRE slight overflow/overlap*/; | |
| 546 | 552 | } |
| 547 | 553 | table.diff pre { |
| 548 | 554 | margin: 0 0 0 0; |
| 555 | + padding: 0 0.5em; | |
| 556 | +} | |
| 557 | +table.diff td.diffln > pre { | |
| 558 | + padding: 0 0.35em 0 0.5em; | |
| 559 | +} | |
| 560 | +table.diff td.difftxt > pre { | |
| 561 | + min-width: 100%; | |
| 562 | + max-width: 100%; | |
| 549 | 563 | } |
| 550 | 564 | tr.diffskip.jchunk { |
| 551 | 565 | /* jchunk gets added from JS to diffskip rows when they are |
| 552 | 566 | plugged into the /jchunk route. */ |
| 553 | 567 | background-color: aliceblue; |
| 554 | 568 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -537,17 +537,31 @@ | |
| 537 | width: 100%; |
| 538 | border-spacing: 0; |
| 539 | border: 1px solid black; |
| 540 | } |
| 541 | table.diff td.diffln{ |
| 542 | padding: 0 0.25em 0 0.5em; |
| 543 | } |
| 544 | table.diff td { |
| 545 | vertical-align: top; |
| 546 | } |
| 547 | table.diff pre { |
| 548 | margin: 0 0 0 0; |
| 549 | } |
| 550 | tr.diffskip.jchunk { |
| 551 | /* jchunk gets added from JS to diffskip rows when they are |
| 552 | plugged into the /jchunk route. */ |
| 553 | background-color: aliceblue; |
| 554 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -537,17 +537,31 @@ | |
| 537 | width: 100%; |
| 538 | border-spacing: 0; |
| 539 | border: 1px solid black; |
| 540 | } |
| 541 | table.diff td.diffln{ |
| 542 | padding: 0; |
| 543 | } |
| 544 | table.diff td.diffln > pre{ |
| 545 | padding: 0 0.25em 0 0.5em; |
| 546 | margin: 0; |
| 547 | } |
| 548 | table.diff td { |
| 549 | vertical-align: top; |
| 550 | padding: 0; |
| 551 | overflow: hidden /*work around inner PRE slight overflow/overlap*/; |
| 552 | } |
| 553 | table.diff pre { |
| 554 | margin: 0 0 0 0; |
| 555 | padding: 0 0.5em; |
| 556 | } |
| 557 | table.diff td.diffln > pre { |
| 558 | padding: 0 0.35em 0 0.5em; |
| 559 | } |
| 560 | table.diff td.difftxt > pre { |
| 561 | min-width: 100%; |
| 562 | max-width: 100%; |
| 563 | } |
| 564 | tr.diffskip.jchunk { |
| 565 | /* jchunk gets added from JS to diffskip rows when they are |
| 566 | plugged into the /jchunk route. */ |
| 567 | background-color: aliceblue; |
| 568 |
+19
-13
| --- src/fossil.diff.js | ||
| +++ src/fossil.diff.js | ||
| @@ -689,23 +689,25 @@ | ||
| 689 | 689 | } |
| 690 | 690 | f.colsR.forEach(function(e){ |
| 691 | 691 | e.style.width = w + "px"; |
| 692 | 692 | e.style.maxWidth = w + "px"; |
| 693 | 693 | }); |
| 694 | - if(!f.allDiffs){ | |
| 695 | - f.allDiffs = document.querySelectorAll('table.diff'); | |
| 696 | - } | |
| 697 | - w = lastWidth; | |
| 698 | - f.allDiffs.forEach(function f(e){ | |
| 699 | - if(!f.$){ | |
| 700 | - f.$ = e.getClientRects()[0]; | |
| 701 | - console.debug("diff table w =",w," f.$x",f.$); | |
| 702 | - w - 2*f.$.x /* left margin (assume right==left, for simplicity) */; | |
| 703 | - } | |
| 704 | - e.style.maxWidth = w + "px"; | |
| 705 | - }); | |
| 706 | - //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth); | |
| 694 | + if(0){ // seems to be unnecessary | |
| 695 | + if(!f.allDiffs){ | |
| 696 | + f.allDiffs = document.querySelectorAll('table.diff'); | |
| 697 | + } | |
| 698 | + w = lastWidth; | |
| 699 | + f.allDiffs.forEach(function f(e){ | |
| 700 | + if(0 && !f.$){ | |
| 701 | + f.$ = e.getClientRects()[0]; | |
| 702 | + console.debug("diff table w =",w," f.$x",f.$); | |
| 703 | + w - 2*f.$.x /* left margin (assume right==left, for simplicity) */; | |
| 704 | + } | |
| 705 | + e.style.maxWidth = w + "px"; | |
| 706 | + }); | |
| 707 | + //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth); | |
| 708 | + } | |
| 707 | 709 | return this; |
| 708 | 710 | }; |
| 709 | 711 | |
| 710 | 712 | const scrollLeft = function(event){ |
| 711 | 713 | //console.debug("scrollLeft",this,event); |
| @@ -744,10 +746,14 @@ | ||
| 744 | 746 | diff.addEventListener('keydown', function(e){ |
| 745 | 747 | e = e || event; |
| 746 | 748 | const len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode]; |
| 747 | 749 | if( !len ) return; |
| 748 | 750 | this.$txtPres[0].scrollLeft += len; |
| 751 | + /* ^^^ bug: if there is a 2nd column and it has a scrollbar | |
| 752 | + but txtPres[0] does not, no scrolling happens here. We need | |
| 753 | + to find the widest of txtPres and scroll that one. Example: | |
| 754 | + Checkin a7fbefee38a1c522 file diff.c */ | |
| 749 | 755 | return false; |
| 750 | 756 | }, false); |
| 751 | 757 | } |
| 752 | 758 | return this; |
| 753 | 759 | } |
| 754 | 760 |
| --- src/fossil.diff.js | |
| +++ src/fossil.diff.js | |
| @@ -689,23 +689,25 @@ | |
| 689 | } |
| 690 | f.colsR.forEach(function(e){ |
| 691 | e.style.width = w + "px"; |
| 692 | e.style.maxWidth = w + "px"; |
| 693 | }); |
| 694 | if(!f.allDiffs){ |
| 695 | f.allDiffs = document.querySelectorAll('table.diff'); |
| 696 | } |
| 697 | w = lastWidth; |
| 698 | f.allDiffs.forEach(function f(e){ |
| 699 | if(!f.$){ |
| 700 | f.$ = e.getClientRects()[0]; |
| 701 | console.debug("diff table w =",w," f.$x",f.$); |
| 702 | w - 2*f.$.x /* left margin (assume right==left, for simplicity) */; |
| 703 | } |
| 704 | e.style.maxWidth = w + "px"; |
| 705 | }); |
| 706 | //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth); |
| 707 | return this; |
| 708 | }; |
| 709 | |
| 710 | const scrollLeft = function(event){ |
| 711 | //console.debug("scrollLeft",this,event); |
| @@ -744,10 +746,14 @@ | |
| 744 | diff.addEventListener('keydown', function(e){ |
| 745 | e = e || event; |
| 746 | const len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode]; |
| 747 | if( !len ) return; |
| 748 | this.$txtPres[0].scrollLeft += len; |
| 749 | return false; |
| 750 | }, false); |
| 751 | } |
| 752 | return this; |
| 753 | } |
| 754 |
| --- src/fossil.diff.js | |
| +++ src/fossil.diff.js | |
| @@ -689,23 +689,25 @@ | |
| 689 | } |
| 690 | f.colsR.forEach(function(e){ |
| 691 | e.style.width = w + "px"; |
| 692 | e.style.maxWidth = w + "px"; |
| 693 | }); |
| 694 | if(0){ // seems to be unnecessary |
| 695 | if(!f.allDiffs){ |
| 696 | f.allDiffs = document.querySelectorAll('table.diff'); |
| 697 | } |
| 698 | w = lastWidth; |
| 699 | f.allDiffs.forEach(function f(e){ |
| 700 | if(0 && !f.$){ |
| 701 | f.$ = e.getClientRects()[0]; |
| 702 | console.debug("diff table w =",w," f.$x",f.$); |
| 703 | w - 2*f.$.x /* left margin (assume right==left, for simplicity) */; |
| 704 | } |
| 705 | e.style.maxWidth = w + "px"; |
| 706 | }); |
| 707 | //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth); |
| 708 | } |
| 709 | return this; |
| 710 | }; |
| 711 | |
| 712 | const scrollLeft = function(event){ |
| 713 | //console.debug("scrollLeft",this,event); |
| @@ -744,10 +746,14 @@ | |
| 746 | diff.addEventListener('keydown', function(e){ |
| 747 | e = e || event; |
| 748 | const len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode]; |
| 749 | if( !len ) return; |
| 750 | this.$txtPres[0].scrollLeft += len; |
| 751 | /* ^^^ bug: if there is a 2nd column and it has a scrollbar |
| 752 | but txtPres[0] does not, no scrolling happens here. We need |
| 753 | to find the widest of txtPres and scroll that one. Example: |
| 754 | Checkin a7fbefee38a1c522 file diff.c */ |
| 755 | return false; |
| 756 | }, false); |
| 757 | } |
| 758 | return this; |
| 759 | } |
| 760 |