Fossil SCM

Remove accordion.js from the embedded associated wiki view (no longer needed). Remove accordion.js from the tree. Rebuild makefiles to remove references to accordion.js, which revealed that Makefile.msc was apparently edited by hand recently.

stephan 2026-11-13 13:29 UTC accordion-rework
Commit f499e54d76623a1843283db6402a3b9ea827a09f4cb6fa0ad49863131a4cdad7
D src/accordion.js
-99
--- a/src/accordion.js
+++ b/src/accordion.js
@@ -1,99 +0,0 @@
1
-/*
2
-** Attach appropriate javascript to each ".accordion" button so that it expands
3
-** and contracts when clicked.
4
-**
5
-** The uncompressed source code for the SVG icons can be found on the wiki page
6
-** "branch/accordion-experiments" in the Fossil repository.
7
-**
8
-** Implementation notes:
9
-**
10
-** The `maxHeight' CSS property is quite restrictive for vertical resizing of
11
-** elements, especially for dynamic-content areas like the diff panels. That's
12
-** why `maxHeight' is set only during animation, to prevent truncated elements.
13
-** (The diff panels may get truncated right after page loading, and other
14
-** elements may get truncated when resizing the browser window to a smaller
15
-** width, causing vertical growth.)
16
-**
17
-** Another problem is that `scrollHeight' used to calculate the expanded height
18
-** while still in the contracted state may return values with small errors on
19
-** some browsers, especially for large elements, presumably due to omitting the
20
-** space required by the vertical scrollbar that may become necessary, causing
21
-** additional horizontal shrinking and consequently more vertical growth than
22
-** calculated. That's why setting `maxHeight' to `scrollHeight' is considered
23
-** "good enough" only during animation, but cleared afterwards.
24
-**
25
-** https://fossil-scm.org/forum/forumpost/66d7075f40
26
-** https://fossil-scm.org/home/timeline?r=accordion-fix
27
-**
28
-** To work around the missing support for `overflow-y: clip', this script uses a
29
-** fallback and sets `overflow-y: hidden' during the accordion panel animations.
30
-** That's because if `overflow-y: hidden' is set statically from the stylesheet,
31
-** the shadow of the selected or current timeline entries in the context section
32
-** of `/info' pages is still truncated on the right (which is strange, as that's
33
-** not the "y" direction) in all major browsers. Otherwise, the stylesheet might
34
-** define the fallback using the `@supports(…)' at-rule:
35
-**
36
-** .accordion_panel {
37
-** overflow-y: hidden;
38
-** }
39
-** @supports(overflow-y: clip) {
40
-** .accordion_panel {
41
-** overflow-y: clip;
42
-** }
43
-** }
44
-*/
45
-(function(){
46
- const acc_svgdata = ["data:image/svg+xml,"+
47
- "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+
48
- "%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+
49
- "%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+
50
- "%3Cpath style='fill:rgb(64,64,64)' d='M13,13H3V3h10v10z'/%3E"+
51
- "%3Cpath style='fill:rgb(248,248,248)' d='M12,12H4V4h8v8z'/%3E"+
52
- "%3Cpath style='fill:rgb(80,128,208)' d='", "'/%3E%3C/svg%3E",
53
- "M5,7h2v-2h2v2h2v2h-2v2h-2v-2h-2z", "M11,9H5V7h6v6z"];
54
- const a = document.getElementsByClassName("accordion");
55
- const xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/;
56
- const onclick = function(evt){
57
- /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements in
58
- ** ".accordion" headers (for which Fossil uses <DIV> elements that represent
59
- ** section headers). */
60
- if( xClickyHTML.test(evt.target.tagName) ) return;
61
- const x = this.nextElementSibling;
62
- if( this.classList.contains("accordion_closed") ){
63
- x.style.maxHeight = x.scrollHeight + "px";
64
- setTimeout(function(){
65
- x.style.maxHeight = "";
66
- if( !window.CSS || !window.CSS.supports("overflow: clip") ){
67
- x.style.overflowY = "";
68
- }
69
- },250); // default.css: .accordion_panel { transition-duration }
70
- }else{
71
- x.style.maxHeight = x.scrollHeight + "px";
72
- if( !window.CSS || !window.CSS.supports("overflow: clip") ){
73
- x.style.overflowY = "hidden";
74
- }
75
- setTimeout(function(){
76
- x.style.maxHeight = "0";
77
- },1);
78
- }
79
- this.classList.toggle("accordion_closed");
80
- };
81
- for(const e of a){
82
- let img = document.createElement("img");
83
- img.src = acc_svgdata[0]+acc_svgdata[2]+acc_svgdata[1];
84
- img.className = "accordion_btn accordion_btn_plus";
85
- e.insertBefore(img,e.firstChild);
86
- img = document.createElement("img");
87
- img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1];
88
- img.className = "accordion_btn accordion_btn_minus";
89
- e.insertBefore(img,e.firstChild);
90
- e.addEventListener("click", onclick);
91
- if( e.classList.contains('collapsed') ){
92
- /* C code sets the 'collapsed' class for accordions which should
93
- start that way. */
94
- e.classList.remove('collapsed');
95
- console.warn("WTH?", e);
96
- e.click();
97
- }
98
- }
99
-})();
--- a/src/accordion.js
+++ b/src/accordion.js
@@ -1,99 +0,0 @@
1 /*
2 ** Attach appropriate javascript to each ".accordion" button so that it expands
3 ** and contracts when clicked.
4 **
5 ** The uncompressed source code for the SVG icons can be found on the wiki page
6 ** "branch/accordion-experiments" in the Fossil repository.
7 **
8 ** Implementation notes:
9 **
10 ** The `maxHeight' CSS property is quite restrictive for vertical resizing of
11 ** elements, especially for dynamic-content areas like the diff panels. That's
12 ** why `maxHeight' is set only during animation, to prevent truncated elements.
13 ** (The diff panels may get truncated right after page loading, and other
14 ** elements may get truncated when resizing the browser window to a smaller
15 ** width, causing vertical growth.)
16 **
17 ** Another problem is that `scrollHeight' used to calculate the expanded height
18 ** while still in the contracted state may return values with small errors on
19 ** some browsers, especially for large elements, presumably due to omitting the
20 ** space required by the vertical scrollbar that may become necessary, causing
21 ** additional horizontal shrinking and consequently more vertical growth than
22 ** calculated. That's why setting `maxHeight' to `scrollHeight' is considered
23 ** "good enough" only during animation, but cleared afterwards.
24 **
25 ** https://fossil-scm.org/forum/forumpost/66d7075f40
26 ** https://fossil-scm.org/home/timeline?r=accordion-fix
27 **
28 ** To work around the missing support for `overflow-y: clip', this script uses a
29 ** fallback and sets `overflow-y: hidden' during the accordion panel animations.
30 ** That's because if `overflow-y: hidden' is set statically from the stylesheet,
31 ** the shadow of the selected or current timeline entries in the context section
32 ** of `/info' pages is still truncated on the right (which is strange, as that's
33 ** not the "y" direction) in all major browsers. Otherwise, the stylesheet might
34 ** define the fallback using the `@supports(…)' at-rule:
35 **
36 ** .accordion_panel {
37 ** overflow-y: hidden;
38 ** }
39 ** @supports(overflow-y: clip) {
40 ** .accordion_panel {
41 ** overflow-y: clip;
42 ** }
43 ** }
44 */
45 (function(){
46 const acc_svgdata = ["data:image/svg+xml,"+
47 "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+
48 "%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+
49 "%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+
50 "%3Cpath style='fill:rgb(64,64,64)' d='M13,13H3V3h10v10z'/%3E"+
51 "%3Cpath style='fill:rgb(248,248,248)' d='M12,12H4V4h8v8z'/%3E"+
52 "%3Cpath style='fill:rgb(80,128,208)' d='", "'/%3E%3C/svg%3E",
53 "M5,7h2v-2h2v2h2v2h-2v2h-2v-2h-2z", "M11,9H5V7h6v6z"];
54 const a = document.getElementsByClassName("accordion");
55 const xClickyHTML = /^(?:A|AREA|BUTTON|INPUT|LABEL|SELECT|TEXTAREA|DETAILS)$/;
56 const onclick = function(evt){
57 /* Ignore clicks to hyperlinks and other "click-responsive" HTML elements in
58 ** ".accordion" headers (for which Fossil uses <DIV> elements that represent
59 ** section headers). */
60 if( xClickyHTML.test(evt.target.tagName) ) return;
61 const x = this.nextElementSibling;
62 if( this.classList.contains("accordion_closed") ){
63 x.style.maxHeight = x.scrollHeight + "px";
64 setTimeout(function(){
65 x.style.maxHeight = "";
66 if( !window.CSS || !window.CSS.supports("overflow: clip") ){
67 x.style.overflowY = "";
68 }
69 },250); // default.css: .accordion_panel { transition-duration }
70 }else{
71 x.style.maxHeight = x.scrollHeight + "px";
72 if( !window.CSS || !window.CSS.supports("overflow: clip") ){
73 x.style.overflowY = "hidden";
74 }
75 setTimeout(function(){
76 x.style.maxHeight = "0";
77 },1);
78 }
79 this.classList.toggle("accordion_closed");
80 };
81 for(const e of a){
82 let img = document.createElement("img");
83 img.src = acc_svgdata[0]+acc_svgdata[2]+acc_svgdata[1];
84 img.className = "accordion_btn accordion_btn_plus";
85 e.insertBefore(img,e.firstChild);
86 img = document.createElement("img");
87 img.src = acc_svgdata[0]+acc_svgdata[3]+acc_svgdata[1];
88 img.className = "accordion_btn accordion_btn_minus";
89 e.insertBefore(img,e.firstChild);
90 e.addEventListener("click", onclick);
91 if( e.classList.contains('collapsed') ){
92 /* C code sets the 'collapsed' class for accordions which should
93 start that way. */
94 e.classList.remove('collapsed');
95 console.warn("WTH?", e);
96 e.click();
97 }
98 }
99 })();
--- a/src/accordion.js
+++ b/src/accordion.js
@@ -1,99 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- src/main.mk
+++ src/main.mk
@@ -214,11 +214,10 @@
214214
$(SRCDIR)/../skins/plain_gray/header.txt \
215215
$(SRCDIR)/../skins/xekri/css.txt \
216216
$(SRCDIR)/../skins/xekri/details.txt \
217217
$(SRCDIR)/../skins/xekri/footer.txt \
218218
$(SRCDIR)/../skins/xekri/header.txt \
219
- $(SRCDIR)/accordion.js \
220219
$(SRCDIR)/alerts/bflat2.wav \
221220
$(SRCDIR)/alerts/bflat3.wav \
222221
$(SRCDIR)/alerts/bloop.wav \
223222
$(SRCDIR)/alerts/plunk.wav \
224223
$(SRCDIR)/ci_edit.js \
225224
--- src/main.mk
+++ src/main.mk
@@ -214,11 +214,10 @@
214 $(SRCDIR)/../skins/plain_gray/header.txt \
215 $(SRCDIR)/../skins/xekri/css.txt \
216 $(SRCDIR)/../skins/xekri/details.txt \
217 $(SRCDIR)/../skins/xekri/footer.txt \
218 $(SRCDIR)/../skins/xekri/header.txt \
219 $(SRCDIR)/accordion.js \
220 $(SRCDIR)/alerts/bflat2.wav \
221 $(SRCDIR)/alerts/bflat3.wav \
222 $(SRCDIR)/alerts/bloop.wav \
223 $(SRCDIR)/alerts/plunk.wav \
224 $(SRCDIR)/ci_edit.js \
225
--- src/main.mk
+++ src/main.mk
@@ -214,11 +214,10 @@
214 $(SRCDIR)/../skins/plain_gray/header.txt \
215 $(SRCDIR)/../skins/xekri/css.txt \
216 $(SRCDIR)/../skins/xekri/details.txt \
217 $(SRCDIR)/../skins/xekri/footer.txt \
218 $(SRCDIR)/../skins/xekri/header.txt \
 
