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
| @@ -1506,7 +1506,7 @@ jQuery(function () { | |||
| 1506 | embedMessageFile(messageId, messageBlock); | 1506 | embedMessageFile(messageId, messageBlock); |
| 1507 | }); | 1507 | }); |
| 1508 | 1508 | ||
| 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 | } |
| 1567 | 1573 | ||
| 1568 | callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true }); | 1574 | await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true }); |
| 1569 | }); | 1575 | }); |
| 1570 | 1576 | ||
| 1571 | $(document).on('click', 'body.documentstyle .mes .mes_text', function () { | 1577 | $(document).on('click', 'body.documentstyle .mes .mes_text', function () { |