Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch sbs-diff-css Excluding Merge-Ins
This is equivalent to a diff from d90990701d to c5a4fe54ec
2024-08-05
| ||
15:10 | Replace the JavaScript-based side-by-side diff view with a CSS Grid, as discussed in [forum:93398561d3986c41|forum post 93398561d3986c41]. ... (check-in: 71e9ca7869 user: stephan tags: trunk) | |
2024-07-31
| ||
19:54 | Resolve the awkward misalignment of consecutive diff chunks, thanks to a hint from [forum:85ab14eecd|forum post 85ab14eecd]. ... (Closed-Leaf check-in: c5a4fe54ec user: stephan tags: sbs-diff-css) | |
11:14 | In the diff chunk loader, remove stray calls to the JS code which was removed in [61fd1e841fd]. ... (check-in: ac965480d4 user: stephan tags: sbs-diff-css) | |
2024-07-30
| ||
12:35 | For the 'all' command, accept any of (set, setting, settings) for the settings command, per /chat discussion. ... (check-in: 939e8c4076 user: stephan tags: trunk) | |
12:03 | Initial go at using CSS grid layout for side-by-side diffs, rather than using JS to dynamically fit the columns. See discussion at [forum:93398561d3986c41|forum post 93398561d3986c41]. ... (check-in: 375f2af484 user: stephan tags: sbs-diff-css) | |
10:56 | Spell out "setting" in loadmgmt.md. [forum:/forumpost/7485b4bf89|Forum post 7485b4bf89]. ... (check-in: d90990701d user: drh tags: trunk) | |
2024-07-29
| ||
22:39 | The sublist of robot defenses under security audit should use a,b,c,... not 1,2,3,... ... (check-in: 1e4202dec7 user: drh tags: trunk) | |
Changes to src/default.css.
︙ | ︙ | |||
661 662 663 664 665 666 667 | } tr.diffskip > td.chunkctrl .jcbutton.down > span::before { content: '⇣'; } tr.diffskip > td.chunkctrl .jcbutton.up.down > span::before { content: '⇡⇣'; } | < > > > > > > > > > > > > > > > > > > | | > | 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 | } tr.diffskip > td.chunkctrl .jcbutton.down > span::before { content: '⇣'; } tr.diffskip > td.chunkctrl .jcbutton.up.down > span::before { content: '⇡⇣'; } tr.diffskip > td.chunkctrl .jcbutton:hover { cursor: pointer; opacity: 1; filter: contrast(1); } tr.diffchunk { display: grid; gap: 0px 0px; grid-template-rows: 1fr; } table.splitdiff tr.diffchunk { grid-template-columns: auto 1fr auto auto 1fr; grid-template-areas: "difflnl difftxtl diffsep difflnr difftxtr"; } table.udiff tr.diffchunk { grid-template-columns: auto auto auto 1fr; grid-template-areas: "difflnl difflnr diffsep difftxtu"; } td.difflnl { grid-area: difflnl; } td.difflnr { grid-area: difflnr; } td.difftxtu { grid-area: difftxtu; } td.difftxtl { grid-area: difftxtl; } td.difftxtr { grid-area: difftxtr; } td.diffln { width: fit-content; text-align: right; padding: 0 1em 0 0; } td.difflne { padding-bottom: 0.4em; } td.diffsep { width: fit-content; padding: 0 0.3em 0 0.5em; grid-area: diffsep; } td.difftxt pre { overflow-x: auto; } td.diffln ins { background-color: #a0e4b2; text-decoration: none; |
︙ | ︙ |
Changes to src/diff.c.
︙ | ︙ | |||
1284 1285 1286 1287 1288 1289 1290 | blob_append_xfer(p->pOut, &p->aCol[1]); blob_append(p->pOut, "</pre></td><td class=\"difftxt difftxtu\"><pre>\n",-1); blob_append_xfer(p->pOut, &p->aCol[2]); blob_append(p->pOut, "</pre></td></tr>\n", -1); } static void dfunifiedStartRow(DiffBuilder *p){ if( blob_size(&p->aCol[0])>0 ) return; | | | 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 | blob_append_xfer(p->pOut, &p->aCol[1]); blob_append(p->pOut, "</pre></td><td class=\"difftxt difftxtu\"><pre>\n",-1); blob_append_xfer(p->pOut, &p->aCol[2]); blob_append(p->pOut, "</pre></td></tr>\n", -1); } static void dfunifiedStartRow(DiffBuilder *p){ if( blob_size(&p->aCol[0])>0 ) return; blob_appendf(p->pOut,"<tr id=\"chunk%d\" class=\"diffchunk\">" "<td class=\"diffln difflnl\"><pre>\n", ++nChunk); } static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){ dfunifiedFinishRow(p); if( p->pCfg && p->pCfg->zLeftHash ){ blob_appendf(p->pOut, "<tr class=\"diffskip\" data-startln=\"%d\" data-endln=\"%d\"" |
︙ | ︙ | |||
1510 1511 1512 1513 1514 1515 1516 | blob_append_xfer(p->pOut, &p->aCol[2]); blob_append(p->pOut, "</pre></td><td class=\"difftxt difftxtr\"><pre>\n",-1); blob_append_xfer(p->pOut, &p->aCol[3]); blob_append(p->pOut, "</pre></td></tr>\n", -1); } static void dfsplitStartRow(DiffBuilder *p){ if( blob_size(&p->aCol[0])>0 ) return; | | | 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 | blob_append_xfer(p->pOut, &p->aCol[2]); blob_append(p->pOut, "</pre></td><td class=\"difftxt difftxtr\"><pre>\n",-1); blob_append_xfer(p->pOut, &p->aCol[3]); blob_append(p->pOut, "</pre></td></tr>\n", -1); } static void dfsplitStartRow(DiffBuilder *p){ if( blob_size(&p->aCol[0])>0 ) return; blob_appendf(p->pOut,"<tr id=\"chunk%d\" class=\"diffchunk\">" "<td class=\"diffln difflnl\"><pre>\n", ++nChunk); p->eState = 0; } static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){ dfsplitFinishRow(p); if( p->pCfg && p->pCfg->zLeftHash ){ blob_appendf(p->pOut, |
︙ | ︙ |
Changes to src/fossil.diff.js.
︙ | ︙ | |||
104 105 106 107 108 109 110 | const td = tr.querySelector('td:nth-child('+( /* TD element with the line numbers */ getLHS ? 1 : (isSplit ? 4 : 2) )+')'); const m = f.rx[getStart ? 'start' : 'end'].exec(td.innerText); return m ? +m[1] : undefined/*"shouldn't happen"*/; }; | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | const td = tr.querySelector('td:nth-child('+( /* TD element with the line numbers */ getLHS ? 1 : (isSplit ? 4 : 2) )+')'); const m = f.rx[getStart ? 'start' : 'end'].exec(td.innerText); return m ? +m[1] : undefined/*"shouldn't happen"*/; }; /** Installs chunk-loading controls into TR.diffskip element tr. Each instance corresponds to a single TR.diffskip element. The goal is to base these controls roughly on github's, a good example of which, for use as a model, is: |
︙ | ︙ | |||
398 399 400 401 402 403 404 | if(doAppend) content.push(lineNoTxt); else content.unshift(lineNoTxt); if(joinTr){ content.push(trNext.querySelector(selector).innerHTML); } td.innerHTML = content.join(''); if(joinTr) D.remove(joinTr); | < | 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | if(doAppend) content.push(lineNoTxt); else content.unshift(lineNoTxt); if(joinTr){ content.push(trNext.querySelector(selector).innerHTML); } td.innerHTML = content.join(''); if(joinTr) D.remove(joinTr); this.destroy(); return this; }else if(this.FetchType.PrevDown===fetchType){ /* Append context to previous TR. */ // RHS line numbers... let startLnR = this.pos.prev.endRhs+1; lineno.length = lines.length; |
︙ | ︙ | |||
427 428 429 430 431 432 433 | if(lines.length < (urlParam.to - urlParam.from)){ /* No more data. */ this.destroy(); }else{ this.maybeReplaceButtons(); this.updatePosDebug(); } | < | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | if(lines.length < (urlParam.to - urlParam.from)){ /* No more data. */ this.destroy(); }else{ this.maybeReplaceButtons(); this.updatePosDebug(); } return this; }else if(this.FetchType.NextUp===fetchType){ /* Prepend content to next TR. */ // RHS line numbers... if(doAppend){ throw new Error("Internal precondition violation: doAppend is true."); } |
︙ | ︙ | |||
456 457 458 459 460 461 462 | || lines.length < (urlParam.to - urlParam.from)){ /* No more data. */ this.destroy(); }else{ this.maybeReplaceButtons(); this.updatePosDebug(); } | < | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | || lines.length < (urlParam.to - urlParam.from)){ /* No more data. */ this.destroy(); }else{ this.maybeReplaceButtons(); this.updatePosDebug(); } return this; }else{ throw new Error("Unexpected 'fetchType' value."); } }, /** |
︙ | ︙ | |||
621 622 623 624 625 626 627 | new ChunkLoadControls(D.addClass(tr, 'jchunk')); }); }); return F; }; Diff.setupDiffContextLoad(); }); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 618 619 620 621 622 623 624 | new ChunkLoadControls(D.addClass(tr, 'jchunk')); }); }); return F; }; Diff.setupDiffContextLoad(); }); |
Changes to src/fossil.page.fileedit.js.
︙ | ︙ | |||
1243 1244 1245 1246 1247 1248 1249 | D.parseHtml(D.clearElement(target),[ "<div>Diff <code>[", self.finfo.checkin, "]</code> → Local Edits</div>", c||'No changes.' ].join('')); F.diff.setupDiffContextLoad(); | < | 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 | D.parseHtml(D.clearElement(target),[ "<div>Diff <code>[", self.finfo.checkin, "]</code> → Local Edits</div>", c||'No changes.' ].join('')); F.diff.setupDiffContextLoad(); F.message('Updated diff.'); self.tabs.switchToTab(self.e.tabs.diff); } }); return this; }; |
︙ | ︙ |
Changes to src/fossil.page.wikiedit.js.
︙ | ︙ | |||
1543 1544 1545 1546 1547 1548 1549 | D.parseHtml(D.clearElement(target), [ "<div>Diff <code>[", self.winfo.name, "]</code> → Local Edits</div>", c||'No changes.' ].join('')); F.diff.setupDiffContextLoad(); | < | 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 | D.parseHtml(D.clearElement(target), [ "<div>Diff <code>[", self.winfo.name, "]</code> → Local Edits</div>", c||'No changes.' ].join('')); F.diff.setupDiffContextLoad(); F.message('Updated diff.'); self.tabs.switchToTab(self.e.tabs.diff); } }); return this; }; |
︙ | ︙ | |||
1652 1653 1654 1655 1656 1657 1658 | /** If a stashed version of the given winfo object exists (same filename/checkin values), return it, else return undefined. */ P.getStashedWinfo = function(winfo){ return $stash.getWinfo(winfo); }; | < | 1651 1652 1653 1654 1655 1656 1657 1658 | /** If a stashed version of the given winfo object exists (same filename/checkin values), return it, else return undefined. */ P.getStashedWinfo = function(winfo){ return $stash.getWinfo(winfo); }; })(window.fossil); |