219 $(SRCDIR)/alerts/bflat2.wav \
220 $(SRCDIR)/alerts/bflat3.wav \
221 $(SRCDIR)/alerts/bloop.wav \
222 $(SRCDIR)/alerts/plunk.wav \
223 $(SRCDIR)/ci_edit.js \
224
-1
--- src/wiki.c
+++ src/wiki.c
@@ -2656,8 +2656,7 @@
26562656
blob_reset(&title);
26572657
blob_reset(&wiki);
26582658
}
26592659
@ </details>
26602660
manifest_destroy(pWiki);
2661
- builtin_request_js("accordion.js");
26622661
return 1;
26632662
}
26642663
--- src/wiki.c
+++ src/wiki.c
@@ -2656,8 +2656,7 @@
2656 blob_reset(&title);
2657 blob_reset(&wiki);
2658 }
2659 @ </details>
2660 manifest_destroy(pWiki);
2661 builtin_request_js("accordion.js");
2662 return 1;
2663 }
2664
--- src/wiki.c
+++ src/wiki.c
@@ -2656,8 +2656,7 @@
2656 blob_reset(&title);
2657 blob_reset(&wiki);
2658 }
2659 @ </details>
2660 manifest_destroy(pWiki);
 
2661 return 1;
2662 }
2663
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -600,11 +600,10 @@
600600
$(SRCDIR)/../skins/plain_gray/header.txt \
601601
$(SRCDIR)/../skins/xekri/css.txt \
602602
$(SRCDIR)/../skins/xekri/details.txt \
603603
$(SRCDIR)/../skins/xekri/footer.txt \
604604
$(SRCDIR)/../skins/xekri/header.txt \
605
- $(SRCDIR)/accordion.js \
606605
$(SRCDIR)/alerts/bflat2.wav \
607606
$(SRCDIR)/alerts/bflat3.wav \
608607
$(SRCDIR)/alerts/bloop.wav \
609608
$(SRCDIR)/alerts/plunk.wav \
610609
$(SRCDIR)/ci_edit.js \
611610
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -600,11 +600,10 @@
600 $(SRCDIR)/../skins/plain_gray/header.txt \
601 $(SRCDIR)/../skins/xekri/css.txt \
602 $(SRCDIR)/../skins/xekri/details.txt \
603 $(SRCDIR)/../skins/xekri/footer.txt \
604 $(SRCDIR)/../skins/xekri/header.txt \
605 $(SRCDIR)/accordion.js \
606 $(SRCDIR)/alerts/bflat2.wav \
607 $(SRCDIR)/alerts/bflat3.wav \
608 $(SRCDIR)/alerts/bloop.wav \
609 $(SRCDIR)/alerts/plunk.wav \
610 $(SRCDIR)/ci_edit.js \
611
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -600,11 +600,10 @@
600 $(SRCDIR)/../skins/plain_gray/header.txt \
601 $(SRCDIR)/../skins/xekri/css.txt \
602 $(SRCDIR)/../skins/xekri/details.txt \
603 $(SRCDIR)/../skins/xekri/footer.txt \
604 $(SRCDIR)/../skins/xekri/header.txt \
 
