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 -2Ignore whitespace
public/scripts/chats.js+8 -2
@@ -1506,7 +1506,7 @@ jQuery(function () {
15061506 embedMessageFile(messageId, messageBlock);
15071507 });
15081508
15091509 $(document).on('click', '.editor_maximize', async function () {
15101510 const broId = $(this).attr('data-for');
15111511 const bro = $(`#${broId}`);
15121512 const contentEditable = bro.is('[contenteditable]');
@@ -1525,6 +1525,12 @@ jQuery(function () {
15251525 textarea.value = String(contentEditable ? bro[0].innerText : bro.val());
15261526 textarea.classList.add('height100p', 'wide100p', 'maximized_textarea');
15271527 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+ }
15281534 textarea.addEventListener('input', function () {
15291535 if (contentEditable) {
15301536 bro[0].innerText = textarea.value;
@@ -1565,7 +1571,7 @@ jQuery(function () {
15651571 });
15661572 }
15671573
15681574 await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });
15691575 });
15701576
15711577 $(document).on('click', 'body.documentstyle .mes .mes_text', function () {