Fossil SCM

Replace the JavaScript-based side-by-side diff view with a CSS Grid, as discussed in [forum:93398561d3986c41|forum post 93398561d3986c41].

stephan 2024-08-05 15:10 trunk merge
Commit 71e9ca7869f0307c81dca9006c25621f12638d53cda854fd03d3623fe7a44946
+21 -3
--- src/default.css
+++ src/default.css
@@ -663,27 +663,45 @@
663663
content: '⇣';
664664
}
665665
tr.diffskip > td.chunkctrl .jcbutton.up.down > span::before {
666666
content: '⇡⇣';
667667
}
668
-
669668
tr.diffskip > td.chunkctrl .jcbutton:hover {
670669
cursor: pointer;
671670
opacity: 1;
672671
filter: contrast(1);
673672
}
673
+tr.diffchunk {
674
+ display: grid;
675
+ gap: 0px 0px;
676
+ grid-template-rows: 1fr;
677
+}
678
+table.splitdiff tr.diffchunk {
679
+ grid-template-columns: auto 1fr auto auto 1fr;
680
+ grid-template-areas: "difflnl difftxtl diffsep difflnr difftxtr";
681
+}
682
+table.udiff tr.diffchunk {
683
+ grid-template-columns: auto auto auto 1fr;
684
+ grid-template-areas: "difflnl difflnr diffsep difftxtu";
685
+}
686
+td.difflnl { grid-area: difflnl; }
687
+td.difflnr { grid-area: difflnr; }
688
+td.difftxtu { grid-area: difftxtu; }
689
+td.difftxtl { grid-area: difftxtl; }
690
+td.difftxtr { grid-area: difftxtr; }
674691
td.diffln {
675
- width: 1px;
692
+ width: fit-content;
676693
text-align: right;
677694
padding: 0 1em 0 0;
678695
}
679696
td.difflne {
680697
padding-bottom: 0.4em;
681698
}
682699
td.diffsep {
683
- width: 1px;
700
+ width: fit-content;
684701
padding: 0 0.3em 0 0.5em;
702
+ grid-area: diffsep;
685703
}
686704
td.difftxt pre {
687705
overflow-x: auto;
688706
}
689707
td.diffln ins {
690708
--- src/default.css
+++ src/default.css
@@ -663,27 +663,45 @@
663 content: '⇣';
664 }
665 tr.diffskip > td.chunkctrl .jcbutton.up.down > span::before {
666 content: '⇡⇣';
667 }
668
669 tr.diffskip > td.chunkctrl .jcbutton:hover {
670 cursor: pointer;
671 opacity: 1;
672 filter: contrast(1);
673 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
674 td.diffln {
675 width: 1px;
676 text-align: right;
677 padding: 0 1em 0 0;
678 }
679 td.difflne {
680 padding-bottom: 0.4em;
681 }
682 td.diffsep {
683 width: 1px;
684 padding: 0 0.3em 0 0.5em;
 
685 }
686 td.difftxt pre {
687 overflow-x: auto;
688 }
689 td.diffln ins {
690
--- src/default.css
+++ src/default.css
@@ -663,27 +663,45 @@
663 content: '⇣';
664 }
665 tr.diffskip > td.chunkctrl .jcbutton.up.down > span::before {
666 content: '⇡⇣';
667 }
 
668 tr.diffskip > td.chunkctrl .jcbutton:hover {
669 cursor: pointer;
670 opacity: 1;
671 filter: contrast(1);
672 }
673 tr.diffchunk {
674 display: grid;
675 gap: 0px 0px;
676 grid-template-rows: 1fr;
677 }
678 table.splitdiff tr.diffchunk {
679 grid-template-columns: auto 1fr auto auto 1fr;
680 grid-template-areas: "difflnl difftxtl diffsep difflnr difftxtr";
681 }
682 table.udiff tr.diffchunk {
683 grid-template-columns: auto auto auto 1fr;
684 grid-template-areas: "difflnl difflnr diffsep difftxtu";
685 }
686 td.difflnl { grid-area: difflnl; }
687 td.difflnr { grid-area: difflnr; }
688 td.difftxtu { grid-area: difftxtu; }
689 td.difftxtl { grid-area: difftxtl; }
690 td.difftxtr { grid-area: difftxtr; }
691 td.diffln {
692 width: fit-content;
693 text-align: right;
694 padding: 0 1em 0 0;
695 }
696 td.difflne {
697 padding-bottom: 0.4em;
698 }
699 td.diffsep {
700 width: fit-content;
701 padding: 0 0.3em 0 0.5em;
702 grid-area: diffsep;
703 }
704 td.difftxt pre {
705 overflow-x: auto;
706 }
707 td.diffln ins {
708
+2 -2
--- src/diff.c
+++ src/diff.c
@@ -1286,11 +1286,11 @@
12861286
blob_append_xfer(p->pOut, &p->aCol[2]);
12871287
blob_append(p->pOut, "</pre></td></tr>\n", -1);
12881288
}
12891289
static void dfunifiedStartRow(DiffBuilder *p){
12901290
if( blob_size(&p->aCol[0])>0 ) return;
1291
- blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
1291
+ blob_appendf(p->pOut,"<tr id=\"chunk%d\" class=\"diffchunk\">"
12921292
"<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
12931293
}
12941294
static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
12951295
dfunifiedFinishRow(p);
12961296
if( p->pCfg && p->pCfg->zLeftHash ){
@@ -1512,11 +1512,11 @@
15121512
blob_append_xfer(p->pOut, &p->aCol[3]);
15131513
blob_append(p->pOut, "</pre></td></tr>\n", -1);
15141514
}
15151515
static void dfsplitStartRow(DiffBuilder *p){
15161516
if( blob_size(&p->aCol[0])>0 ) return;
1517
- blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
1517
+ blob_appendf(p->pOut,"<tr id=\"chunk%d\" class=\"diffchunk\">"
15181518
"<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
15191519
p->eState = 0;
15201520
}
15211521
static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
15221522
dfsplitFinishRow(p);
15231523
--- src/diff.c
+++ src/diff.c
@@ -1286,11 +1286,11 @@
1286 blob_append_xfer(p->pOut, &p->aCol[2]);
1287 blob_append(p->pOut, "</pre></td></tr>\n", -1);
1288 }
1289 static void dfunifiedStartRow(DiffBuilder *p){
1290 if( blob_size(&p->aCol[0])>0 ) return;
1291 blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
1292 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1293 }
1294 static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
1295 dfunifiedFinishRow(p);
1296 if( p->pCfg && p->pCfg->zLeftHash ){
@@ -1512,11 +1512,11 @@
1512 blob_append_xfer(p->pOut, &p->aCol[3]);
1513 blob_append(p->pOut, "</pre></td></tr>\n", -1);
1514 }
1515 static void dfsplitStartRow(DiffBuilder *p){
1516 if( blob_size(&p->aCol[0])>0 ) return;
1517 blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
1518 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1519 p->eState = 0;
1520 }
1521 static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
1522 dfsplitFinishRow(p);
1523
--- src/diff.c
+++ src/diff.c
@@ -1286,11 +1286,11 @@
1286 blob_append_xfer(p->pOut, &p->aCol[2]);
1287 blob_append(p->pOut, "</pre></td></tr>\n", -1);
1288 }
1289 static void dfunifiedStartRow(DiffBuilder *p){
1290 if( blob_size(&p->aCol[0])>0 ) return;
1291 blob_appendf(p->pOut,"<tr id=\"chunk%d\" class=\"diffchunk\">"
1292 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1293 }
1294 static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
1295 dfunifiedFinishRow(p);
1296 if( p->pCfg && p->pCfg->zLeftHash ){
@@ -1512,11 +1512,11 @@
1512 blob_append_xfer(p->pOut, &p->aCol[3]);
1513 blob_append(p->pOut, "</pre></td></tr>\n", -1);
1514 }
1515 static void dfsplitStartRow(DiffBuilder *p){
1516 if( blob_size(&p->aCol[0])>0 ) return;
1517 blob_appendf(p->pOut,"<tr id=\"chunk%d\" class=\"diffchunk\">"
1518 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1519 p->eState = 0;
1520 }
1521 static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
1522 dfsplitFinishRow(p);
1523
+1 -138
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -106,11 +106,11 @@
106106
getLHS ? 1 : (isSplit ? 4 : 2)
107107
)+')');
108108
const m = f.rx[getStart ? 'start' : 'end'].exec(td.innerText);
109109
return m ? +m[1] : undefined/*"shouldn't happen"*/;
110110
};
111
-
111
+
112112
/**
113113
Installs chunk-loading controls into TR.diffskip element tr.
114114
Each instance corresponds to a single TR.diffskip element.
115115
116116
The goal is to base these controls roughly on github's, a good
@@ -400,11 +400,10 @@
400400
if(joinTr){
401401
content.push(trNext.querySelector(selector).innerHTML);
402402
}
403403
td.innerHTML = content.join('');
404404
if(joinTr) D.remove(joinTr);
405
- Diff.checkTableWidth(true);
406405
this.destroy();
407406
return this;
408407
}else if(this.FetchType.PrevDown===fetchType){
409408
/* Append context to previous TR. */
410409
// RHS line numbers...
@@ -429,11 +428,10 @@
429428
this.destroy();
430429
}else{
431430
this.maybeReplaceButtons();
432431
this.updatePosDebug();
433432
}
434
- Diff.checkTableWidth(true);
435433
return this;
436434
}else if(this.FetchType.NextUp===fetchType){
437435
/* Prepend content to next TR. */
438436
// RHS line numbers...
439437
if(doAppend){
@@ -458,11 +456,10 @@
458456
this.destroy();
459457
}else{
460458
this.maybeReplaceButtons();
461459
this.updatePosDebug();
462460
}
463
- Diff.checkTableWidth(true);
464461
return this;
465462
}else{
466463
throw new Error("Unexpected 'fetchType' value.");
467464
}
468465
},
@@ -623,139 +620,5 @@
623620
});
624621
return F;
625622
};
626623
Diff.setupDiffContextLoad();
627624
});
628
-
629
-/* Refinements to the display of unified and side-by-side diffs.
630
-**
631
-** In all cases, the table columns tagged with "difftxt" are expanded,
632
-** where possible, to fill the width of the screen.
633
-**
634
-** For a side-by-side diff, if either column is two wide to fit on the
635
-** display, scrollbars are added. The scrollbars are linked, so that
636
-** both sides scroll together. Left and right arrows also scroll.
637
-*/
638
-window.fossil.onPageLoad(function(){
639
- const SCROLL_LEN = 25;
640
- const F = window.fossil, D = F.dom, Diff = F.diff;
641
- var lastWidth;
642
- Diff.checkTableWidth = function f(force){
643
- if(undefined === f.contentNode){
644
- f.contentNode = document.querySelector('div.content');
645
- }
646
- force = true;
647
- const parentCS = window.getComputedStyle(f.contentNode);
648
- const parentWidth = (
649
- //document.body.clientWidth;
650
- //parentCS.width;
651
- f.contentNode.clientWidth
652
- - parseFloat(parentCS.marginLeft) - parseFloat(parentCS.marginRight)
653
- );
654
- if( !force && parentWidth===lastWidth ) return this;
655
- lastWidth = parentWidth;
656
- let w = lastWidth*0.5 - 100;
657
- //console.debug( "w = ",w,", lastWidth =",lastWidth," body = ",document.body.clientWidth);
658
- if(force || !f.colsL){
659
- f.colsL = document.querySelectorAll('td.difftxtl pre');
660
- }
661
- f.colsL.forEach(function(e){
662
- e.style.width = w + "px";
663
- e.style.maxWidth = w + "px";
664
- });
665
- if(force || !f.colsR){
666
- f.colsR = document.querySelectorAll('td.difftxtr pre');
667
- }
668
- f.colsR.forEach(function(e){
669
- e.style.width = w + "px";
670
- e.style.maxWidth = w + "px";
671
- });
672
- if(force || !f.colsU){
673
- f.colsU = document.querySelectorAll('td.difftxtu pre');
674
- }
675
- f.colsU.forEach(function(e){
676
- w = lastWidth - 3; // Outer border
677
- var k = e.parentElement/*TD*/;
678
- while(k = k.previousElementSibling/*TD*/) w -= k.scrollWidth;
679
- e.style.width = w + "px";
680
- e.style.maxWidth = w + "px";
681
- });
682
- if(0){ // seems to be unnecessary
683
- if(!f.allDiffs){
684
- f.allDiffs = document.querySelectorAll('table.diff');
685
- }
686
- w = lastWidth;
687
- f.allDiffs.forEach(function f(e){
688
- if(0 && !f.$){
689
- f.$ = e.getClientRects()[0];
690
- console.debug("diff table w =",w," f.$x",f.$);
691
- w - 2*f.$.x /* left margin (assume right==left, for simplicity) */;
692
- }
693
- e.style.maxWidth = w + "px";
694
- });
695
- //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth);
696
- }
697
- return this;
698
- };
699
-
700
- const scrollLeft = function(event){
701
- //console.debug("scrollLeft",this,event);
702
- const table = this.parentElement/*TD*/.parentElement/*TR*/.
703
- parentElement/*TBODY*/.parentElement/*TABLE*/;
704
- table.$txtPres.forEach((e)=>(e===this) ? 1 : (e.scrollLeft = this.scrollLeft));
705
- return false;
706
- };
707
- Diff.initTableDiff = function f(diff, unifiedDiffs){
708
- if(!diff){
709
- let i, diffs;
710
- diffs = document.querySelectorAll('table.splitdiff');
711
- for(i=0; i<diffs.length; ++i){
712
- f.call(this, diffs[i], false);
713
- }
714
- diffs = document.querySelectorAll('table.udiff');
715
- for(i=0; i<diffs.length; ++i){
716
- f.call(this, diffs[i], true);
717
- }
718
- return this;
719
- }
720
- diff.$txtCols = diff.querySelectorAll('td.difftxt');
721
- diff.$txtPres = diff.querySelectorAll('td.difftxt pre');
722
- var width = 0;
723
- diff.$txtPres.forEach(function(e){
724
- if(width < e.scrollWidth) width = e.scrollWidth;
725
- });
726
- //console.debug("diff.$txtPres =",diff.$txtPres);
727
- diff.$txtCols.forEach((e)=>e.style.width = width + 'px');
728
- diff.$txtPres.forEach(function(e){
729
- e.style.maxWidth = width + 'px';
730
- e.style.width = width + 'px';
731
- if(!unifiedDiffs && !e.classList.contains('scroller')){
732
- D.addClass(e, 'scroller');
733
- e.addEventListener('scroll', scrollLeft, false);
734
- }
735
- });
736
- if(!unifiedDiffs){
737
- diff.tabIndex = 0;
738
- if(!diff.classList.contains('scroller')){
739
- D.addClass(diff, 'scroller');
740
- diff.addEventListener('keydown', function(e){
741
- e = e || event;
742
- const len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode];
743
- if( !len ) return;
744
- this.$txtPres[0].scrollLeft += len;
745
- /* ^^^ bug: if there is a 2nd column and it has a scrollbar
746
- but txtPres[0] does not, no scrolling happens here. We need
747
- to find the widest of txtPres and scroll that one. Example:
748
- Checkin a7fbefee38a1c522 file diff.c */
749
- return false;
750
- }, false);
751
- }
752
- }
753
- return this;
754
- }
755
- window.fossil.page.tweakSbsDiffs = function(){
756
- document.querySelectorAll('table.splitdiff').forEach((e)=>Diff.initTableDiff(e));
757
- Diff.checkTableWidth();
758
- };
759
- Diff.initTableDiff().checkTableWidth();
760
- window.addEventListener('resize', F.debounce(()=>Diff.checkTableWidth()));
761
-}, false);
762625
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -106,11 +106,11 @@
106 getLHS ? 1 : (isSplit ? 4 : 2)
107 )+')');
108 const m = f.rx[getStart ? 'start' : 'end'].exec(td.innerText);
109 return m ? +m[1] : undefined/*"shouldn't happen"*/;
110 };
111
112 /**
113 Installs chunk-loading controls into TR.diffskip element tr.
114 Each instance corresponds to a single TR.diffskip element.
115
116 The goal is to base these controls roughly on github's, a good
@@ -400,11 +400,10 @@
400 if(joinTr){
401 content.push(trNext.querySelector(selector).innerHTML);
402 }
403 td.innerHTML = content.join('');
404 if(joinTr) D.remove(joinTr);
405 Diff.checkTableWidth(true);
406 this.destroy();
407 return this;
408 }else if(this.FetchType.PrevDown===fetchType){
409 /* Append context to previous TR. */
410 // RHS line numbers...
@@ -429,11 +428,10 @@
429 this.destroy();
430 }else{
431 this.maybeReplaceButtons();
432 this.updatePosDebug();
433 }
434 Diff.checkTableWidth(true);
435 return this;
436 }else if(this.FetchType.NextUp===fetchType){
437 /* Prepend content to next TR. */
438 // RHS line numbers...
439 if(doAppend){
@@ -458,11 +456,10 @@
458 this.destroy();
459 }else{
460 this.maybeReplaceButtons();
461 this.updatePosDebug();
462 }
463 Diff.checkTableWidth(true);
464 return this;
465 }else{
466 throw new Error("Unexpected 'fetchType' value.");
467 }
468 },
@@ -623,139 +620,5 @@
623 });
624 return F;
625 };
626 Diff.setupDiffContextLoad();
627 });
628
629 /* Refinements to the display of unified and side-by-side diffs.
630 **
631 ** In all cases, the table columns tagged with "difftxt" are expanded,
632 ** where possible, to fill the width of the screen.
633 **
634 ** For a side-by-side diff, if either column is two wide to fit on the
635 ** display, scrollbars are added. The scrollbars are linked, so that
636 ** both sides scroll together. Left and right arrows also scroll.
637 */
638 window.fossil.onPageLoad(function(){
639 const SCROLL_LEN = 25;
640 const F = window.fossil, D = F.dom, Diff = F.diff;
641 var lastWidth;
642 Diff.checkTableWidth = function f(force){
643 if(undefined === f.contentNode){
644 f.contentNode = document.querySelector('div.content');
645 }
646 force = true;
647 const parentCS = window.getComputedStyle(f.contentNode);
648 const parentWidth = (
649 //document.body.clientWidth;
650 //parentCS.width;
651 f.contentNode.clientWidth
652 - parseFloat(parentCS.marginLeft) - parseFloat(parentCS.marginRight)
653 );
654 if( !force && parentWidth===lastWidth ) return this;
655 lastWidth = parentWidth;
656 let w = lastWidth*0.5 - 100;
657 //console.debug( "w = ",w,", lastWidth =",lastWidth," body = ",document.body.clientWidth);
658 if(force || !f.colsL){
659 f.colsL = document.querySelectorAll('td.difftxtl pre');
660 }
661 f.colsL.forEach(function(e){
662 e.style.width = w + "px";
663 e.style.maxWidth = w + "px";
664 });
665 if(force || !f.colsR){
666 f.colsR = document.querySelectorAll('td.difftxtr pre');
667 }
668 f.colsR.forEach(function(e){
669 e.style.width = w + "px";
670 e.style.maxWidth = w + "px";
671 });
672 if(force || !f.colsU){
673 f.colsU = document.querySelectorAll('td.difftxtu pre');
674 }
675 f.colsU.forEach(function(e){
676 w = lastWidth - 3; // Outer border
677 var k = e.parentElement/*TD*/;
678 while(k = k.previousElementSibling/*TD*/) w -= k.scrollWidth;
679 e.style.width = w + "px";
680 e.style.maxWidth = w + "px";
681 });
682 if(0){ // seems to be unnecessary
683 if(!f.allDiffs){
684 f.allDiffs = document.querySelectorAll('table.diff');
685 }
686 w = lastWidth;
687 f.allDiffs.forEach(function f(e){
688 if(0 && !f.$){
689 f.$ = e.getClientRects()[0];
690 console.debug("diff table w =",w," f.$x",f.$);
691 w - 2*f.$.x /* left margin (assume right==left, for simplicity) */;
692 }
693 e.style.maxWidth = w + "px";
694 });
695 //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth);
696 }
697 return this;
698 };
699
700 const scrollLeft = function(event){
701 //console.debug("scrollLeft",this,event);
702 const table = this.parentElement/*TD*/.parentElement/*TR*/.
703 parentElement/*TBODY*/.parentElement/*TABLE*/;
704 table.$txtPres.forEach((e)=>(e===this) ? 1 : (e.scrollLeft = this.scrollLeft));
705 return false;
706 };
707 Diff.initTableDiff = function f(diff, unifiedDiffs){
708 if(!diff){
709 let i, diffs;
710 diffs = document.querySelectorAll('table.splitdiff');
711 for(i=0; i<diffs.length; ++i){
712 f.call(this, diffs[i], false);
713 }
714 diffs = document.querySelectorAll('table.udiff');
715 for(i=0; i<diffs.length; ++i){
716 f.call(this, diffs[i], true);
717 }
718 return this;
719 }
720 diff.$txtCols = diff.querySelectorAll('td.difftxt');
721 diff.$txtPres = diff.querySelectorAll('td.difftxt pre');
722 var width = 0;
723 diff.$txtPres.forEach(function(e){
724 if(width < e.scrollWidth) width = e.scrollWidth;
725 });
726 //console.debug("diff.$txtPres =",diff.$txtPres);
727 diff.$txtCols.forEach((e)=>e.style.width = width + 'px');
728 diff.$txtPres.forEach(function(e){
729 e.style.maxWidth = width + 'px';
730 e.style.width = width + 'px';
731 if(!unifiedDiffs && !e.classList.contains('scroller')){
732 D.addClass(e, 'scroller');
733 e.addEventListener('scroll', scrollLeft, false);
734 }
735 });
736 if(!unifiedDiffs){
737 diff.tabIndex = 0;
738 if(!diff.classList.contains('scroller')){
739 D.addClass(diff, 'scroller');
740 diff.addEventListener('keydown', function(e){
741 e = e || event;
742 const len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode];
743 if( !len ) return;
744 this.$txtPres[0].scrollLeft += len;
745 /* ^^^ bug: if there is a 2nd column and it has a scrollbar
746 but txtPres[0] does not, no scrolling happens here. We need
747 to find the widest of txtPres and scroll that one. Example:
748 Checkin a7fbefee38a1c522 file diff.c */
749 return false;
750 }, false);
751 }
752 }
753 return this;
754 }
755 window.fossil.page.tweakSbsDiffs = function(){
756 document.querySelectorAll('table.splitdiff').forEach((e)=>Diff.initTableDiff(e));
757 Diff.checkTableWidth();
758 };
759 Diff.initTableDiff().checkTableWidth();
760 window.addEventListener('resize', F.debounce(()=>Diff.checkTableWidth()));
761 }, false);
762
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -106,11 +106,11 @@
106 getLHS ? 1 : (isSplit ? 4 : 2)
107 )+')');
108 const m = f.rx[getStart ? 'start' : 'end'].exec(td.innerText);
109 return m ? +m[1] : undefined/*"shouldn't happen"*/;
110 };
111
112 /**
113 Installs chunk-loading controls into TR.diffskip element tr.
114 Each instance corresponds to a single TR.diffskip element.
115
116 The goal is to base these controls roughly on github's, a good
@@ -400,11 +400,10 @@
400 if(joinTr){
401 content.push(trNext.querySelector(selector).innerHTML);
402 }
403 td.innerHTML = content.join('');
404 if(joinTr) D.remove(joinTr);
 
405 this.destroy();
406 return this;
407 }else if(this.FetchType.PrevDown===fetchType){
408 /* Append context to previous TR. */
409 // RHS line numbers...
@@ -429,11 +428,10 @@
428 this.destroy();
429 }else{
430 this.maybeReplaceButtons();
431 this.updatePosDebug();
432 }
 