605 $(SRCDIR)/alerts/bflat2.wav \
606 $(SRCDIR)/alerts/bflat3.wav \
607 $(SRCDIR)/alerts/bloop.wav \
608 $(SRCDIR)/alerts/plunk.wav \
609 $(SRCDIR)/ci_edit.js \
610
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -229,11 +229,11 @@
229229
!elseif $(OPTIMIZATIONS)>1
230230
RELOPTS = /O2
231231
!elseif $(OPTIMIZATIONS)>0
232232
RELOPTS = /O1
233233
!else
234
-RELOPTS = /Od
234
+RELOPTS =
235235
!endif
236236
237237
!if $(DEBUG)!=0
238238
CFLAGS = $(CFLAGS) /Zi $(CRTFLAGS) $(DBGOPTS) /DFOSSIL_DEBUG /DTH_MEMDEBUG
239239
LDFLAGS = $(LDFLAGS) /DEBUG
@@ -565,11 +565,10 @@
565565
"$(SRCDIR)\..\skins\plain_gray\header.txt" \
566566
"$(SRCDIR)\..\skins\xekri\css.txt" \
567567
"$(SRCDIR)\..\skins\xekri\details.txt" \
568568
"$(SRCDIR)\..\skins\xekri\footer.txt" \
569569
"$(SRCDIR)\..\skins\xekri\header.txt" \
570
- "$(SRCDIR)\accordion.js" \
571570
"$(SRCDIR)\alerts\bflat2.wav" \
572571
"$(SRCDIR)\alerts\bflat3.wav" \
573572
"$(SRCDIR)\alerts\bloop.wav" \
574573
"$(SRCDIR)\alerts\plunk.wav" \
575574
"$(SRCDIR)\ci_edit.js" \
@@ -1205,11 +1204,10 @@
12051204
echo "$(SRCDIR)\../skins/plain_gray/header.txt" >> $@
12061205
echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@
12071206
echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@
12081207
echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@
12091208
echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@
1210
- echo "$(SRCDIR)\accordion.js" >> $@
12111209
echo "$(SRCDIR)\alerts/bflat2.wav" >> $@
12121210
echo "$(SRCDIR)\alerts/bflat3.wav" >> $@
12131211
echo "$(SRCDIR)\alerts/bloop.wav" >> $@
12141212
echo "$(SRCDIR)\alerts/plunk.wav" >> $@
12151213
echo "$(SRCDIR)\ci_edit.js" >> $@
12161214
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -229,11 +229,11 @@
229 !elseif $(OPTIMIZATIONS)>1
230 RELOPTS = /O2
231 !elseif $(OPTIMIZATIONS)>0
232 RELOPTS = /O1
233 !else
234 RELOPTS = /Od
235 !endif
236
237 !if $(DEBUG)!=0
238 CFLAGS = $(CFLAGS) /Zi $(CRTFLAGS) $(DBGOPTS) /DFOSSIL_DEBUG /DTH_MEMDEBUG
239 LDFLAGS = $(LDFLAGS) /DEBUG
@@ -565,11 +565,10 @@
565 "$(SRCDIR)\..\skins\plain_gray\header.txt" \
566 "$(SRCDIR)\..\skins\xekri\css.txt" \
567 "$(SRCDIR)\..\skins\xekri\details.txt" \
568 "$(SRCDIR)\..\skins\xekri\footer.txt" \
569 "$(SRCDIR)\..\skins\xekri\header.txt" \
570 "$(SRCDIR)\accordion.js" \
571 "$(SRCDIR)\alerts\bflat2.wav" \
572 "$(SRCDIR)\alerts\bflat3.wav" \
573 "$(SRCDIR)\alerts\bloop.wav" \
574 "$(SRCDIR)\alerts\plunk.wav" \
575 "$(SRCDIR)\ci_edit.js" \
@@ -1205,11 +1204,10 @@
1205 echo "$(SRCDIR)\../skins/plain_gray/header.txt" >> $@
1206 echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@
1207 echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@
1208 echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@
1209 echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@
1210 echo "$(SRCDIR)\accordion.js" >> $@
1211 echo "$(SRCDIR)\alerts/bflat2.wav" >> $@
1212 echo "$(SRCDIR)\alerts/bflat3.wav" >> $@
1213 echo "$(SRCDIR)\alerts/bloop.wav" >> $@
1214 echo "$(SRCDIR)\alerts/plunk.wav" >> $@
1215 echo "$(SRCDIR)\ci_edit.js" >> $@
1216
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -229,11 +229,11 @@
229 !elseif $(OPTIMIZATIONS)>1
230 RELOPTS = /O2
231 !elseif $(OPTIMIZATIONS)>0
232 RELOPTS = /O1
233 !else
234 RELOPTS =
235 !endif
236
237 !if $(DEBUG)!=0
238 CFLAGS = $(CFLAGS) /Zi $(CRTFLAGS) $(DBGOPTS) /DFOSSIL_DEBUG /DTH_MEMDEBUG
239 LDFLAGS = $(LDFLAGS) /DEBUG
@@ -565,11 +565,10 @@
565 "$(SRCDIR)\..\skins\plain_gray\header.txt" \
566 "$(SRCDIR)\..\skins\xekri\css.txt" \
567 "$(SRCDIR)\..\skins\xekri\details.txt" \
568 "$(SRCDIR)\..\skins\xekri\footer.txt" \
569 "$(SRCDIR)\..\skins\xekri\header.txt" \
 
570 "$(SRCDIR)\alerts\bflat2.wav" \
571 "$(SRCDIR)\alerts\bflat3.wav" \
572 "$(SRCDIR)\alerts\bloop.wav" \
573 "$(SRCDIR)\alerts\plunk.wav" \
574 "$(SRCDIR)\ci_edit.js" \
@@ -1205,11 +1204,10 @@
1204 echo "$(SRCDIR)\../skins/plain_gray/header.txt" >> $@
1205 echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@
1206 echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@
1207 echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@
1208 echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@
 
1209 echo "$(SRCDIR)\alerts/bflat2.wav" >> $@
1210 echo "$(SRCDIR)\alerts/bflat3.wav" >> $@
1211 echo "$(SRCDIR)\alerts/bloop.wav" >> $@
1212 echo "$(SRCDIR)\alerts/plunk.wav" >> $@
1213 echo "$(SRCDIR)\ci_edit.js" >> $@
1214

Keyboard Shortcuts

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