Add md hotkey support for expando editor - When original textarea supports markdown, the textarea of the expanded popup will also have markdown support - Also add the small markdown icon at the top

0cde7e7a7fe6d13b279d8bda6cb8e36eaf2d7f87

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +8 -2Showing whitespace changes
public/scripts/chats.js+8 -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,12 @@ 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 if (power_user.enable_md_hotkeys && bro.hasClass('mdHotkeys')) {
1529 textarea.classList.add('mdHotkeys');
1530 const mdIcon = document.createElement('i');
1531 mdIcon.classList.add('fa-brands', 'fa-markdown', 'mdhotkey_icon', 'alignSelfStart');
1532 wrapper.appendChild(mdIcon);
1533 }
1528 textarea.addEventListener('input', function () {1534 textarea.addEventListener('input', function () {
1529 if (contentEditable) {1535 if (contentEditable) {
1530 bro[0].innerText = textarea.value;1536 bro[0].innerText = textarea.value;
@@ -1565,7 +1571,7 @@ jQuery(function () {
1565 });1571 });
1566 }1572 }
15671573
1568 callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });1574 await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });
1569 });1575 });
15701576
1571 $(document).on('click', 'body.documentstyle .mes .mes_text', function () {1577 $(document).on('click', 'body.documentstyle .mes .mes_text', function () {