433 return this;
434 }else if(this.FetchType.NextUp===fetchType){
435 /* Prepend content to next TR. */
436 // RHS line numbers...
437 if(doAppend){
@@ -458,11 +456,10 @@
456 this.destroy();
457 }else{
458 this.maybeReplaceButtons();
459 this.updatePosDebug();
460 }
 
461 return this;
462 }else{
463 throw new Error("Unexpected 'fetchType' value.");
464 }
465 },
@@ -623,139 +620,5 @@
620 });
621 return F;
622 };
623 Diff.setupDiffContextLoad();
624 });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
625
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -1245,11 +1245,10 @@
12451245
self.finfo.checkin,
12461246
"]</code> &rarr; Local Edits</div>",
12471247
c||'No changes.'
12481248
].join(''));
12491249
F.diff.setupDiffContextLoad();
1250
- if(sbs) P.tweakSbsDiffs();
12511250
F.message('Updated diff.');
12521251
self.tabs.switchToTab(self.e.tabs.diff);
12531252
}
12541253
});
12551254
return this;
12561255
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -1245,11 +1245,10 @@
1245 self.finfo.checkin,
1246 "]</code> &rarr; Local Edits</div>",
1247 c||'No changes.'
1248 ].join(''));
1249 F.diff.setupDiffContextLoad();
1250 if(sbs) P.tweakSbsDiffs();
1251 F.message('Updated diff.');
1252 self.tabs.switchToTab(self.e.tabs.diff);
1253 }
1254 });
1255 return this;
1256
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -1245,11 +1245,10 @@
1245 self.finfo.checkin,
1246 "]</code> &rarr; Local Edits</div>",
1247 c||'No changes.'
1248 ].join(''));
1249 F.diff.setupDiffContextLoad();
 
