Fossil SCM

Consolidate some duplicate code. Minor spacing tweak to keep the Status selection widget from overlapping the editor's top border.

stephan 2026-06-08 21:22 UTC forum-editor-2026
Commit 45896a35fdd6fe9e4da132d6e5c0ac967eaa8eb99e647f1333f63235cae3a2f7
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -77,11 +77,11 @@
7777
}
7878
const e = this.#e = F.nu({
7979
mimetype: F.nu(),
8080
button: F.nu()
8181
});
82
- console.debug("Setting up FPE opt =",opt);
82
+ //console.debug("Setting up FPE opt =",opt);
8383
const wrapper = e.widget = D.addClass(D.div(), 'ForumPostEditor');
8484
D.clearElement(wrapper);
8585
8686
if( !opt.inReplyTo ){
8787
/* Title... */
@@ -875,10 +875,20 @@
875875
});
876876
});
877877
}
878878
879879
F.user.isIndividual = ['anonymous','nobody'].indexOf(F.user.name)<0;
880
+
881
+ /* Page-specific style tweaks for a ForumPostEditor instance. */
882
+ const initFPEWidget = (ePost, fpe)=>{
883
+ const w = fpe.widget;
884
+ w.style.borderTop = '1px dotted';
885
+ //w.style.marginTop = '0.35em';
886
+ /* Adding an "Editing..." <h3> here adds way too much space */
887
+ ePost.append(w);
888
+ w.scrollIntoView();
889
+ };
880890
881891
const eForumNew = (
882892
document.body.classList.contains('cpage-forumnew')
883893
|| document.body.classList.contains('cpage-forume1')
884894
)
@@ -963,15 +973,11 @@
963973
draft does not disapper if firt is later edited
964974
(giving us a new firt value here). */
965975
|| fpid
966976
).substr(0,12)
967977
});
968
- const w = fpe.widget;
969
- w.style.borderTop = '2px dotted';
970
- /* Adding an "Editing..." <h3> here adds way too much space */
971
- ePost.append(w);
972
- w.scrollIntoView();
978
+ initFPEWidget(ePost, fpe);
973979
}/*replyClicked()*/;
974980
975981
const editClicked = (form, ePost, eBtnEdit, eToDisable)=>{
976982
const fpid = setupEditReplyElement(ePost, eBtnEdit, eToDisable);
977983
const firt = ePost.dataset.firt;
@@ -999,17 +1005,11 @@
9991005
draftKey: 'draft-forumedit-'+(fEditHead || fpid).substr(0,12),
10001006
edit: artifact,
10011007
status: eStatusSelect?.value,
10021008
inReplyTo: firt
10031009
});
1004
- const w = fpe.widget;
1005
- w.style.borderTop = '2px dotted';
1006
- //w.style.height = '0px';
1007
- /* Adding an "Editing..." <h3> here adds way too much space */
1008
- ePost.append(w);
1009
- w.scrollIntoView();
1010
- //w.style.height = '';
1010
+ initFPEWidget(ePost, fpe);
10111011
});
10121012
}/*editClicked()*/;
10131013
10141014
document.body.querySelectorAll(
10151015
'.forumpost-single-controls > form'
@@ -1048,10 +1048,11 @@
10481048
const eStatusChange = eThePost.querySelector(
10491049
':scope > fieldset.forum-status-selection'
10501050
);
10511051
if( eStatusChange ) eToDisable.push(eStatusChange);
10521052
})/*for-each form*/;
1053
+
10531054
}/* /forumpost and /forumthread */
10541055
10551056
document.body.querySelectorAll('.initially-hidden').forEach(e=>{
10561057
/* This is a workaround for a span.help-buttonlet which we need
10571058
to start hidden so that it does not show up for no-JS
10581059
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -77,11 +77,11 @@
77 }
78 const e = this.#e = F.nu({
79 mimetype: F.nu(),
80 button: F.nu()
81 });
82 console.debug("Setting up FPE opt =",opt);
83 const wrapper = e.widget = D.addClass(D.div(), 'ForumPostEditor');
84 D.clearElement(wrapper);
85
86 if( !opt.inReplyTo ){
87 /* Title... */
@@ -875,10 +875,20 @@
875 });
876 });
877 }
878
879 F.user.isIndividual = ['anonymous','nobody'].indexOf(F.user.name)<0;
 
 
 
 
 
 
 
 
 
 
880
881 const eForumNew = (
882 document.body.classList.contains('cpage-forumnew')
883 || document.body.classList.contains('cpage-forume1')
884 )
@@ -963,15 +973,11 @@
963 draft does not disapper if firt is later edited
964 (giving us a new firt value here). */
965 || fpid
966 ).substr(0,12)
967 });
968 const w = fpe.widget;
969 w.style.borderTop = '2px dotted';
970 /* Adding an "Editing..." <h3> here adds way too much space */
971 ePost.append(w);
972 w.scrollIntoView();
973 }/*replyClicked()*/;
974
975 const editClicked = (form, ePost, eBtnEdit, eToDisable)=>{
976 const fpid = setupEditReplyElement(ePost, eBtnEdit, eToDisable);
977 const firt = ePost.dataset.firt;
@@ -999,17 +1005,11 @@
999 draftKey: 'draft-forumedit-'+(fEditHead || fpid).substr(0,12),
1000 edit: artifact,
1001 status: eStatusSelect?.value,
1002 inReplyTo: firt
1003 });
1004 const w = fpe.widget;
1005 w.style.borderTop = '2px dotted';
1006 //w.style.height = '0px';
1007 /* Adding an "Editing..." <h3> here adds way too much space */
1008 ePost.append(w);
1009 w.scrollIntoView();
1010 //w.style.height = '';
1011 });
1012 }/*editClicked()*/;
1013
1014 document.body.querySelectorAll(
1015 '.forumpost-single-controls > form'
@@ -1048,10 +1048,11 @@
1048 const eStatusChange = eThePost.querySelector(
1049 ':scope > fieldset.forum-status-selection'
1050 );
1051 if( eStatusChange ) eToDisable.push(eStatusChange);
1052 })/*for-each form*/;
 
