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.
Commit
7d6c07496ed3741a64936475b6a15ecc9b252c4832485f813417cdac74094351
Parent
86d6be3fe212ad5…
1 file changed
+4
-2
+4
-2
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -1260,13 +1260,14 @@ | ||
| 1260 | 1260 | only be suitable when we're at the end of the input. |
| 1261 | 1261 | |
| 1262 | 1262 | Strangely, this approach DOES work for shift-enter, but we |
| 1263 | 1263 | need shift-enter as a hotkey for preview mode. |
| 1264 | 1264 | */ |
| 1265 | - return; | |
| 1265 | + //return; | |
| 1266 | + // return here "should" cause newline to be added, but that doesn't work | |
| 1266 | 1267 | } |
| 1267 | - if((!ctrlMode && !ev.ctrlKey) || (ev.ctrlKey && ctrlMode)){ | |
| 1268 | + if((!ctrlMode && !ev.ctrlKey) || (ev.ctrlKey/* && ctrlMode*/)){ | |
| 1268 | 1269 | /* Ship it! */ |
| 1269 | 1270 | ev.preventDefault(); |
| 1270 | 1271 | ev.stopPropagation(); |
| 1271 | 1272 | Chat.submitMessage(); |
| 1272 | 1273 | return false; |
| @@ -1521,10 +1522,11 @@ | ||
| 1521 | 1522 | }); |
| 1522 | 1523 | Chat.settings.addListener('edit-ctrl-send',function(s){ |
| 1523 | 1524 | const label = (s.value ? "Ctrl-" : "")+"Enter submits messages."; |
| 1524 | 1525 | const eInput = Chat.inputElement(); |
| 1525 | 1526 | eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label; |
| 1527 | + Chat.e.btnSubmit.title = label; | |
| 1526 | 1528 | F.toast.message(label); |
| 1527 | 1529 | }); |
| 1528 | 1530 | const valueKludges = { |
| 1529 | 1531 | /* Convert certain string-format values to other types... */ |
| 1530 | 1532 | "false": false, |
| 1531 | 1533 |
| --- 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 |