1250 F.message('Updated diff.');
1251 self.tabs.switchToTab(self.e.tabs.diff);
1252 }
1253 });
1254 return this;
1255
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -1545,11 +1545,10 @@
15451545
self.winfo.name,
15461546
"]</code> &rarr; Local Edits</div>",
15471547
c||'No changes.'
15481548
].join(''));
15491549
F.diff.setupDiffContextLoad();
1550
- if(sbs) P.tweakSbsDiffs();
15511550
F.message('Updated diff.');
15521551
self.tabs.switchToTab(self.e.tabs.diff);
15531552
}
15541553
});
15551554
return this;
@@ -1654,7 +1653,6 @@
16541653
filename/checkin values), return it, else return undefined.
16551654
*/
16561655
P.getStashedWinfo = function(winfo){
16571656
return $stash.getWinfo(winfo);
16581657
};
1659
-
16601658
})(window.fossil);
16611659
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -1545,11 +1545,10 @@
1545 self.winfo.name,
1546 "]</code> &rarr; Local Edits</div>",
1547 c||'No changes.'
1548 ].join(''));
1549 F.diff.setupDiffContextLoad();
1550 if(sbs) P.tweakSbsDiffs();
1551 F.message('Updated diff.');
1552 self.tabs.switchToTab(self.e.tabs.diff);
1553 }
1554 });
1555 return this;
@@ -1654,7 +1653,6 @@
1654 filename/checkin values), return it, else return undefined.
1655 */
1656 P.getStashedWinfo = function(winfo){
1657 return $stash.getWinfo(winfo);
1658 };
1659
1660 })(window.fossil);
1661
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -1545,11 +1545,10 @@
1545 self.winfo.name,
1546 "]</code> &rarr; Local Edits</div>",
1547 c||'No changes.'
1548 ].join(''));
1549 F.diff.setupDiffContextLoad();
 
1550 F.message('Updated diff.');
1551 self.tabs.switchToTab(self.e.tabs.diff);
1552 }
1553 });
1554 return this;
@@ -1654,7 +1653,6 @@
1653 filename/checkin values), return it, else return undefined.
1654 */
1655 P.getStashedWinfo = function(winfo){
1656 return $stash.getWinfo(winfo);
1657 };
 
1658 })(window.fossil);
1659

Keyboard Shortcuts

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