Fossil SCM

Re-enabled ctrl-enter-sends when enter-sends mode is active (was disabled during testing). Update the tooltip on the send button to reflect the current send mode.

stephan 2021-09-30 19:56 chat-input-rework
Commit 7d6c07496ed3741a64936475b6a15ecc9b252c4832485f813417cdac74094351
1 file changed +4 -2
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1260,13 +1260,14 @@
12601260
only be suitable when we're at the end of the input.
12611261
12621262
Strangely, this approach DOES work for shift-enter, but we
12631263
need shift-enter as a hotkey for preview mode.
12641264
*/
1265
- return;
1265
+ //return;
1266
+ // return here "should" cause newline to be added, but that doesn't work
12661267
}
1267
- if((!ctrlMode && !ev.ctrlKey) || (ev.ctrlKey && ctrlMode)){
1268
+ if((!ctrlMode && !ev.ctrlKey) || (ev.ctrlKey/* && ctrlMode*/)){
12681269
/* Ship it! */
12691270
ev.preventDefault();
12701271
ev.stopPropagation();
12711272
Chat.submitMessage();
12721273
return false;
@@ -1521,10 +1522,11 @@
15211522
});
15221523
Chat.settings.addListener('edit-ctrl-send',function(s){
15231524
const label = (s.value ? "Ctrl-" : "")+"Enter submits messages.";
15241525
const eInput = Chat.inputElement();
15251526
eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label;
1527
+ Chat.e.btnSubmit.title = label;
15261528
F.toast.message(label);
15271529
});
15281530
const valueKludges = {
15291531
/* Convert certain string-format values to other types... */
15301532
"false": false,
15311533
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1260,13 +1260,14 @@
1260 only be suitable when we're at the end of the input.
1261
1262 Strangely, this approach DOES work for shift-enter, but we
1263 need shift-enter as a hotkey for preview mode.
1264 */
1265 return;
 
1266 }
1267 if((!ctrlMode && !ev.ctrlKey) || (ev.ctrlKey && ctrlMode)){
1268 /* Ship it! */
1269 ev.preventDefault();
1270 ev.stopPropagation();
1271 Chat.submitMessage();
1272 return false;
@@ -1521,10 +1522,11 @@
1521 });
1522 Chat.settings.addListener('edit-ctrl-send',function(s){
1523 const label = (s.value ? "Ctrl-" : "")+"Enter submits messages.";
1524 const eInput = Chat.inputElement();
1525 eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label;
 
1526 F.toast.message(label);
1527 });
1528 const valueKludges = {
1529 /* Convert certain string-format values to other types... */
1530 "false": false,
1531
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1260,13 +1260,14 @@
1260 only be suitable when we're at the end of the input.
1261
1262 Strangely, this approach DOES work for shift-enter, but we
1263 need shift-enter as a hotkey for preview mode.
1264 */
1265 //return;
1266 // return here "should" cause newline to be added, but that doesn't work
1267 }
1268 if((!ctrlMode && !ev.ctrlKey) || (ev.ctrlKey/* && ctrlMode*/)){
1269 /* Ship it! */
1270 ev.preventDefault();
1271 ev.stopPropagation();
1272 Chat.submitMessage();
1273 return false;
@@ -1521,10 +1522,11 @@
1522 });
1523 Chat.settings.addListener('edit-ctrl-send',function(s){
1524 const label = (s.value ? "Ctrl-" : "")+"Enter submits messages.";
1525 const eInput = Chat.inputElement();
1526 eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label;
1527 Chat.e.btnSubmit.title = label;
1528 F.toast.message(label);
1529 });
1530 const valueKludges = {
1531 /* Convert certain string-format values to other types... */
1532 "false": false,
1533

Keyboard Shortcuts

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