Fossil SCM

Re-scope a var in /chat, noticed while looking up the answer to an off-list question about its keystroke handling. No functional change.

stephan 2025-12-11 20:11 trunk
Commit 9c2741ec927bc58926ed3abc572512f0f835320210aa823fa2096a342987282a
1 file changed +1 -1
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1940,11 +1940,10 @@
19401940
if(13 !== ev.keyCode) return;
19411941
const text = Chat.inputValue().trim();
19421942
const ctrlMode = Chat.settings.getBool('edit-ctrl-send', false);
19431943
//console.debug("Enter key event:", ctrlMode, ev.ctrlKey, ev.shiftKey, ev);
19441944
if(ev.shiftKey){
1945
- const compactMode = Chat.settings.getBool('edit-compact-mode', false);
19461945
ev.preventDefault();
19471946
ev.stopPropagation();
19481947
/* Shift-enter will run preview mode UNLESS the input field is empty
19491948
AND (preview or search mode) is active, in which cases it will
19501949
switch back to message view. */
@@ -1951,10 +1950,11 @@
19511950
if(!text &&
19521951
(Chat.e.currentView===Chat.e.viewPreview
19531952
| Chat.e.currentView===Chat.e.viewSearch)){
19541953
Chat.setCurrentView(Chat.e.viewMessages);
19551954
}else if(!text){
1955
+ const compactMode = Chat.settings.getBool('edit-compact-mode', false);
19561956
f.$toggleCompact(compactMode);
19571957
}else if(Chat.settings.getBool('edit-shift-enter-preview', true)){
19581958
Chat.e.btnPreview.click();
19591959
}
19601960
return false;
19611961
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1940,11 +1940,10 @@
1940 if(13 !== ev.keyCode) return;
1941 const text = Chat.inputValue().trim();
1942 const ctrlMode = Chat.settings.getBool('edit-ctrl-send', false);
1943 //console.debug("Enter key event:", ctrlMode, ev.ctrlKey, ev.shiftKey, ev);
1944 if(ev.shiftKey){
1945 const compactMode = Chat.settings.getBool('edit-compact-mode', false);
1946 ev.preventDefault();
1947 ev.stopPropagation();
1948 /* Shift-enter will run preview mode UNLESS the input field is empty
1949 AND (preview or search mode) is active, in which cases it will
1950 switch back to message view. */
@@ -1951,10 +1950,11 @@
1951 if(!text &&
1952 (Chat.e.currentView===Chat.e.viewPreview
1953 | Chat.e.currentView===Chat.e.viewSearch)){
1954 Chat.setCurrentView(Chat.e.viewMessages);
1955 }else if(!text){
 
1956 f.$toggleCompact(compactMode);
1957 }else if(Chat.settings.getBool('edit-shift-enter-preview', true)){
1958 Chat.e.btnPreview.click();
1959 }
1960 return false;
1961
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1940,11 +1940,10 @@
1940 if(13 !== ev.keyCode) return;
1941 const text = Chat.inputValue().trim();
1942 const ctrlMode = Chat.settings.getBool('edit-ctrl-send', false);
1943 //console.debug("Enter key event:", ctrlMode, ev.ctrlKey, ev.shiftKey, ev);
1944 if(ev.shiftKey){
 
1945 ev.preventDefault();
1946 ev.stopPropagation();
1947 /* Shift-enter will run preview mode UNLESS the input field is empty
1948 AND (preview or search mode) is active, in which cases it will
1949 switch back to message view. */
@@ -1951,10 +1950,11 @@
1950 if(!text &&
1951 (Chat.e.currentView===Chat.e.viewPreview
1952 | Chat.e.currentView===Chat.e.viewSearch)){
1953 Chat.setCurrentView(Chat.e.viewMessages);
1954 }else if(!text){
1955 const compactMode = Chat.settings.getBool('edit-compact-mode', false);
1956 f.$toggleCompact(compactMode);
1957 }else if(Chat.settings.getBool('edit-shift-enter-preview', true)){
1958 Chat.e.btnPreview.click();
1959 }
1960 return false;
1961

Keyboard Shortcuts

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