From 3e9927dc6739731c9320cdba0e087c7fbc796414 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 3 Dec 2023 02:01:06 +0200 Subject: [PATCH] Add editor textareas maximize --- public/index.html | 10 ++++++---- public/scripts/chats.js | 19 +++++++++++++++++++ public/style.css | 1 - 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index 04b193037..11bdec577 100644 --- a/public/index.html +++ b/public/index.html @@ -3466,8 +3466,9 @@
-
+
Description + @@ -3477,12 +3478,13 @@ Tokens: counting...
- +
First message + - +
- +
diff --git a/public/scripts/chats.js b/public/scripts/chats.js index 12caf02ec..98a8b2942 100644 --- a/public/scripts/chats.js +++ b/public/scripts/chats.js @@ -377,6 +377,25 @@ jQuery(function () { embedMessageFile(messageId, messageBlock); }); + $(document).on('click', '.editor_maximize', function () { + const broId = $(this).data('for'); + const bro = $(`#${broId}`); + + if (!bro.length) { + console.error('Could not find editor with id', broId); + return; + } + + const textarea = document.createElement('textarea'); + textarea.value = String(bro.val()); + textarea.classList.add('height100p'); + textarea.oninput = function () { + bro.val(textarea.value).trigger('input'); + }; + + callPopup(textarea, 'text', '', { wide: true, large: true }); + }); + $('#file_form_input').on('change', onFileAttach); $('#file_form').on('reset', function () { $('#file_form').addClass('displayNone'); diff --git a/public/style.css b/public/style.css index e1a5efdc4..17a91c52f 100644 --- a/public/style.css +++ b/public/style.css @@ -1145,7 +1145,6 @@ input[type="file"] { display: block; cursor: pointer; text-align: center; - padding-right: 20px; margin-top: 0; filter: grayscale(1) brightness(75%); -webkit-transition: all 0.5s ease-in-out;