Merge pull request #3662 from SillyTavern/enable-md-hotkeys-in-expando Add markdown hotkeys support for expando editor on textareas that support markdown

137927bb43d3aa35e298b7706f487e06dce53e15

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +3 -2Showing whitespace changes
public/scripts/chats.js+3 -2
@@ -1506,7 +1506,7 @@ jQuery(function () {
1506 embedMessageFile(messageId, messageBlock);1506 embedMessageFile(messageId, messageBlock);
1507 });1507 });
15081508
1509 $(document).on('click', '.editor_maximize', function () {1509 $(document).on('click', '.editor_maximize', async function () {
1510 const broId = $(this).attr('data-for');1510 const broId = $(this).attr('data-for');
1511 const bro = $(`#${broId}`);1511 const bro = $(`#${broId}`);
1512 const contentEditable = bro.is('[contenteditable]');1512 const contentEditable = bro.is('[contenteditable]');
@@ -1525,6 +1525,7 @@ jQuery(function () {
1525 textarea.value = String(contentEditable ? bro[0].innerText : bro.val());1525 textarea.value = String(contentEditable ? bro[0].innerText : bro.val());
1526 textarea.classList.add('height100p', 'wide100p', 'maximized_textarea');1526 textarea.classList.add('height100p', 'wide100p', 'maximized_textarea');
1527 bro.hasClass('monospace') && textarea.classList.add('monospace');1527 bro.hasClass('monospace') && textarea.classList.add('monospace');
1528 bro.hasClass('mdHotkeys') && textarea.classList.add('mdHotkeys');
1528 textarea.addEventListener('input', function () {1529 textarea.addEventListener('input', function () {
1529 if (contentEditable) {1530 if (contentEditable) {
1530 bro[0].innerText = textarea.value;1531 bro[0].innerText = textarea.value;
@@ -1565,7 +1566,7 @@ jQuery(function () {
1565 });1566 });
1566 }1567 }
15671568
1568 callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });1569 await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });
1569 });1570 });
15701571
1571 $(document).on('click', 'body.documentstyle .mes .mes_text', function () {1572 $(document).on('click', 'body.documentstyle .mes .mes_text', function () {