Add expand editor for WI content Closes #3764
| @@ -6101,8 +6101,11 @@ | ||
| 6101 | 6101 | <label for="content "> |
| 6102 | 6102 | <small> |
| 6103 | 6103 | <span class="alignitemscenter flex-container flexnowrap wide100p justifySpaceBetween"> |
| 6104 | 6104 | <span data-i18n="Content" class="alignitemscenter flex-container flexNoGap mdhotkey_location"> |
| 6105 | - Content | |
| 6105 | + <span data-i18n="Content" class="mdhotkey_location"> | |
| 6106 | + Content | |
| 6107 | + </span> | |
| 6108 | + <i class="editor_maximize fa-solid fa-maximize right_menu_button" title="Expand the editor" data-i18n="[title]Expand the editor"></i> | |
| 6106 | 6109 | </span> |
| 6107 | 6110 | <span> |
| 6108 | 6111 | (<span data-i18n="extension_token_counter">Tokens:</span> <span class="world_entry_form_token_counter" data-first-run="true">counting...</span>) |
| @@ -2680,8 +2680,10 @@ export async function getWorldEntry(name, data, entry) { | ||
| 2680 | 2680 | $(counter).text(numberOfTokens); |
| 2681 | 2681 | }, debounce_timeout.relaxed); |
| 2682 | 2682 | |
| 2683 | + const contentInputId = `world_entry_content_${entry.uid}`; | |
| 2683 | 2684 | const contentInput = template.find('textarea[name="content"]'); |
| 2684 | 2685 | contentInput.data('uid', entry.uid); |
| 2686 | + contentInput.attr('id', contentInputId); | |
| 2685 | 2687 | contentInput.on('input', async function (_, { skipCount } = {}) { |
| 2686 | 2688 | const uid = $(this).data('uid'); |
| 2687 | 2689 | const value = $(this).val(); |
| @@ -2698,7 +2700,9 @@ export async function getWorldEntry(name, data, entry) { | ||
| 2698 | 2700 | countTokensDebounced(counter, value); |
| 2699 | 2701 | }); |
| 2700 | 2702 | contentInput.val(entry.content).trigger('input', { skipCount: true }); |
| 2701 | - //initScrollHeight(contentInput); | |
| 2703 | + | |
| 2704 | + const contentExpandButton = template.find('.editor_maximize'); | |
| 2705 | + contentExpandButton.attr('data-for', contentInputId); | |
| 2702 | 2706 | |
| 2703 | 2707 | template.find('.inline-drawer-toggle').on('click', function () { |
| 2704 | 2708 | if (counter.data('first-run')) { |