Fossil SCM

General minor cleanups.

stephan 2026-06-06 09:15 UTC attach-v2
Commit 96cdaf93f70b61806b28a426fe7f60b2cd410b873d728b04ba1168a1d8139cbb
+2 -1
--- src/builtin.c
+++ src/builtin.c
@@ -681,11 +681,12 @@
681681
skin_detail_boolean("white-foreground") ? "true" : "false");
682682
CX("}\n"/*fossil.config.skin*/);
683683
CX("};\n"/* fossil.config */);
684684
CX("window.fossil.user = {");
685685
CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest");
686
- CX("isAdmin: %s", (g.perm.Admin || g.perm.Setup) ? "true" : "false");
686
+ CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false");
687
+ CX("enableDebug: %s", (g.perm.Debug || g.perm.Admin) ? "true" : "false");
687688
CX("};\n"/*fossil.user*/);
688689
CX("if(fossil.config.skin.isDark) "
689690
"document.body.classList.add('fossil-dark-style');\n");
690691
/*
691692
** fossil.page holds info about the current page. This is also
692693
--- src/builtin.c
+++ src/builtin.c
@@ -681,11 +681,12 @@
681 skin_detail_boolean("white-foreground") ? "true" : "false");
682 CX("}\n"/*fossil.config.skin*/);
683 CX("};\n"/* fossil.config */);
684 CX("window.fossil.user = {");
685 CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest");
686 CX("isAdmin: %s", (g.perm.Admin || g.perm.Setup) ? "true" : "false");
 