1053 }/* /forumpost and /forumthread */
1054
1055 document.body.querySelectorAll('.initially-hidden').forEach(e=>{
1056 /* This is a workaround for a span.help-buttonlet which we need
1057 to start hidden so that it does not show up for no-JS
1058
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -77,11 +77,11 @@
77 }
78 const e = this.#e = F.nu({
79 mimetype: F.nu(),
80 button: F.nu()
81 });
82 //console.debug("Setting up FPE opt =",opt);
83 const wrapper = e.widget = D.addClass(D.div(), 'ForumPostEditor');
84 D.clearElement(wrapper);
85
86 if( !opt.inReplyTo ){
87 /* Title... */
@@ -875,10 +875,20 @@
875 });
876 });
877 }
878
879 F.user.isIndividual = ['anonymous','nobody'].indexOf(F.user.name)<0;
880
881 /* Page-specific style tweaks for a ForumPostEditor instance. */
882 const initFPEWidget = (ePost, fpe)=>{
883 const w = fpe.widget;
884 w.style.borderTop = '1px dotted';
885 //w.style.marginTop = '0.35em';
886 /* Adding an "Editing..." <h3> here adds way too much space */
887 ePost.append(w);
888 w.scrollIntoView();
889 };
890
891 const eForumNew = (
892 document.body.classList.contains('cpage-forumnew')
893 || document.body.classList.contains('cpage-forume1')
894 )
@@ -963,15 +973,11 @@
973 draft does not disapper if firt is later edited
974 (giving us a new firt value here). */
975 || fpid
976 ).substr(0,12)
977 });
978 initFPEWidget(ePost, fpe);
 
 
 
 
979 }/*replyClicked()*/;
980
981 const editClicked = (form, ePost, eBtnEdit, eToDisable)=>{
982 const fpid = setupEditReplyElement(ePost, eBtnEdit, eToDisable);
983 const firt = ePost.dataset.firt;
@@ -999,17 +1005,11 @@
1005 draftKey: 'draft-forumedit-'+(fEditHead || fpid).substr(0,12),
1006 edit: artifact,
1007 status: eStatusSelect?.value,
1008 inReplyTo: firt
1009 });
1010 initFPEWidget(ePost, fpe);
 
 
 
 
 
 
1011 });
1012 }/*editClicked()*/;
1013
1014 document.body.querySelectorAll(
1015 '.forumpost-single-controls > form'
@@ -1048,10 +1048,11 @@
1048 const eStatusChange = eThePost.querySelector(
1049 ':scope > fieldset.forum-status-selection'
1050 );
1051 if( eStatusChange ) eToDisable.push(eStatusChange);
1052 })/*for-each form*/;
1053
1054 }/* /forumpost and /forumthread */
1055
1056 document.body.querySelectorAll('.initially-hidden').forEach(e=>{
1057 /* This is a workaround for a span.help-buttonlet which we need
1058 to start hidden so that it does not show up for no-JS
1059
--- src/style.forum.css
+++ src/style.forum.css
@@ -2,10 +2,11 @@
22
33
fieldset.forum-status-selection {
44
max-width: max-content;
55
border-radius: 0.5em;
66
padding: 0 0.5em;
7
+ margin-bottom: 0.35em;
78
}
89
910
.ForumPostEditor {
1011
display: flex;
1112
flex-direction: column;
1213
--- src/style.forum.css
+++ src/style.forum.css
@@ -2,10 +2,11 @@
2
3 fieldset.forum-status-selection {
4 max-width: max-content;
5 border-radius: 0.5em;
6 padding: 0 0.5em;
 
7 }
8
9 .ForumPostEditor {
10 display: flex;
11 flex-direction: column;
12
--- src/style.forum.css
+++ src/style.forum.css
@@ -2,10 +2,11 @@
2
3 fieldset.forum-status-selection {
4 max-width: max-content;
5 border-radius: 0.5em;
6 padding: 0 0.5em;
7 margin-bottom: 0.35em;
8 }
9
10 .ForumPostEditor {
11 display: flex;
12 flex-direction: column;
13

Keyboard Shortcuts

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