Fossil SCM

Minor cleanups. Add a 'Post as USERNAME' label to the forum editor, per suggestion in the forum.

stephan 2026-06-12 14:24 UTC forum-editor-2026
Commit 73c5b76df7e89a339896cc9f499b245d86961b83c32dba7a15a9cc1a6667412d
+6 -3
--- src/builtin.c
+++ src/builtin.c
@@ -690,15 +690,17 @@
690690
if(i) CX(",");
691691
CX("{label:%!j, value:%!j}", fs->zLabel, fs->zValue);
692692
}
693693
CX("];\n");
694694
}
695
+#define JBOOL(COND) ((COND) ? "true" : "false")
695696
CX("window.fossil.user = {");
696697
CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest");
697
- CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false");
698
- CX("mayAttachForum: %s,", g.perm.AttachForum ? "true" : "false");
699
- CX("enableDebug: %s", (g.perm.Debug || g.perm.Admin) ? "true" : "false");
698
+ CX("isAdmin: %s,", JBOOL(g.perm.Admin || g.perm.Setup));
699
+ CX("mayAttachForum: %s,", JBOOL(g.perm.AttachForum));
700
+ CX("enableDebug: %s,", JBOOL(g.perm.Debug || g.perm.Admin));
701
+ CX("isIndividual: %s", JBOOL(login_is_individual()));
700702
CX("};\n"/*fossil.user*/);
701703
CX("if(fossil.config.skin.isDark) "
702704
"document.body.classList.add('fossil-dark-style');\n");
703705
/*
704706
** fossil.page holds info about the current page. This is also
@@ -714,10 +716,11 @@
714716
}
715717
/* The remaining window.fossil bootstrap code is not dependent on
716718
** C-runtime state... */
717719
builtin_request_js("fossil.bootstrap.js");
718720
}
721
+#undef JBOOL
719722
}
720723
721724
/*
722725
** Given the NAME part of fossil.NAME.js, this function checks whether
723726
** that module has been emitted by this function before. If it has,
724727
--- src/builtin.c
+++ src/builtin.c
@@ -690,15 +690,17 @@
690 if(i) CX(",");
691 CX("{label:%!j, value:%!j}", fs->zLabel, fs->zValue);
692 }
693 CX("];\n");
694 }
 
695 CX("window.fossil.user = {");
696 CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest");
697 CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false");
698 CX("mayAttachForum: %s,", g.perm.AttachForum ? "true" : "false");
699 CX("enableDebug: %s", (g.perm.Debug || g.perm.Admin) ? "true" : "false");
 
700 CX("};\n"/*fossil.user*/);
701 CX("if(fossil.config.skin.isDark) "
702 "document.body.classList.add('fossil-dark-style');\n");
703 /*
704 ** fossil.page holds info about the current page. This is also
@@ -714,10 +716,11 @@
714 }
715 /* The remaining window.fossil bootstrap code is not dependent on
716 ** C-runtime state... */
717 builtin_request_js("fossil.bootstrap.js");
718 }
 
