Fossil SCM

Remove the new Stash button from /forumnew, where it is unhelpful.

stephan 2026-06-13 15:33 UTC forum-editor-2026
Commit e9e4c4fabea8c42dddfa505c9a933b656871cfd2798ef7c5cb4c8938b60c9e97
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -90,17 +90,18 @@
9090
post, this is the full JSON-format artifact of the forum post
9191
the being-edited post, as returned by /ajax/artifact.json.
9292
9393
opt.status: optional current status tag value for opt.edit,
9494
if known. This is used for pre-selecting a status value.
95
+
96
+ opt.hideStash[bool=false]: if true, the "Stash" button does not
97
+ get added. Intended for use with /forumnew.
9598
*/
9699
constructor(opt){
97100
opt = this.#opt = F.nu({
98
- // todo: defaults once we determine the options
99
- // inReplyTo: hash
100
- // fpid: hash
101
- draftKey: undefined
101
+ draftKey: undefined,
102
+ hideStash: false
102103
}, opt);
103104
opt.isNewThread = !opt.inReplyTo && !opt.edit;
104105
if( opt.draftKey ){
105106
this.#draft = F.nu(F.storage.getJSON(opt.draftKey, {}));
106107
}
@@ -174,11 +175,11 @@
174175
e.button.submit = D.attr(
175176
D.button("Submit"),
176177
'title',
177178
'Save any edits to the server. Not permitted until Preview has been used.'
178179
);
179
- if( this.#draft ){
180
+ if( this.#draft && !opt.hideStash ){
180181
e.button.stash = D.attr(
181182
D.button(
182183
"Stash", e=>this.close()
183184
/* This could be called Close, but that would semantically
184185
collide with the Close [this post] button. All "Stash"
@@ -1054,10 +1055,11 @@
10541055
if( plugInEditor && eForumNew ){
10551056
/* /forumnew and /forume1 */
10561057
const fpe = new F.ForumPostEditor({
10571058
draftKey: 'draft-forumnew',
10581059
hiddenFields: eForumNew.querySelectorAll('input[type=hidden]'),
1060
+ hideStash: true,
10591061
ondiscard: ()=>{
10601062
window.location = F.repoUrl('forum');
10611063
},
10621064
onsubmit: (fpe, response)=>{
10631065
window.location = F.repoUrl('forumpost/'+response.uuid);
10641066
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -90,17 +90,18 @@
90 post, this is the full JSON-format artifact of the forum post
91 the being-edited post, as returned by /ajax/artifact.json.
92
93 opt.status: optional current status tag value for opt.edit,
94 if known. This is used for pre-selecting a status value.
 
 
 
95 */
96 constructor(opt){
97 opt = this.#opt = F.nu({
98 // todo: defaults once we determine the options
99 // inReplyTo: hash
100 // fpid: hash
101 draftKey: undefined
102 }, opt);
103 opt.isNewThread = !opt.inReplyTo && !opt.edit;
104 if( opt.draftKey ){
105 this.#draft = F.nu(F.storage.getJSON(opt.draftKey, {}));
106 }
@@ -174,11 +175,11 @@
174 e.button.submit = D.attr(
175 D.button("Submit"),
176 'title',
177 'Save any edits to the server. Not permitted until Preview has been used.'
178 );
179 if( this.#draft ){
180 e.button.stash = D.attr(
181 D.button(
182 "Stash", e=>this.close()
183 /* This could be called Close, but that would semantically
184 collide with the Close [this post] button. All "Stash"
@@ -1054,10 +1055,11 @@
1054 if( plugInEditor && eForumNew ){
1055 /* /forumnew and /forume1 */
1056 const fpe = new F.ForumPostEditor({
1057 draftKey: 'draft-forumnew',
1058 hiddenFields: eForumNew.querySelectorAll('input[type=hidden]'),
 
1059 ondiscard: ()=>{
1060 window.location = F.repoUrl('forum');
1061 },
1062 onsubmit: (fpe, response)=>{
1063 window.location = F.repoUrl('forumpost/'+response.uuid);
1064
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -90,17 +90,18 @@
90 post, this is the full JSON-format artifact of the forum post
91 the being-edited post, as returned by /ajax/artifact.json.
92
93 opt.status: optional current status tag value for opt.edit,
94 if known. This is used for pre-selecting a status value.
95
96 opt.hideStash[bool=false]: if true, the "Stash" button does not
97 get added. Intended for use with /forumnew.
98 */
99 constructor(opt){
100 opt = this.#opt = F.nu({
101 draftKey: undefined,
102 hideStash: false
 
 
103 }, opt);
104 opt.isNewThread = !opt.inReplyTo && !opt.edit;
105 if( opt.draftKey ){
106 this.#draft = F.nu(F.storage.getJSON(opt.draftKey, {}));
107 }
@@ -174,11 +175,11 @@
175 e.button.submit = D.attr(
176 D.button("Submit"),
177 'title',
178 'Save any edits to the server. Not permitted until Preview has been used.'
179 );
180 if( this.#draft && !opt.hideStash ){
181 e.button.stash = D.attr(
182 D.button(
183 "Stash", e=>this.close()
184 /* This could be called Close, but that would semantically
185 collide with the Close [this post] button. All "Stash"
@@ -1054,10 +1055,11 @@
1055 if( plugInEditor && eForumNew ){
1056 /* /forumnew and /forume1 */
1057 const fpe = new F.ForumPostEditor({
1058 draftKey: 'draft-forumnew',
1059 hiddenFields: eForumNew.querySelectorAll('input[type=hidden]'),
1060 hideStash: true,
1061 ondiscard: ()=>{
1062 window.location = F.repoUrl('forum');
1063 },
1064 onsubmit: (fpe, response)=>{
1065 window.location = F.repoUrl('forumpost/'+response.uuid);
1066

Keyboard Shortcuts

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