Fossil

Check-in [860f8f252c]
Login

Check-in [860f8f252c]

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

Overview
Comment:Several CSS tweaks to get the skins playing nicely. We still have some weird, as-yet unexplained quirks with Darkmode, Bootstrap, and Xekri (forced tables sizes are not being applied, or are inconsistent, despite styles being set).
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | diff-js-refactoring
Files: files | file ages | folders
SHA3-256: 860f8f252c3132aef887fa5938216dd41acc48a1a908582106f326fd7f7c1aaa
User & Date: stephan 2021-09-11 05:10:34.320
Context
2021-09-11
05:48
jchunk-related style tweaks for Eagle and Khaki skins. ... (check-in: bbc534e7a4 user: stephan tags: diff-js-refactoring)
05:10
Several CSS tweaks to get the skins playing nicely. We still have some weird, as-yet unexplained quirks with Darkmode, Bootstrap, and Xekri (forced tables sizes are not being applied, or are inconsistent, despite styles being set). ... (check-in: 860f8f252c user: stephan tags: diff-js-refactoring)
03:20
Final chunk load mode implemented, but diff table widths have somehow been broken (too wide - not sure since when). This version is suitable for playing with and feedback, but not quite yet for trunk. ... (check-in: 5938083e48 user: stephan tags: diff-js-refactoring)
Changes
Unified Diff Ignore Whitespace Patch
Changes to skins/bootstrap/css.txt.
4398
4399
4400
4401
4402
4403
4404
























  height: 4px;
  background: #000;
}

body.branch .submenu > a.timeline-link {
  color: black;
}































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
  height: 4px;
  background: #000;
}

body.branch .submenu > a.timeline-link {
  color: black;
}

tr.diffskip > td.chunkctrl .jcbutton {
  min-width: 3.5ex;
  max-width: revert;
}

/* Bootstrap installs a 'table' class on tables which causes its
   styles to be more specific matches than our diff tables, so we have
   to fight that fire with more fire... */
table.diff.table>thead>tr>th, table.diff.table>tbody>tr>th,
table.diff.table>tfoot>tr>th, table.diff.table>thead>tr>td,
table.diff.table>tbody>tr>td, table.diff.table>tfoot>tr>td {
  padding: 0;
  line-height: revert;
  vertical-align: top;
  border-top: none;
}
table.diff tr.diffskip.jchunk > td {
  padding: 0.25em 0.5em;
}
table.diff pre {
  border: none;
  word-wrap: initial;
}
Changes to skins/darkmode/css.txt.
477
478
479
480
481
482
483



484










485
486
487
488
489
490
491
  text-decoration: none;
}
td.difftxt ins > ins {
  background-color: #559855;
  color: #000;
  text-decoration: none;
}















/************************************************************************
************************************************************************/
body.wikiedit #fossil-status-bar,
body.fileedit #fossil-status-bar{
  border-radius: 0.25em 0.25em 0 0;
}







>
>
>
|
>
>
>
>
>
>
>
>
>
>







477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
  text-decoration: none;
}
td.difftxt ins > ins {
  background-color: #559855;
  color: #000;
  text-decoration: none;
}
body.fossil-dark-style tr.diffskip.jchunk {
    filter: revert;
    background-color: black;
}
tr.diffskip > td.chunkctrl .jcbutton {
  background-color: #303536;
}
table.diff {
  /* For reasons beyond my ken, in THIS SKIN ONLY, table.diff
     is wider than the body even when it is explicitly set
     to a size less than the body UNLESS we reduce the font-size
     to about 85%. */
  /*font-size: 0.85em;*/
}

/************************************************************************
************************************************************************/
body.wikiedit #fossil-status-bar,
body.fileedit #fossil-status-bar{
  border-radius: 0.25em 0.25em 0 0;
}
Changes to skins/eagle/css.txt.
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/* Side-by-side diff */
table.splitdiff {
  background-color: #485D7B;
  font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
  font-size: 8pt;
  border-collapse:collapse;
  white-space: pre;
  width: 98%;
  border: 1px #000 dashed;
  margin-left: auto;
  margin-right: auto;
}