719 }
720
721 /*
722 ** Given the NAME part of fossil.NAME.js, this function checks whether
723 ** that module has been emitted by this function before. If it has,
724
--- src/builtin.c
+++ src/builtin.c
@@ -690,15 +690,17 @@
690 if(i) CX(",");
691 CX("{label:%!j, value:%!j}", fs->zLabel, fs->zValue);
692 }
693 CX("];\n");
694 }
695 #define JBOOL(COND) ((COND) ? "true" : "false")
696 CX("window.fossil.user = {");
697 CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest");
698 CX("isAdmin: %s,", JBOOL(g.perm.Admin || g.perm.Setup));
699 CX("mayAttachForum: %s,", JBOOL(g.perm.AttachForum));
700 CX("enableDebug: %s,", JBOOL(g.perm.Debug || g.perm.Admin));
701 CX("isIndividual: %s", JBOOL(login_is_individual()));
702 CX("};\n"/*fossil.user*/);
703 CX("if(fossil.config.skin.isDark) "
704 "document.body.classList.add('fossil-dark-style');\n");
705 /*
706 ** fossil.page holds info about the current page. This is also
@@ -714,10 +716,11 @@
716 }
717 /* The remaining window.fossil bootstrap code is not dependent on
718 ** C-runtime state... */
719 builtin_request_js("fossil.bootstrap.js");
720 }
721 #undef JBOOL
722 }
723
724 /*
725 ** Given the NAME part of fossil.NAME.js, this function checks whether
726 ** that module has been emitted by this function before. If it has,
727
+4 -4
--- src/forum.c
+++ src/forum.c
@@ -2289,21 +2289,21 @@
22892289
** to closed posts. If false, only administrators may do so. Note that
22902290
** this only affects the forum web UI, not post-closing tags which
22912291
** arrive via the command-line or from synchronization with a remote.
22922292
** This policy also determines whether moderators may delete forum
22932293
** attachments.
2294
-*/
2295
-/*
2294
+**
22962295
** SETTING: forum-title width=20 default=Forum
22972296
** This is the name or "title" of the Forum for this repository. The
22982297
** default is just "Forum". But in some setups, admins might want to
22992298
** change it to "Developer Forum" or "User Forum" or whatever other name
23002299
** seems more appropriate for the particular usage.
23012300
**
23022301
** SETTING: attachment-size-limit width=16
2303
-** The maximum number of bytes for an attachment. The default (or 0) is
2304
-** unlimited but a limit may be imposed by the web server or a proxy.
2302
+** The maximum number of bytes for an attachment to a wiki page,
2303
+** ticket, tech note, or forum post. The default (or 0) is unlimited
2304
+** but a limit may be imposed by the web server or a proxy.
23052305
**
23062306
** SETTING: forum-statuses width=40 block-text
23072307
** This JSON5-formatted value defines an array of objects describing
23082308
** the available statuses of forum posts. Each entry of the array must
23092309
** be an object in the form {label:"X",value:"Y"}.
23102310
--- src/forum.c
+++ src/forum.c
@@ -2289,21 +2289,21 @@
2289 ** to closed posts. If false, only administrators may do so. Note that
2290 ** this only affects the forum web UI, not post-closing tags which
2291 ** arrive via the command-line or from synchronization with a remote.
2292 ** This policy also determines whether moderators may delete forum
2293 ** attachments.
2294 */
2295 /*
2296 ** SETTING: forum-title width=20 default=Forum
2297 ** This is the name or "title" of the Forum for this repository. The
2298 ** default is just "Forum". But in some setups, admins might want to
2299 ** change it to "Developer Forum" or "User Forum" or whatever other name
2300 ** seems more appropriate for the particular usage.
2301 **
2302 ** SETTING: attachment-size-limit width=16
2303 ** The maximum number of bytes for an attachment. The default (or 0) is
2304 ** unlimited but a limit may be imposed by the web server or a proxy.
 
2305 **
2306 ** SETTING: forum-statuses width=40 block-text
2307 ** This JSON5-formatted value defines an array of objects describing
2308 ** the available statuses of forum posts. Each entry of the array must
2309 ** be an object in the form {label:"X",value:"Y"}.
2310
--- src/forum.c
+++ src/forum.c
@@ -2289,21 +2289,21 @@
2289 ** to closed posts. If false, only administrators may do so. Note that
2290 ** this only affects the forum web UI, not post-closing tags which
2291 ** arrive via the command-line or from synchronization with a remote.
2292 ** This policy also determines whether moderators may delete forum
2293 ** attachments.
2294 **
 
2295 ** SETTING: forum-title width=20 default=Forum
2296 ** This is the name or "title" of the Forum for this repository. The
2297 ** default is just "Forum". But in some setups, admins might want to
2298 ** change it to "Developer Forum" or "User Forum" or whatever other name
2299 ** seems more appropriate for the particular usage.
2300 **
2301 ** SETTING: attachment-size-limit width=16
2302 ** The maximum number of bytes for an attachment to a wiki page,
2303 ** ticket, tech note, or forum post. The default (or 0) is unlimited
2304 ** but a limit may be imposed by the web server or a proxy.
2305 **
2306 ** SETTING: forum-statuses width=40 block-text
2307 ** This JSON5-formatted value defines an array of objects describing
2308 ** the available statuses of forum posts. Each entry of the array must
2309 ** be an object in the form {label:"X",value:"Y"}.
2310
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -396,10 +396,16 @@
396396
et.classList.toggle('hidden');
397397
}
398398
});
399399
e.buttons.append(e.button.toggleHeader);
400400
}
401
+
402
+ {
403
+ const eLbl = D.label(false, "Posting as "+F.user.name)
404
+ eLbl.classList.add('logged-in-as');
405
+ e.buttons.append(eLbl);
406
+ }
401407
402408
}/*constructor*/
403409
404410
/*
405411
** Removes this object from the DOM. It has no side effects if
@@ -523,11 +529,11 @@
523529
"WARNING: draft edits are keyed on the ID of the message they ",
524530
"are editing or responding to. Attempting to edit or reply to ",
525531
"the same post from multiple tabs will cause the most-recently-edited ",
526532
"one to overwrite the draft slot for that post. In browsers which support ",
527533
"Web Locks, a second attempt to edit or reply to a post will be blocked ",
528
- "and an error will be shown explaning the problem."
534
+ "and an error will be shown explaining the problem."
529535
);
530536
if( this.#e.status ){
531537
D.append(
532538
D.li(list),
533539
"Tip: changing just the status in the editor will change only that, ",
534540
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -396,10 +396,16 @@
396 et.classList.toggle('hidden');
397 }
398 });
399 e.buttons.append(e.button.toggleHeader);
400 }
 
 
 
 
 
 
401
402 }/*constructor*/
403
404 /*
405 ** Removes this object from the DOM. It has no side effects if
@@ -523,11 +529,11 @@
523 "WARNING: draft edits are keyed on the ID of the message they ",
524 "are editing or responding to. Attempting to edit or reply to ",
525 "the same post from multiple tabs will cause the most-recently-edited ",
526 "one to overwrite the draft slot for that post. In browsers which support ",
527 "Web Locks, a second attempt to edit or reply to a post will be blocked ",
528 "and an error will be shown explaning the problem."
529 );
530 if( this.#e.status ){
531 D.append(
532 D.li(list),
533 "Tip: changing just the status in the editor will change only that, ",
534
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -396,10 +396,16 @@
396 et.classList.toggle('hidden');
397 }
398 });
399 e.buttons.append(e.button.toggleHeader);
400 }
401
402 {
403 const eLbl = D.label(false, "Posting as "+F.user.name)
404 eLbl.classList.add('logged-in-as');
405 e.buttons.append(eLbl);
406 }
407
408 }/*constructor*/
409
410 /*
411 ** Removes this object from the DOM. It has no side effects if
@@ -523,11 +529,11 @@
529 "WARNING: draft edits are keyed on the ID of the message they ",
530 "are editing or responding to. Attempting to edit or reply to ",
531 "the same post from multiple tabs will cause the most-recently-edited ",
532 "one to overwrite the draft slot for that post. In browsers which support ",
533 "Web Locks, a second attempt to edit or reply to a post will be blocked ",
534 "and an error will be shown explaining the problem."
535 );
536 if( this.#e.status ){
537 D.append(
538 D.li(list),
539 "Tip: changing just the status in the editor will change only that, ",
540
--- src/style.forum.css
+++ src/style.forum.css
@@ -90,10 +90,14 @@
9090
align-items: last baseline;
9191
cursor: pointer;
9292
border: 1px inset rgba(128, 128, 128, 0.5);
9393
border-radius: 0.25em;
9494
padding: 0.1em;
95
+}
96
+.ForumPostEditor > .buttons > label.logged-in-as {
97
+ cursor: initial;
98
+ white-space: nowrap;
9599
}
96100
.ForumPostEditor > .buttons > label > input[type=checkbox]{
97101
cursor: pointer;
98102
}
99103
100104
--- src/style.forum.css
+++ src/style.forum.css
@@ -90,10 +90,14 @@
90 align-items: last baseline;
91 cursor: pointer;
92 border: 1px inset rgba(128, 128, 128, 0.5);
93 border-radius: 0.25em;
94 padding: 0.1em;
 
 
 
 
95 }
96 .ForumPostEditor > .buttons > label > input[type=checkbox]{
97 cursor: pointer;
98 }
99
100
--- src/style.forum.css
+++ src/style.forum.css
@@ -90,10 +90,14 @@
90 align-items: last baseline;
91 cursor: pointer;
92 border: 1px inset rgba(128, 128, 128, 0.5);
93 border-radius: 0.25em;
94 padding: 0.1em;
95 }
96 .ForumPostEditor > .buttons > label.logged-in-as {
97 cursor: initial;
98 white-space: nowrap;
99 }
100 .ForumPostEditor > .buttons > label > input[type=checkbox]{
101 cursor: pointer;
102 }
103
104

Keyboard Shortcuts

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