Fossil SCM

Incremental work on the dynamic attachment selector. Add a new file missing from the previous checkin.

stephan 2026-06-02 13:14 UTC attach-v2
Commit e7f2da1886482dbfa0a2c804aeee1e440efd849025aa4f6d8d838a724a3a8da3
+1 -1
--- src/default.css
+++ src/default.css
@@ -2037,11 +2037,11 @@
20372037
}
20382038
.attach-dropzone.dragover {
20392039
background-color: #e1f5fe;
20402040
border-color: #03a9f4;
20412041
}
2042
-.attach-dropzone.row-populated {
2042
+.attach-dropzone.populated {
20432043
background-color: #f1f8e9;
20442044
border-color: #8bc34a;
20452045
border-style: solid;
20462046
}
20472047
.attach-row-info {
20482048
20492049
ADDED src/fossil.attach.js
--- src/default.css
+++ src/default.css
@@ -2037,11 +2037,11 @@
2037 }
2038 .attach-dropzone.dragover {
2039 background-color: #e1f5fe;
2040 border-color: #03a9f4;
2041 }
2042 .attach-dropzone.row-populated {
2043 background-color: #f1f8e9;
2044 border-color: #8bc34a;
2045 border-style: solid;
2046 }
2047 .attach-row-info {
2048
2049 DDED src/fossil.attach.js
--- src/default.css
+++ src/default.css
@@ -2037,11 +2037,11 @@
2037 }
2038 .attach-dropzone.dragover {
2039 background-color: #e1f5fe;
2040 border-color: #03a9f4;
2041 }
2042 .attach-dropzone.populated {
2043 background-color: #f1f8e9;
2044 border-color: #8bc34a;
2045 border-style: solid;
2046 }
2047 .attach-row-info {
2048
2049 DDED src/fossil.attach.js
--- a/src/fossil.attach.js
+++ b/src/fossil.attach.js
@@ -0,0 +1,42 @@
1
+"use strict";
2
+/**
3
+ Requires that window.fossil has already been set up.
4
+ Depends on fossil.dom.
5
+*/
6
+(function(namespace){
7
+ "use strict";
8
+ const F = namespace, D = fossil.dom;
9
+
10
+ let idCounter = 0;
11
+
12
+ /**
13
+ Implements a multi-file selector widget. Intended to be plugged
14
+ in to places in Fossil's UI where attachments can be assigned to
15
+ an artifact.
16
+ */
17
+ class Attacher {
18
+ #opt;
19
+ #rows = [];
20
+ #e = Object.create(null);
21
+
22
+ /**
23
+ Options:
24
+
25
+ opt.container: DOM element to wrap this object in.
26
+
27
+ opt.addButtonLabel: optional label for the "add attachment"
28
+ button, defaulting to something generic.
29
+ */
30
+ constructor(opt){
31
+ this.#opt = opt = Object.assign(Object.create(null),opt);
32
+ const eBtnAdd = this.#e.btnAdd = D.addClass(
33
+ D.button(this.#opt.addButtonLabel || 'Add attachment',
34
+ ()=>this.#addRow()),
35
+ 'attach-add-button'
36
+ );
37
+ eBtnAdd.type = 'button';
38
+ this.#e.list = D.addClass(Ddiv(), 'attach-container');
39
+ opt.container.appendChild(this.#e.list);addRow(){
40
+ const id = ++idCounter;
41
+ const roremoveRow(id){
42
+ const e = this.#opt.container.querySelector('[data-id="
--- a/src/fossil.attach.js
+++ b/src/fossil.attach.js
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/fossil.attach.js
+++ b/src/fossil.attach.js
@@ -0,0 +1,42 @@
1 "use strict";
2 /**
3 Requires that window.fossil has already been set up.
4 Depends on fossil.dom.
5 */
6 (function(namespace){
7 "use strict";
8 const F = namespace, D = fossil.dom;
9
10 let idCounter = 0;
11
12 /**
13 Implements a multi-file selector widget. Intended to be plugged
14 in to places in Fossil's UI where attachments can be assigned to
15 an artifact.
16 */
17 class Attacher {
18 #opt;
19 #rows = [];
20 #e = Object.create(null);
21
22 /**
23 Options:
24
25 opt.container: DOM element to wrap this object in.
26
27 opt.addButtonLabel: optional label for the "add attachment"
28 button, defaulting to something generic.
29 */
30 constructor(opt){
31 this.#opt = opt = Object.assign(Object.create(null),opt);
32 const eBtnAdd = this.#e.btnAdd = D.addClass(
33 D.button(this.#opt.addButtonLabel || 'Add attachment',
34 ()=>this.#addRow()),
35 'attach-add-button'
36 );
37 eBtnAdd.type = 'button';
38 this.#e.list = D.addClass(Ddiv(), 'attach-container');
39 opt.container.appendChild(this.#e.list);addRow(){
40 const id = ++idCounter;
41 const roremoveRow(id){
42 const e = this.#opt.container.querySelector('[data-id="

Keyboard Shortcuts

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