687 CX("};\n"/*fossil.user*/);
688 CX("if(fossil.config.skin.isDark) "
689 "document.body.classList.add('fossil-dark-style');\n");
690 /*
691 ** fossil.page holds info about the current page. This is also
692
--- src/builtin.c
+++ src/builtin.c
@@ -681,11 +681,12 @@
681 skin_detail_boolean("white-foreground") ? "true" : "false");
682 CX("}\n"/*fossil.config.skin*/);
683 CX("};\n"/* fossil.config */);
684 CX("window.fossil.user = {");
685 CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest");
686 CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false");
687 CX("enableDebug: %s", (g.perm.Debug || g.perm.Admin) ? "true" : "false");
688 CX("};\n"/*fossil.user*/);
689 CX("if(fossil.config.skin.isDark) "
690 "document.body.classList.add('fossil-dark-style');\n");
691 /*
692 ** fossil.page holds info about the current page. This is also
693
+20 -20
--- src/default.css
+++ src/default.css
@@ -2013,34 +2013,34 @@
20132013
/* .attach* = styles for file attachments */
20142014
section.attachlist {}
20152015
details.attachlist > summary {
20162016
cursor: pointer;
20172017
}
2018
-.attach-widget {
2018
+.Attacher {
20192019
margin-bottom: 1em;
20202020
display: flex;
20212021
flex-direction: column;
20222022
gap: 0.75em;
20232023
}
2024
-.attach-widget .attach-row {
2024
+.Attacher .attach-row {
20252025
display: flex;
20262026
flex-direction: column;
20272027
gap: 0.5em;
20282028
padding: 0.75em;
20292029
border: 1px dashed #ccc;
20302030
border-radius: 0.25em;
20312031
background-color: #fafafa;
20322032
}
2033
-.attach-widget .error {
2033
+.Attacher .error {
20342034
padding: 0.5em;
20352035
background-color: #d32f2f;
20362036
color: #fff;
20372037
}
2038
-body.fossil-dark-style .attach-widget .attach-row {
2038
+body.fossil-dark-style .Attacher .attach-row {
20392039
background-color: initial;
20402040
}
2041
-.attach-widget .attach-dropzone {
2041
+.Attacher .attach-dropzone {
20422042
padding: 1em;
20432043
text-align: center;
20442044
background: #ffffff;
20452045
border: 1px solid #ddd;
20462046
cursor: pointer;
@@ -2048,57 +2048,57 @@
20482048
transition: background-color 0.15s ease-in-out;
20492049
display: flex;
20502050
flex-direction: row;
20512051
flex-wrap: nowrap;
20522052
}
2053
-body.fossil-dark-style .attach-widget .attach-dropzone{
2053
+body.fossil-dark-style .Attacher .attach-dropzone{
20542054
background: initial;
20552055
}
2056
-.attach-widget .attach-dropzone.populated {
2056
+.Attacher .attach-dropzone.populated {
20572057
background-color: #f1f8e9;
20582058
border-color: #8bc34a;
20592059
border-style: solid;
20602060
text-align: left;
20612061
}
2062
-body.fossil-dark-style .attach-widget .attach-dropzone.populated{
2062
+body.fossil-dark-style .Attacher .attach-dropzone.populated{
20632063
background-color: initial;
20642064
}
2065
-.attach-widget .attach-dropzone.dragover {
2065
+.Attacher .attach-dropzone.dragover {
20662066
background-color: #e1f5fe;
20672067
color: black;
20682068
border-color: #03a9f4;
20692069
}
2070
-body.fossil-dark-style .attach-widget .attach-dropzone.dragover{
2070
+body.fossil-dark-style .Attacher .attach-dropzone.dragover{
20712071
border-color: #03a9f4;
20722072
}
2073
-body.fossil-dark-style .attach-widget .attach-dropzone.dragover{
2073
+body.fossil-dark-style .Attacher .attach-dropzone.dragover{
20742074
background-color: #e1f5fe;
20752075
border-color: #03a9f4;
20762076
}
2077
-.attach-widget .thumbnail {
2077
+.Attacher .thumbnail {
20782078
max-width: 10em;
20792079
max-height: 10em;
20802080
margin: 0 1em;
20812081
}
2082
-.attach-widget .attach-row-info{
2082
+.Attacher .attach-row-info{
20832083
font-family: monospace;
20842084
flex-grow: 1;
20852085
display: flex;
20862086
flex-direction: column;
20872087
}
2088
-.attach-widget .attach-filename {}
2089
-.attach-widget .attach-size {/*size and mimetype*/}
2090
-.attach-widget .attach-desc {
2088
+.Attacher .attach-filename {}
2089
+.Attacher .attach-size {/*size and mimetype*/}
2090
+.Attacher .attach-desc {
20912091
max-width: initial;
20922092
width: 100%;
20932093
box-sizing: border-box;
20942094
min-height: 4em;
20952095
padding: 0.5em;
20962096
font-family: inherit;
20972097
resize: vertical;
20982098
}
2099
-.attach-widget .attach-row-remove {
2099
+.Attacher .attach-row-remove {
21002100
align-self: center;
21012101
padding: 0.25em 0.75em;
21022102
margin-left: 1em;
21032103
background-color: #d32f2f;
21042104
color: #fff;
@@ -2105,19 +2105,19 @@
21052105
border: none;
21062106
border-radius: 0.25em;
21072107
cursor: pointer;
21082108
font-weight: bold;
21092109
}
2110
-.attach-widget .attach-row-remove:hover {
2110
+.Attacher .attach-row-remove:hover {
21112111
background-color: #b71c1c;
21122112
}
2113
-.attach-widget .attach-controls {
2113
+.Attacher .attach-controls {
21142114
display: flex;
21152115
flex-direction: row;
21162116
gap: 1em;
21172117
}
2118
-.attach-widget .attach-controls .attach-add-button {
2118
+.Attacher .attach-controls .attach-add-button {
21192119
padding: 0.5em 1em;
21202120
cursor: pointer;
21212121
flex-grow: 2;
21222122
}
21232123
21242124
--- src/default.css
+++ src/default.css
@@ -2013,34 +2013,34 @@
2013 /* .attach* = styles for file attachments */
2014 section.attachlist {}
2015 details.attachlist > summary {
2016 cursor: pointer;
2017 }
2018 .attach-widget {
2019 margin-bottom: 1em;
2020 display: flex;
2021 flex-direction: column;
2022 gap: 0.75em;
2023 }
2024 .attach-widget .attach-row {
2025 display: flex;
2026 flex-direction: column;
2027 gap: 0.5em;
2028 padding: 0.75em;
2029 border: 1px dashed #ccc;
2030 border-radius: 0.25em;
2031 background-color: #fafafa;
2032 }
2033 .attach-widget .error {
2034 padding: 0.5em;
2035 background-color: #d32f2f;
2036 color: #fff;
2037 }
2038 body.fossil-dark-style .attach-widget .attach-row {
2039 background-color: initial;
2040 }
2041 .attach-widget .attach-dropzone {
2042 padding: 1em;
2043 text-align: center;
2044 background: #ffffff;
2045 border: 1px solid #ddd;
2046 cursor: pointer;
@@ -2048,57 +2048,57 @@
2048 transition: background-color 0.15s ease-in-out;
2049 display: flex;
2050 flex-direction: row;
2051 flex-wrap: nowrap;
2052 }
2053 body.fossil-dark-style .attach-widget .attach-dropzone{
2054 background: initial;
2055 }
2056 .attach-widget .attach-dropzone.populated {
2057 background-color: #f1f8e9;
2058 border-color: #8bc34a;
2059 border-style: solid;
2060 text-align: left;
2061 }
2062 body.fossil-dark-style .attach-widget .attach-dropzone.populated{
2063 background-color: initial;
2064 }
2065 .attach-widget .attach-dropzone.dragover {
2066 background-color: #e1f5fe;
2067 color: black;
2068 border-color: #03a9f4;
2069 }
2070 body.fossil-dark-style .attach-widget .attach-dropzone.dragover{
2071 border-color: #03a9f4;
2072 }
2073 body.fossil-dark-style .attach-widget .attach-dropzone.dragover{
2074 background-color: #e1f5fe;
2075 border-color: #03a9f4;
2076 }
2077 .attach-widget .thumbnail {
2078 max-width: 10em;
2079 max-height: 10em;
2080 margin: 0 1em;
2081 }
2082 .attach-widget .attach-row-info{
2083 font-family: monospace;
2084 flex-grow: 1;
2085 display: flex;
2086 flex-direction: column;
2087 }
2088 .attach-widget .attach-filename {}
2089 .attach-widget .attach-size {/*size and mimetype*/}
2090 .attach-widget .attach-desc {
2091 max-width: initial;
2092 width: 100%;
2093 box-sizing: border-box;
2094 min-height: 4em;
2095 padding: 0.5em;
2096 font-family: inherit;
2097 resize: vertical;
2098 }
2099 .attach-widget .attach-row-remove {
2100 align-self: center;
2101 padding: 0.25em 0.75em;
2102 margin-left: 1em;
2103 background-color: #d32f2f;
2104 color: #fff;
@@ -2105,19 +2105,19 @@
2105 border: none;
2106 border-radius: 0.25em;
2107 cursor: pointer;
2108 font-weight: bold;
2109 }
2110 .attach-widget .attach-row-remove:hover {
2111 background-color: #b71c1c;
2112 }
2113 .attach-widget .attach-controls {
2114 display: flex;
2115 flex-direction: row;
2116 gap: 1em;
2117 }
2118 .attach-widget .attach-controls .attach-add-button {
2119 padding: 0.5em 1em;
2120 cursor: pointer;
2121 flex-grow: 2;
2122 }
2123
2124
--- src/default.css
+++ src/default.css
@@ -2013,34 +2013,34 @@
2013 /* .attach* = styles for file attachments */
2014 section.attachlist {}
2015 details.attachlist > summary {
2016 cursor: pointer;
2017 }
2018 .Attacher {
2019 margin-bottom: 1em;
2020 display: flex;
2021 flex-direction: column;
2022 gap: 0.75em;
2023 }
2024 .Attacher .attach-row {
2025 display: flex;
2026 flex-direction: column;
2027 gap: 0.5em;
2028 padding: 0.75em;
2029 border: 1px dashed #ccc;
2030 border-radius: 0.25em;
2031 background-color: #fafafa;
2032 }
2033 .Attacher .error {
2034 padding: 0.5em;
2035 background-color: #d32f2f;
2036 color: #fff;
2037 }
2038 body.fossil-dark-style .Attacher .attach-row {
2039 background-color: initial;
2040 }
2041 .Attacher .attach-dropzone {
2042 padding: 1em;
2043 text-align: center;
2044 background: #ffffff;
2045 border: 1px solid #ddd;
2046 cursor: pointer;
@@ -2048,57 +2048,57 @@
2048 transition: background-color 0.15s ease-in-out;
2049 display: flex;
2050 flex-direction: row;
2051 flex-wrap: nowrap;
2052 }
2053 body.fossil-dark-style .Attacher .attach-dropzone{
2054 background: initial;
2055 }
2056 .Attacher .attach-dropzone.populated {
2057 background-color: #f1f8e9;
2058 border-color: #8bc34a;
2059 border-style: solid;
2060 text-align: left;
2061 }
2062 body.fossil-dark-style .Attacher .attach-dropzone.populated{
2063 background-color: initial;
2064 }
2065 .Attacher .attach-dropzone.dragover {
2066 background-color: #e1f5fe;
2067 color: black;
2068 border-color: #03a9f4;
2069 }
2070 body.fossil-dark-style .Attacher .attach-dropzone.dragover{
2071 border-color: #03a9f4;
2072 }
2073 body.fossil-dark-style .Attacher .attach-dropzone.dragover{
2074 background-color: #e1f5fe;
2075 border-color: #03a9f4;
2076 }
2077 .Attacher .thumbnail {
2078 max-width: 10em;
2079 max-height: 10em;
2080 margin: 0 1em;
2081 }
2082 .Attacher .attach-row-info{
2083 font-family: monospace;
2084 flex-grow: 1;
2085 display: flex;
2086 flex-direction: column;
2087 }
2088 .Attacher .attach-filename {}
2089 .Attacher .attach-size {/*size and mimetype*/}
2090 .Attacher .attach-desc {
2091 max-width: initial;
2092 width: 100%;
2093 box-sizing: border-box;
2094 min-height: 4em;
2095 padding: 0.5em;
2096 font-family: inherit;
2097 resize: vertical;
2098 }
2099 .Attacher .attach-row-remove {
2100 align-self: center;
2101 padding: 0.25em 0.75em;
2102 margin-left: 1em;
2103 background-color: #d32f2f;
2104 color: #fff;
@@ -2105,19 +2105,19 @@
2105 border: none;
2106 border-radius: 0.25em;
2107 cursor: pointer;
2108 font-weight: bold;
2109 }
2110 .Attacher .attach-row-remove:hover {
2111 background-color: #b71c1c;
2112 }
2113 .Attacher .attach-controls {
2114 display: flex;
2115 flex-direction: row;
2116 gap: 1em;
2117 }
2118 .Attacher .attach-controls .attach-add-button {
2119 padding: 0.5em 1em;
2120 cursor: pointer;
2121 flex-grow: 2;
2122 }
2123
2124
--- src/fossil.attach.js
+++ src/fossil.attach.js
@@ -28,11 +28,13 @@
2828
#events = new EventTarget();
2929
3030
/**
3131
Options:
3232
33
- opt.container: DOM element to wrap this object in.
33
+ opt.container: Optional DOM element to append the resulting
34
+ widget to. If not set, the client can get access to the widget
35
+ element using this.body.
3436
3537
opt.addButtonLabel: optional label for the "add attachment"
3638
button, defaulting to something generic.
3739
3840
opt.limit: optional max number of attachments to allow. This
@@ -76,14 +78,14 @@
7678
constructor(opt){
7779
this.#opt = opt = F.nu({
7880
addButtonLabel: false,
7981
startWith: 0,
8082
limit: 0,
81
- dryRun: false,
83
+ dryRun: undefined,
8284
description: true
8385
}, opt);
84
- this.#e.body = D.addClass(D.div(), 'attach-widget');
86
+ this.#e.body = D.addClass(D.div(), 'Attacher');
8587
const eBtnAdd = this.#e.btnAdd = D.addClass(
8688
D.button(this.#opt.addButtonLabel || 'Add attachment',
8789
()=>this.#addRow()),
8890
'attach-add-button'
8991
);
@@ -93,11 +95,13 @@
9395
this.#e.err.addEventListener('dblclick',()=>this.reportError());
9496
9597
const eControls = this.#e.controls =
9698
D.addClass(D.div(), 'attach-controls');
9799
eControls.append(eBtnAdd);
98
- opt.container.appendChild(this.#e.body);
100
+ if( opt.container ){
101
+ opt.container.appendChild(this.#e.body);
102
+ }
99103
this.#e.body.appendChild(eControls);
100104
if( opt.listener ){
101105
const doCb = (eventType, key)=>{
102106
const f = (opt.listener instanceof Function)
103107
? opt.listener
@@ -108,11 +112,11 @@
108112
};
109113
doCb('entry-added', 'add');
110114
doCb('entry-removed', 'remove');
111115
doCb('entry-populated', 'populate');
112116
}
113
- if( 0 ){
117
+ if( opt.dryRun ){
114118
/* Add dry-run toggle for testing. */
115119
const eLbl = D.label(false, "Dry-run?");
116120
const eCb = D.checkbox(true);
117121
eLbl.append(eCb);
118122
eControls.append(eLbl);
@@ -129,10 +133,15 @@
129133
}else{
130134
this.#updateControls();
131135
}
132136
}
133137
138
+
139
+ get widget(){
140
+ return this.#e.body;
141
+ }
142
+
134143
addEventListener(...args){
135144
return this.#events.addEventListener(...args);
136145
}
137146
138147
removeEventListener(...args){
@@ -241,11 +250,10 @@
241250
const id = ++idCounter;
242251
const rowObj = F.nu({
243252
id, file: null, mimeType: ''
244253
});
245254
const eRow = D.addClass(D.div(), 'attach-row');
246
- eRow.dataset.id = id;
247255
const eDropzone = D.addClass(D.div(), 'attach-dropzone');
248256
const eFile = D.addClass(
249257
D.input('file'), 'attach-file-input', 'hidden'
250258
);
251259
const eInfo = D.addClass(D.span(), 'attach-row-info');
@@ -472,13 +480,13 @@
472480
for(let r of this.#rows){
473481
if( !r.e.dropzone?.classList?.contains?.('populated') ){
474482
continue;
475483
}
476484
rv.push(F.nu({
477
- name: r.name || r.file.name || `pasted-content-${r.id}.${r.mimeType.split('/')[1] || 'txt'}`,
485
+ name: r.name || r.file.name,
478486
content: r.file,
479
- description: r.e.desc?.value || '',
487
+ description: r.e.desc?.value ?? '',
480488
mimeType: r.mimeType
481489
}));
482490
}
483491
return rv;
484492
}
485493
--- src/fossil.attach.js
+++ src/fossil.attach.js
@@ -28,11 +28,13 @@
28 #events = new EventTarget();
29
30 /**
31 Options:
32
33 opt.container: DOM element to wrap this object in.
 
 
34
35 opt.addButtonLabel: optional label for the "add attachment"
36 button, defaulting to something generic.
37
38 opt.limit: optional max number of attachments to allow. This
@@ -76,14 +78,14 @@
76 constructor(opt){
77 this.#opt = opt = F.nu({
78 addButtonLabel: false,
79 startWith: 0,
80 limit: 0,
81 dryRun: false,
82 description: true
83 }, opt);
84 this.#e.body = D.addClass(D.div(), 'attach-widget');
85 const eBtnAdd = this.#e.btnAdd = D.addClass(
86 D.button(this.#opt.addButtonLabel || 'Add attachment',
87 ()=>this.#addRow()),
88 'attach-add-button'
89 );
@@ -93,11 +95,13 @@
93 this.#e.err.addEventListener('dblclick',()=>this.reportError());
94
95 const eControls = this.#e.controls =
96 D.addClass(D.div(), 'attach-controls');
97 eControls.append(eBtnAdd);
98 opt.container.appendChild(this.#e.body);
 
 
99 this.#e.body.appendChild(eControls);
100 if( opt.listener ){
101 const doCb = (eventType, key)=>{
102 const f = (opt.listener instanceof Function)
103 ? opt.listener
@@ -108,11 +112,11 @@
108 };
109 doCb('entry-added', 'add');
110 doCb('entry-removed', 'remove');
111 doCb('entry-populated', 'populate');
112 }
113 if( 0 ){
114 /* Add dry-run toggle for testing. */
115 const eLbl = D.label(false, "Dry-run?");
116 const eCb = D.checkbox(true);
117 eLbl.append(eCb);
118 eControls.append(eLbl);
@@ -129,10 +133,15 @@
129 }else{
130 this.#updateControls();
131 }
132 }
133
 
 
 
 
 
134 addEventListener(...args){
135 return this.#events.addEventListener(...args);
136 }
137
138 removeEventListener(...args){
@@ -241,11 +250,10 @@
241 const id = ++idCounter;
242 const rowObj = F.nu({
243 id, file: null, mimeType: ''
244 });
245 const eRow = D.addClass(D.div(), 'attach-row');
246 eRow.dataset.id = id;
247 const eDropzone = D.addClass(D.div(), 'attach-dropzone');
248 const eFile = D.addClass(
249 D.input('file'), 'attach-file-input', 'hidden'
250 );
251 const eInfo = D.addClass(D.span(), 'attach-row-info');
@@ -472,13 +480,13 @@
472 for(let r of this.#rows){
473 if( !r.e.dropzone?.classList?.contains?.('populated') ){
474 continue;
475 }
476 rv.push(F.nu({
477 name: r.name || r.file.name || `pasted-content-${r.id}.${r.mimeType.split('/')[1] || 'txt'}`,
478 content: r.file,
479 description: r.e.desc?.value || '',
480 mimeType: r.mimeType
481 }));
482 }
483 return rv;
484 }
485
--- src/fossil.attach.js
+++ src/fossil.attach.js
@@ -28,11 +28,13 @@
28 #events = new EventTarget();
29
30 /**
31 Options:
32
33 opt.container: Optional DOM element to append the resulting
34 widget to. If not set, the client can get access to the widget
35 element using this.body.
36
37 opt.addButtonLabel: optional label for the "add attachment"
38 button, defaulting to something generic.
39
40 opt.limit: optional max number of attachments to allow. This
@@ -76,14 +78,14 @@
78 constructor(opt){
79 this.#opt = opt = F.nu({
80 addButtonLabel: false,
81 startWith: 0,
82 limit: 0,
83 dryRun: undefined,
84 description: true
85 }, opt);
86 this.#e.body = D.addClass(D.div(), 'Attacher');
87 const eBtnAdd = this.#e.btnAdd = D.addClass(
88 D.button(this.#opt.addButtonLabel || 'Add attachment',
89 ()=>this.#addRow()),
90 'attach-add-button'
91 );
@@ -93,11 +95,13 @@
95 this.#e.err.addEventListener('dblclick',()=>this.reportError());
96
97 const eControls = this.#e.controls =
98 D.addClass(D.div(), 'attach-controls');
99 eControls.append(eBtnAdd);
100 if( opt.container ){
101 opt.container.appendChild(this.#e.body);
102 }
103 this.#e.body.appendChild(eControls);
104 if( opt.listener ){
105 const doCb = (eventType, key)=>{
106 const f = (opt.listener instanceof Function)
107 ? opt.listener
@@ -108,11 +112,11 @@
112 };
113 doCb('entry-added', 'add');
114 doCb('entry-removed', 'remove');
115 doCb('entry-populated', 'populate');
116 }
117 if( opt.dryRun ){
118 /* Add dry-run toggle for testing. */
119 const eLbl = D.label(false, "Dry-run?");
120 const eCb = D.checkbox(true);
121 eLbl.append(eCb);
122 eControls.append(eLbl);
@@ -129,10 +133,15 @@
133 }else{
134 this.#updateControls();
135 }
136 }
137
138
139 get widget(){
140 return this.#e.body;
141 }
142
143 addEventListener(...args){
144 return this.#events.addEventListener(...args);
145 }
146
147 removeEventListener(...args){
@@ -241,11 +250,10 @@
250 const id = ++idCounter;
251 const rowObj = F.nu({
252 id, file: null, mimeType: ''
253 });
254 const eRow = D.addClass(D.div(), 'attach-row');
 
255 const eDropzone = D.addClass(D.div(), 'attach-dropzone');
256 const eFile = D.addClass(
257 D.input('file'), 'attach-file-input', 'hidden'
258 );
259 const eInfo = D.addClass(D.span(), 'attach-row-info');
@@ -472,13 +480,13 @@
480 for(let r of this.#rows){
481 if( !r.e.dropzone?.classList?.contains?.('populated') ){
482 continue;
483 }
484 rv.push(F.nu({
485 name: r.name || r.file.name,
486 content: r.file,
487 description: r.e.desc?.value ?? '',
488 mimeType: r.mimeType
489 }));
490 }
491 return rv;
492 }
493
--- src/fossil.dom.js
+++ src/fossil.dom.js
@@ -80,10 +80,14 @@
8080
Returns a LABEL element. If passed an argument,
8181
it must be an id or an HTMLElement with an id,
8282
and that id is set as the 'for' attribute of the
8383
label. If passed 2 arguments, the 2nd is text or
8484
a DOM element to append to the label.
85
+
86
+ 2026-06: this is a goofy interface. Generally simpler that
87
+ dealing with IDs is to embed the target control within the label
88
+ element.
8589
*/
8690
dom.label = function(forElem, text){
8791
const rc = document.createElement('label');
8892
if(forElem){
8993
if(forElem instanceof HTMLElement){
9094
--- src/fossil.dom.js
+++ src/fossil.dom.js
@@ -80,10 +80,14 @@
80 Returns a LABEL element. If passed an argument,
81 it must be an id or an HTMLElement with an id,
82 and that id is set as the 'for' attribute of the
83 label. If passed 2 arguments, the 2nd is text or
84 a DOM element to append to the label.
 
 
 
 
85 */
86 dom.label = function(forElem, text){
87 const rc = document.createElement('label');
88 if(forElem){
89 if(forElem instanceof HTMLElement){
90
--- src/fossil.dom.js
+++ src/fossil.dom.js
@@ -80,10 +80,14 @@
80 Returns a LABEL element. If passed an argument,
81 it must be an id or an HTMLElement with an id,
82 and that id is set as the 'for' attribute of the
83 label. If passed 2 arguments, the 2nd is text or
84 a DOM element to append to the label.
85
86 2026-06: this is a goofy interface. Generally simpler that
87 dealing with IDs is to embed the target control within the label
88 element.
89 */
90 dom.label = function(forElem, text){
91 const rc = document.createElement('label');
92 if(forElem){
93 if(forElem instanceof HTMLElement){
94

Keyboard Shortcuts

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