Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Proof of concept/demo for toggle buttons on individual diff views on the /info diff views, as discussed in [forum:0f751ad9c8]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | diff-view-toggle-poc |
| Files: | files | file ages | folders |
| SHA3-256: |
cfdd666533bec7e93891982955481f97 |
| User & Date: | stephan 2021-03-01 17:35:49.766 |
Context
|
2021-03-02
| ||
| 03:51 | Moved the diff toggle button to the right of the diff header line, per forum feedback. Changed the button to a checkbox. Removed the arbitrary heuristics regarding which diffs to show/hide by default - they are now all on by default. ... (check-in: f9d29b9702 user: stephan tags: diff-view-toggle-poc) | |
|
2021-03-01
| ||
| 17:35 | Proof of concept/demo for toggle buttons on individual diff views on the /info diff views, as discussed in [forum:0f751ad9c8]. ... (check-in: cfdd666533 user: stephan tags: diff-view-toggle-poc) | |
| 13:34 | Removed BLOB_SEEK_END from the API, per /chat discussion, as it was unused and appeared to have a semantic discrepancy vis-a-vis fseek() and SEEK_END. ... (check-in: 6fc730e0c7 user: stephan tags: trunk) | |
Changes
Changes to src/builtin.c.
| ︙ | ︙ | |||
702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
** the final one! */
} fjs[] = {
/* This list ordering isn't strictly important. */
{"confirmer", 0, 0},
{"copybutton", 0, "dom\0"},
{"dom", 0, 0},
{"fetch", 0, 0},
{"numbered-lines", 0, "popupwidget\0copybutton\0"},
{"pikchr", 0, "dom\0"},
{"popupwidget", 0, "dom\0"},
{"storage", 0, 0},
{"tabs", 0, "dom\0"}
};
const int nFjs = sizeof(fjs) / sizeof(fjs[0]);
| > | 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 |
** the final one! */
} fjs[] = {
/* This list ordering isn't strictly important. */
{"confirmer", 0, 0},
{"copybutton", 0, "dom\0"},
{"dom", 0, 0},
{"fetch", 0, 0},
{"info-diff", 0, "dom\0"},
{"numbered-lines", 0, "popupwidget\0copybutton\0"},
{"pikchr", 0, "dom\0"},
{"popupwidget", 0, "dom\0"},
{"storage", 0, 0},
{"tabs", 0, "dom\0"}
};
const int nFjs = sizeof(fjs) / sizeof(fjs[0]);
|
| ︙ | ︙ |
Changes to src/default.css.
| ︙ | ︙ | |||
1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 |
}
body.chat #chat-drop-details img {
max-width: 45%;
max-height: 45%;
}
/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
.desktoponly {
display: none;
}
}
/* Objects in the "wideonly" class are invisible only on wide-screen desktops */
| > > > > | 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 |
}
body.chat #chat-drop-details img {
max-width: 45%;
max-height: 45%;
}
button.diff-toggle {
margin-bottom: 0.5em;
font-size: 85%;
}
/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
.desktoponly {
display: none;
}
}
/* Objects in the "wideonly" class are invisible only on wide-screen desktops */
|
| ︙ | ︙ |
Added src/fossil.info-diff.js.
> > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
"use strict";
window.fossil.onPageLoad(function(){
const F = window.fossil, D = F.dom;
const addToggle = function(diffElem){
const cs = diffElem.getClientRects()[0];
if(cs.height < 150/*arbitrary*/) return;
const btn = D.addClass(D.button("Toggle diff view"), 'diff-toggle'),
p = diffElem.parentElement;
p.insertBefore(btn, diffElem);
btn.addEventListener('click', function(){
diffElem.classList.toggle('hidden');
}, false);
if(cs.height > 700/*arbitrary!*/){
btn.click();
}
};
document.querySelectorAll('pre.udiff, table.sbsdiffcols').forEach(addToggle);
});
|
Changes to src/info.c.
| ︙ | ︙ | |||
938 939 940 941 942 943 944 945 946 947 948 949 950 951 |
const char *zNew = db_column_text(&q3,3);
const char *zOldName = db_column_text(&q3, 4);
append_file_change_line(zUuid, zName, zOld, zNew, zOldName,
diffFlags,pRe,mperm);
}
db_finalize(&q3);
append_diff_javascript(diffType==2);
cookie_render();
style_finish_page();
}
/*
** WEBPAGE: winfo
** URL: /winfo?name=HASH
| > | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 |
const char *zNew = db_column_text(&q3,3);
const char *zOldName = db_column_text(&q3, 4);
append_file_change_line(zUuid, zName, zOld, zNew, zOldName,
diffFlags,pRe,mperm);
}
db_finalize(&q3);
append_diff_javascript(diffType==2);
builtin_fossil_js_bundle_or("info-diff",NULL);
cookie_render();
style_finish_page();
}
/*
** WEBPAGE: winfo
** URL: /winfo?name=HASH
|
| ︙ | ︙ |
Changes to src/main.mk.
| ︙ | ︙ | |||
223 224 225 226 227 228 229 230 231 232 233 234 235 236 | $(SRCDIR)/diff.tcl \ $(SRCDIR)/forum.js \ $(SRCDIR)/fossil.bootstrap.js \ $(SRCDIR)/fossil.confirmer.js \ $(SRCDIR)/fossil.copybutton.js \ $(SRCDIR)/fossil.dom.js \ $(SRCDIR)/fossil.fetch.js \ $(SRCDIR)/fossil.numbered-lines.js \ $(SRCDIR)/fossil.page.fileedit.js \ $(SRCDIR)/fossil.page.forumpost.js \ $(SRCDIR)/fossil.page.pikchrshow.js \ $(SRCDIR)/fossil.page.wikiedit.js \ $(SRCDIR)/fossil.pikchr.js \ $(SRCDIR)/fossil.popupwidget.js \ | > | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | $(SRCDIR)/diff.tcl \ $(SRCDIR)/forum.js \ $(SRCDIR)/fossil.bootstrap.js \ $(SRCDIR)/fossil.confirmer.js \ $(SRCDIR)/fossil.copybutton.js \ $(SRCDIR)/fossil.dom.js \ $(SRCDIR)/fossil.fetch.js \ $(SRCDIR)/fossil.info-diff.js \ $(SRCDIR)/fossil.numbered-lines.js \ $(SRCDIR)/fossil.page.fileedit.js \ $(SRCDIR)/fossil.page.forumpost.js \ $(SRCDIR)/fossil.page.pikchrshow.js \ $(SRCDIR)/fossil.page.wikiedit.js \ $(SRCDIR)/fossil.pikchr.js \ $(SRCDIR)/fossil.popupwidget.js \ |
| ︙ | ︙ |
Changes to win/Makefile.mingw.
| ︙ | ︙ | |||
632 633 634 635 636 637 638 639 640 641 642 643 644 645 | $(SRCDIR)/diff.tcl \ $(SRCDIR)/forum.js \ $(SRCDIR)/fossil.bootstrap.js \ $(SRCDIR)/fossil.confirmer.js \ $(SRCDIR)/fossil.copybutton.js \ $(SRCDIR)/fossil.dom.js \ $(SRCDIR)/fossil.fetch.js \ $(SRCDIR)/fossil.numbered-lines.js \ $(SRCDIR)/fossil.page.fileedit.js \ $(SRCDIR)/fossil.page.forumpost.js \ $(SRCDIR)/fossil.page.pikchrshow.js \ $(SRCDIR)/fossil.page.wikiedit.js \ $(SRCDIR)/fossil.pikchr.js \ $(SRCDIR)/fossil.popupwidget.js \ | > | 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 | $(SRCDIR)/diff.tcl \ $(SRCDIR)/forum.js \ $(SRCDIR)/fossil.bootstrap.js \ $(SRCDIR)/fossil.confirmer.js \ $(SRCDIR)/fossil.copybutton.js \ $(SRCDIR)/fossil.dom.js \ $(SRCDIR)/fossil.fetch.js \ $(SRCDIR)/fossil.info-diff.js \ $(SRCDIR)/fossil.numbered-lines.js \ $(SRCDIR)/fossil.page.fileedit.js \ $(SRCDIR)/fossil.page.forumpost.js \ $(SRCDIR)/fossil.page.pikchrshow.js \ $(SRCDIR)/fossil.page.wikiedit.js \ $(SRCDIR)/fossil.pikchr.js \ $(SRCDIR)/fossil.popupwidget.js \ |
| ︙ | ︙ |
Changes to win/Makefile.msc.
| ︙ | ︙ | |||
557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
"$(SRCDIR)\diff.tcl" \
"$(SRCDIR)\forum.js" \
"$(SRCDIR)\fossil.bootstrap.js" \
"$(SRCDIR)\fossil.confirmer.js" \
"$(SRCDIR)\fossil.copybutton.js" \
"$(SRCDIR)\fossil.dom.js" \
"$(SRCDIR)\fossil.fetch.js" \
"$(SRCDIR)\fossil.numbered-lines.js" \
"$(SRCDIR)\fossil.page.fileedit.js" \
"$(SRCDIR)\fossil.page.forumpost.js" \
"$(SRCDIR)\fossil.page.pikchrshow.js" \
"$(SRCDIR)\fossil.page.wikiedit.js" \
"$(SRCDIR)\fossil.pikchr.js" \
"$(SRCDIR)\fossil.popupwidget.js" \
| > | 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
"$(SRCDIR)\diff.tcl" \
"$(SRCDIR)\forum.js" \
"$(SRCDIR)\fossil.bootstrap.js" \
"$(SRCDIR)\fossil.confirmer.js" \
"$(SRCDIR)\fossil.copybutton.js" \
"$(SRCDIR)\fossil.dom.js" \
"$(SRCDIR)\fossil.fetch.js" \
"$(SRCDIR)\fossil.info-diff.js" \
"$(SRCDIR)\fossil.numbered-lines.js" \
"$(SRCDIR)\fossil.page.fileedit.js" \
"$(SRCDIR)\fossil.page.forumpost.js" \
"$(SRCDIR)\fossil.page.pikchrshow.js" \
"$(SRCDIR)\fossil.page.wikiedit.js" \
"$(SRCDIR)\fossil.pikchr.js" \
"$(SRCDIR)\fossil.popupwidget.js" \
|
| ︙ | ︙ | |||
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | echo "$(SRCDIR)\diff.tcl" >> $@ echo "$(SRCDIR)\forum.js" >> $@ echo "$(SRCDIR)\fossil.bootstrap.js" >> $@ echo "$(SRCDIR)\fossil.confirmer.js" >> $@ echo "$(SRCDIR)\fossil.copybutton.js" >> $@ echo "$(SRCDIR)\fossil.dom.js" >> $@ echo "$(SRCDIR)\fossil.fetch.js" >> $@ echo "$(SRCDIR)\fossil.numbered-lines.js" >> $@ echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@ echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@ echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@ echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@ echo "$(SRCDIR)\fossil.pikchr.js" >> $@ echo "$(SRCDIR)\fossil.popupwidget.js" >> $@ | > | 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 | echo "$(SRCDIR)\diff.tcl" >> $@ echo "$(SRCDIR)\forum.js" >> $@ echo "$(SRCDIR)\fossil.bootstrap.js" >> $@ echo "$(SRCDIR)\fossil.confirmer.js" >> $@ echo "$(SRCDIR)\fossil.copybutton.js" >> $@ echo "$(SRCDIR)\fossil.dom.js" >> $@ echo "$(SRCDIR)\fossil.fetch.js" >> $@ echo "$(SRCDIR)\fossil.info-diff.js" >> $@ echo "$(SRCDIR)\fossil.numbered-lines.js" >> $@ echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@ echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@ echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@ echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@ echo "$(SRCDIR)\fossil.pikchr.js" >> $@ echo "$(SRCDIR)\fossil.popupwidget.js" >> $@ |
| ︙ | ︙ |