Fossil

Check-in [fd7d2557aa]
Login

Check-in [fd7d2557aa]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor tweaks in the diff-related JS and CSS.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | diff-js-refactoring
Files: files | file ages | folders
SHA3-256: fd7d2557aa2a31c491abf4d44c3827c503a1d05c9dd3416d80509c1a635ae8d6
User & Date: stephan 2021-09-08 02:43:40.987
Context
2021-09-08
17:36
Merge in trunk for manifest_parse() output fix and "hidden" ajax routes. ... (check-in: f68b0b7187 user: stephan tags: diff-js-refactoring)
02:43
Minor tweaks in the diff-related JS and CSS. ... (check-in: fd7d2557aa user: stephan tags: diff-js-refactoring)
2021-09-07
23:08
Optimize diff.js's width updater to only perform DOM selection when it's first run. Also delay its execution until the onload event. ... (check-in: 077f3db109 user: stephan tags: diff-js-refactoring)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/default.css.
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
}
ul.filelist li {
  padding-top: 1px;
}

/* Rules governing diff layout and colors */
table.diff {
  width: 98%;
  border-spacing: 0;
  border: 1px solid black;
  padding: 0 0.5em;
}
table.diff td {
  vertical-align: top;
}







|







530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
}
ul.filelist li {
  padding-top: 1px;
}