/* format for the layout table, used for the captcha display */
table.captcha {







<







261
262
263
264
265
266
267

268
269
270
271
272
273
274
/* Side-by-side diff */
table.splitdiff {
  background-color: #485D7B;
  font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
  font-size: 8pt;
  border-collapse:collapse;
  white-space: pre;

  border: 1px #000 dashed;
  margin-left: auto;
  margin-right: auto;
}

/* format for the layout table, used for the captcha display */
table.captcha {
345
346
347
348
349
350
351










352
353
354
355
356
357
358
/* deleted in a diff */
td.difftxt del > del, td.diffln del {
  background-color: rgb(230, 110, 110);
}
td.difftxt del {
  background-color: inherit;
}











.fileage tr:hover {
  background-color: #7EA2D9;
}

span.modpending {
  color: #c0c0c0;







>
>
>
>
>
>
>
>
>
>







344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
/* deleted in a diff */
td.difftxt del > del, td.diffln del {
  background-color: rgb(230, 110, 110);
}
td.difftxt del {
  background-color: inherit;
}

tr.diffskip > td.chunkctrl .button {
  background-color: #485D7B;
}
tr.diffskip.jchunk {
  background-color: #7EA2D9;
}
body.fossil-dark-style tr.diffskip.jchunk {
  filter: revert;
}

.fileage tr:hover {
  background-color: #7EA2D9;
}

span.modpending {
  color: #c0c0c0;
Changes to skins/khaki/css.txt.
168
169
170
171
172
173
174








div.forumPostBody blockquote {
  border-width: 1pt;
  border-radius: 0.25em;
  border-style: solid;
  padding: 0 0.5em;
}














>
>
>
>
>
>
>
168
169
170
171
172
173
174
175
176
177
178
179
180
181

div.forumPostBody blockquote {
  border-width: 1pt;
  border-radius: 0.25em;
  border-style: solid;
  padding: 0 0.5em;
}

tr.diffskip > td.chunkctrl .button {
  background-color: #a09048;
}
tr.diffskip.jchunk {
  background-color: #c0af58;
}
Changes to skins/xekri/css.txt.
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
 * Diffs : Side-By-Side
 */

/* display (column-based) */
table.splitdiff {
  border-spacing: 0;
  font-size: 0.85rem;
  width: 90%;
}

table.splitdiff pre {
  border: 0;
  margin: 0 0.5em;
  padding: 0;
}







<







291
292
293
294
295
296
297

298
299
300
301
302
303
304
 * Diffs : Side-By-Side
 */

/* display (column-based) */
table.splitdiff {
  border-spacing: 0;
  font-size: 0.85rem;

}

table.splitdiff pre {
  border: 0;
  margin: 0 0.5em;
  padding: 0;
}
Changes to src/default.css.
570
571
572
573
574
575
576
577

578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
}
tr.diffskip > td.chunkctrl > div {
  /* Exists solely for layout purposes. */
}
body.fossil-dark-style tr.diffskip > td.chunkctrl{
  filter: inherit;
}
tr.diffskip > td.chunkctrl .button {

  min-width: 2.5em;
  max-width: 2.5em;
  text-align: center;
  display: inline-block;
  padding: 0.1em 1em;
  margin: 0 1em 0 0;
  background-color: rgba(127,127,127,0.2);
  border-style: outset;
  border-width: 0;
  /*border-width: 1px;
  border-color: rgba(0,0,0,0);*/
  border-radius: 0.5em;
  opacity: 0.7;
  /*filter: drop-shadow(0.08em 0.08em 0.08em black);*/
}
tr.diffskip > td.chunkctrl .button.up:not(.down){
  /* Simulate an arrow pointing up */
  border-radius: 3em 3em 0.25em 0.25em;
}
tr.diffskip > td.chunkctrl .button.down:not(.up){
  /* Simulate an arrow pointing down */
  border-radius: 0.25em 0.25em 3em 3em;
}
tr.diffskip > td.chunkctrl .button > span {
  /* In order to increase the glyph size w/o increasing the em-based
     button size or border-radius, we need an extra layer of DOM
     element for the glyph. */
  font-size: 150%;
}
tr.diffskip > td.chunkctrl .button.up:not(.down) > span::before {
  content: '⇡';
}
tr.diffskip > td.chunkctrl .button.down:not(.up) > span::before {
  content: '⇣';
}
tr.diffskip > td.chunkctrl .button.up.down > span::before {
  content: '⇡⇣';
}

tr.diffskip > td.chunkctrl .button:hover {
  /*border-color: rgba(75,75,75,1);*/
  cursor: pointer;
  opacity: 1;
  filter: contrast(3);
}
td.diffln {
  width: 1px;







|
>
|
|







<
<


<

|



|



|





|


|


|



|







570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587


588
589

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
}
tr.diffskip > td.chunkctrl > div {
  /* Exists solely for layout purposes. */
}
body.fossil-dark-style tr.diffskip > td.chunkctrl{
  filter: inherit;
}
tr.diffskip > td.chunkctrl .jcbutton
/* class name .button breaks w/ some skins! */ {
  min-width: 3.5ex;
  max-width: 3.5ex;
  text-align: center;
  display: inline-block;
  padding: 0.1em 1em;
  margin: 0 1em 0 0;
  background-color: rgba(127,127,127,0.2);
  border-style: outset;
  border-width: 0;


  border-radius: 0.5em;
  opacity: 0.7;

}
tr.diffskip > td.chunkctrl .jcbutton.up:not(.down){
  /* Simulate an arrow pointing up */
  border-radius: 3em 3em 0.25em 0.25em;
}
tr.diffskip > td.chunkctrl .jcbutton.down:not(.up){
  /* Simulate an arrow pointing down */
  border-radius: 0.25em 0.25em 3em 3em;
}
tr.diffskip > td.chunkctrl .jcbutton > span {
  /* In order to increase the glyph size w/o increasing the em-based
     button size or border-radius, we need an extra layer of DOM
     element for the glyph. */
  font-size: 150%;
}
tr.diffskip > td.chunkctrl .jcbutton.up:not(.down) > span::before {
  content: '⇡';
}
tr.diffskip > td.chunkctrl .jcbutton.down:not(.up) > span::before {
  content: '⇣';
}
tr.diffskip > td.chunkctrl .jcbutton.up.down > span::before {
  content: '⇡⇣';
}

tr.diffskip > td.chunkctrl .jcbutton:hover {
  /*border-color: rgba(75,75,75,1);*/
  cursor: pointer;
  opacity: 1;
  filter: contrast(3);
}
td.diffln {
  width: 1px;
Changes to src/fossil.diff.js.
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349

350
351
352
353
354
355
356
       the given fetchType (as documented for fetchChunk()).
    */
    createButton: function(fetchType){
      let b;
      switch(fetchType){
      case this.FetchType.PrevDown:
        b = D.append(
          D.addClass(D.span(), 'button', 'down'),
          D.span(/*glyph holder*/)
        );
        break;
      case this.FetchType.FillGap:
        b = D.append(
          D.addClass(D.span(), 'button', 'up', 'down'),
          D.span(/*glyph holder*/)
        );
        break;
      case this.FetchType.NextUp:
        b = D.append(
          D.addClass(D.span(), 'button', 'up'),
          D.span(/*glyph holder*/)
        );
        break;
      default:
        throw new Error("Internal API misuse: unexpected fetchType value "+fetchType);
      }

      b.addEventListener('click', ()=>this.fetchChunk(fetchType),false);
      return b;
    },

    updatePosDebug: function(){
      if(this.e.posState){
        D.clearElement(this.e.posState);







|





|





|






>







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
       the given fetchType (as documented for fetchChunk()).
    */
    createButton: function(fetchType){
      let b;
      switch(fetchType){
      case this.FetchType.PrevDown:
        b = D.append(
          D.addClass(D.span(), 'down'),
          D.span(/*glyph holder*/)
        );
        break;
      case this.FetchType.FillGap:
        b = D.append(
          D.addClass(D.span(), 'up', 'down'),
          D.span(/*glyph holder*/)
        );
        break;
      case this.FetchType.NextUp:
        b = D.append(
          D.addClass(D.span(), 'up'),
          D.span(/*glyph holder*/)
        );
        break;
      default:
        throw new Error("Internal API misuse: unexpected fetchType value "+fetchType);
      }
      D.addClass(b, 'jcbutton');
      b.addEventListener('click', ()=>this.fetchChunk(fetchType),false);
      return b;
    },

    updatePosDebug: function(){
      if(this.e.posState){
        D.clearElement(this.e.posState);
389
390
391
392
393
394
395

396
397
398
399
400
401
402
403
                               urlParam/*from fetchChunk()*/,
                               lines/*response lines*/){
      if(!lines.length){
        /* No more data to load */
        this.destroy();
        return this;
      }

      console.debug("Loaded line range ",urlParam.from,"-",urlParam.to, "fetchType ",fetchType);
      const lineno = [],
            trPrev = this.e.tr.previousElementSibling,
            trNext = this.e.tr.nextElementSibling,
            doAppend = (
              !!trPrev && fetchType>=this.FetchType.FillGap
            ) /* true to append to previous TR, else prepend to NEXT TR */;
      const tr = doAppend ? trPrev : trNext;







>
|







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
                               urlParam/*from fetchChunk()*/,
                               lines/*response lines*/){
      if(!lines.length){
        /* No more data to load */
        this.destroy();
        return this;
      }
      //console.debug("Loaded line range ",
      //urlParam.from,"-",urlParam.to, "fetchType ",fetchType);
      const lineno = [],
            trPrev = this.e.tr.previousElementSibling,
            trNext = this.e.tr.nextElementSibling,
            doAppend = (
              !!trPrev && fetchType>=this.FetchType.FillGap
            ) /* true to append to previous TR, else prepend to NEXT TR */;
      const tr = doAppend ? trPrev : trNext;
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
        up.from = Math.max(1, up.to - Diff.config.chunkLoadLines + 1);
        if( this.pos.prev && this.pos.prev.endLhs >= up.from ){
          up.from = this.pos.prev.endLhs + 1;
          fetchType = this.FetchType.FillGap;
        }
      }
      this.$isFetching = true;
      console.debug("fetchChunk(",fetchType,")",up);
      Diff.fetchArtifactChunk(fOpt);
      return this;
    }
  };

  const addDiffSkipHandlers = function(){
    const tables = document.querySelectorAll('table.diff[data-lefthash]:not(.diffskipped)');







|







622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
        up.from = Math.max(1, up.to - Diff.config.chunkLoadLines + 1);
        if( this.pos.prev && this.pos.prev.endLhs >= up.from ){
          up.from = this.pos.prev.endLhs + 1;
          fetchType = this.FetchType.FillGap;
        }
      }
      this.$isFetching = true;
      //console.debug("fetchChunk(",fetchType,")",up);
      Diff.fetchArtifactChunk(fOpt);
      return this;
    }
  };

  const addDiffSkipHandlers = function(){
    const tables = document.querySelectorAll('table.diff[data-lefthash]:not(.diffskipped)');
654
655
656
657
658
659
660

661
662
663

664


665
666






667

668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685






686

687
688
689
690
691
692
693
694
** For a side-by-side diff, if either column is two wide to fit on the
** display, scrollbars are added.  The scrollbars are linked, so that
** both sides scroll together.  Left and right arrows also scroll.
*/
window.fossil.onPageLoad(function(){
  const SCROLL_LEN = 25;
  const F = window.fossil, D = F.dom, Diff = F.diff;

  Diff.checkTableWidth = function f(force){
    if(undefined === f.lastWidth){
      f.lastWidth = 0;

    }


    if( !force && document.body.clientWidth===f.lastWidth ) return this;
    f.lastWidth = document.body.clientWidth;






    let w = f.lastWidth*0.5 - 100;

    if(force || !f.colsL){
      f.colsL = document.querySelectorAll('td.difftxtl pre');
    }
    f.colsL.forEach(function(e){
      e.style.width = w + "px";
      e.style.maxWidth = w + "px";
    });
    if(force || !f.colsR){
      f.colsR = document.querySelectorAll('td.difftxtr pre');
    }
    f.colsR.forEach(function(e){
      e.style.width = w + "px";
      e.style.maxWidth = w + "px";
    });
    if(!f.allDiffs){
      f.allDiffs = document.querySelectorAll('table.diff');
    }
    w = f.lastWidth;






    f.allDiffs.forEach((e)=>e.style.maxWidth = w + "px");

    //console.debug("checkTableWidth(",force,") f.lastWidth =",f.lastWidth);
    return this;
  };

  const scrollLeft = function(event){
    //console.debug("scrollLeft",this,event);
    const table = this.parentElement/*TD*/.parentElement/*TR*/.
      parentElement/*TBODY*/.parentElement/*TABLE*/;







>

|
<
>

>
>
|
|
>
>
>
>
>
>
|
>

















|
>
>
>
>
>
>
|
>
|







656
657
658
659
660
661
662
663
664
665

666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
** For a side-by-side diff, if either column is two wide to fit on the
** display, scrollbars are added.  The scrollbars are linked, so that
** both sides scroll together.  Left and right arrows also scroll.
*/
window.fossil.onPageLoad(function(){
  const SCROLL_LEN = 25;
  const F = window.fossil, D = F.dom, Diff = F.diff;
  var lastWidth;
  Diff.checkTableWidth = function f(force){
    if(undefined === f.contentNode){

      f.contentNode = document.querySelector('div.content');
    }
    force = true;
    const parentCS = window.getComputedStyle(f.contentNode);
    const parentWidth = (
      //document.body.clientWidth;
      //parentCS.width;
      f.contentNode.clientWidth
        - parseFloat(parentCS.marginLeft) - parseFloat(parentCS.marginRight)
    );
    if( !force && parentWidth===lastWidth ) return this;
    lastWidth = parentWidth;
    let w = lastWidth*0.5 - 100;
    //console.debug( "w = ",w,", lastWidth =",lastWidth," body = ",document.body.clientWidth);
    if(force || !f.colsL){
      f.colsL = document.querySelectorAll('td.difftxtl pre');
    }
    f.colsL.forEach(function(e){
      e.style.width = w + "px";
      e.style.maxWidth = w + "px";
    });
    if(force || !f.colsR){
      f.colsR = document.querySelectorAll('td.difftxtr pre');
    }
    f.colsR.forEach(function(e){
      e.style.width = w + "px";
      e.style.maxWidth = w + "px";
    });
    if(!f.allDiffs){
      f.allDiffs = document.querySelectorAll('table.diff');
    }
    w = lastWidth;
    f.allDiffs.forEach(function f(e){
      if(!f.$){
        f.$ = e.getClientRects()[0];
        console.debug("diff table w =",w," f.$x",f.$);
        w - 2*f.$.x /* left margin (assume right==left, for simplicity) */;
      }
      e.style.maxWidth = w + "px";
    });
    //console.debug("checkTableWidth(",force,") lastWidth =",lastWidth);
    return this;
  };

  const scrollLeft = function(event){
    //console.debug("scrollLeft",this,event);
    const table = this.parentElement/*TD*/.parentElement/*TR*/.
      parentElement/*TBODY*/.parentElement/*TABLE*/;