Merge pull request #3765 from SillyTavern/feat/wi-content-expando

Add expand editor for WI content
This commit is contained in:
Cohee
2025-03-27 20:57:57 +02:00
committed by GitHub
2 changed files with 10 additions and 3 deletions

View File

@ -2680,8 +2680,10 @@ export async function getWorldEntry(name, data, entry) {
$(counter).text(numberOfTokens);
}, debounce_timeout.relaxed);
const contentInputId = `world_entry_content_${entry.uid}`;
const contentInput = template.find('textarea[name="content"]');
contentInput.data('uid', entry.uid);
contentInput.attr('id', contentInputId);
contentInput.on('input', async function (_, { skipCount } = {}) {
const uid = $(this).data('uid');
const value = $(this).val();
@ -2698,7 +2700,9 @@ export async function getWorldEntry(name, data, entry) {
countTokensDebounced(counter, value);
});
contentInput.val(entry.content).trigger('input', { skipCount: true });
//initScrollHeight(contentInput);
const contentExpandButton = template.find('.editor_maximize');
contentExpandButton.attr('data-for', contentInputId);
template.find('.inline-drawer-toggle').on('click', function () {
if (counter.data('first-run')) {