/* Rules governing diff layout and colors */
table.diff {
  width: 100%;
  border-spacing: 0;
  border: 1px solid black;
  padding: 0 0.5em;
}
table.diff td {
  vertical-align: top;
}
Changes to src/diff.js.
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
69
70
71
72
  for(i=0; i<diffs.length; i++){
    initDiff(diffs[i]);
  }
  const checkWidth = function f(){
    if(undefined === f.lastWidth){
      f.lastWidth = 0;
    }
    if( document.body.clientWidth!=f.lastWidth ){
      f.lastWidth = document.body.clientWidth;
      var w = f.lastWidth*0.5 - 100;
      if(!f.colsL){
        f.colsL = document.querySelectorAll('td.difftxtl pre');
      }
      for(let i=0; i<f.colsL.length; i++){
        f.colsL[i].style.width = w + "px";
        f.colsL[i].style.maxWidth = w + "px";
      }
      if(!f.colsR){
        f.colsR = document.querySelectorAll('td.difftxtr pre');
      }
      for(let i=0; i<f.colsR.length; i++){
        f.colsR[i].style.width = w + "px";
        f.colsR[i].style.maxWidth = w + "px";
      }
      if(!f.allDiffs){
        f.allDiffs = document.querySelectorAll('table.diff');
      }
      w = f.lastWidth;
      for(let i=0; i<f.allDiffs.length; i++){
        f.allDiffs[i].style.width = '100%'; // setting to w causes unsightly horiz. scrollbar
        f.allDiffs[i].style.maxWidth = w + "px";
      }
    }
  };
  checkWidth();
  window.addEventListener('resize', checkWidth);
}, false);







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<





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
69
70
71
  for(i=0; i<diffs.length; i++){
    initDiff(diffs[i]);
  }
  const checkWidth = function f(){
    if(undefined === f.lastWidth){
      f.lastWidth = 0;
    }
    if( document.body.clientWidth===f.lastWidth ) return;
    f.lastWidth = document.body.clientWidth;
    var w = f.lastWidth*0.5 - 100;
    if(!f.colsL){
      f.colsL = document.querySelectorAll('td.difftxtl pre');
    }
    for(let i=0; i<f.colsL.length; i++){
      f.colsL[i].style.width = w + "px";
      f.colsL[i].style.maxWidth = w + "px";
    }
    if(!f.colsR){
      f.colsR = document.querySelectorAll('td.difftxtr pre');
    }
    for(let i=0; i<f.colsR.length; i++){
      f.colsR[i].style.width = w + "px";
      f.colsR[i].style.maxWidth = w + "px";
    }
    if(!f.allDiffs){
      f.allDiffs = document.querySelectorAll('table.diff');
    }
    w = f.lastWidth;
    for(let i=0; i<f.allDiffs.length; i++){
      f.allDiffs[i].style.width = '100%'; // setting to w causes unsightly horiz. scrollbar
      f.allDiffs[i].style.maxWidth = w + "px";

    }
  };
  checkWidth();
  window.addEventListener('resize', checkWidth);
}, false);
Changes to src/diffcmd.c.
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
@ <meta charset="UTF-8">
@ <style>
@ h1 {
@   font-size: 150%;
@ }
@
@ table.diff {
@   width: 98%;
@   border-spacing: 0;
@   border: 1px solid black;
@ }
@ table.diff td {
@   vertical-align: top;
@ }
@ table.diff pre {







|







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
@ <meta charset="UTF-8">
@ <style>
@ h1 {
@   font-size: 150%;
@ }
@
@ table.diff {
@   width: 100%;
@   border-spacing: 0;
@   border: 1px solid black;
@ }
@ table.diff td {
@   vertical-align: top;
@ }
@ table.diff pre {
Changes to src/fossil.diff.js.
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
  for(i=0; i<diffs.length; i++){
    initDiff(diffs[i]);
  }
  const checkWidth = function f(){
    if(undefined === f.lastWidth){
      f.lastWidth = 0;
    }
    if( document.body.clientWidth!=f.lastWidth ){
      f.lastWidth = document.body.clientWidth;
      var w = f.lastWidth*0.5 - 100;
      if(!f.colsL){
        f.colsL = document.querySelectorAll('td.difftxtl pre');
      }
      for(let i=0; i<f.colsL.length; i++){
        f.colsL[i].style.width = w + "px";
        f.colsL[i].style.maxWidth = w + "px";
      }
      if(!f.colsR){
        f.colsR = document.querySelectorAll('td.difftxtr pre');
      }
      for(let i=0; i<f.colsR.length; i++){
        f.colsR[i].style.width = w + "px";
        f.colsR[i].style.maxWidth = w + "px";
      }
      if(!f.allDiffs){
        f.allDiffs = document.querySelectorAll('table.diff');
      }
      w = f.lastWidth;
      for(let i=0; i<f.allDiffs.length; i++){
        f.allDiffs[i].style.width = '100%'; // setting to w causes unsightly horiz. scrollbar
        f.allDiffs[i].style.maxWidth = w + "px";
      }
    }
  };
  checkWidth();
  window.addEventListener('resize', checkWidth);
}, false);








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
<






70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

99

100
101
102
103
104
105
  for(i=0; i<diffs.length; i++){
    initDiff(diffs[i]);
  }
  const checkWidth = function f(){
    if(undefined === f.lastWidth){
      f.lastWidth = 0;
    }
    if( document.body.clientWidth===f.lastWidth ) return;
    f.lastWidth = document.body.clientWidth;
    var w = f.lastWidth*0.5 - 100;
    if(!f.colsL){
      f.colsL = document.querySelectorAll('td.difftxtl pre');
    }
    for(let i=0; i<f.colsL.length; i++){
      f.colsL[i].style.width = w + "px";
      f.colsL[i].style.maxWidth = w + "px";
    }
    if(!f.colsR){
      f.colsR = document.querySelectorAll('td.difftxtr pre');
    }
    for(let i=0; i<f.colsR.length; i++){
      f.colsR[i].style.width = w + "px";
      f.colsR[i].style.maxWidth = w + "px";
    }
    if(!f.allDiffs){
      f.allDiffs = document.querySelectorAll('table.diff');
    }
    w = f.lastWidth;
    for(let i=0; i<f.allDiffs.length; i++){

      f.allDiffs[i].style.maxWidth = w + "px";

    }
  };
  checkWidth();
  window.addEventListener('resize', checkWidth);
}, false);