Allow expanding contenteditables
| @@ -3085,8 +3085,9 @@ | ||
| 3085 | 3085 | <select id="context_presets" data-preset-manager-for="context" class="flex1 text_pole"></select> |
| 3086 | 3086 | </div> |
| 3087 | 3087 | <div> |
| 3088 | 3088 | <label for="context_story_string" class="flex-container"> |
| 3089 | 3089 | <small data-i18n="Story String">Story String</small> |
| 3090 | + <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="context_story_string" title="Expand the editor" data-i18n="[title]Expand the editor"></i> | |
| 3090 | 3091 | </label> |
| 3091 | 3092 | <div contenteditable="true" id="context_story_string" class="text_pole textarea_compact"></div> |
| 3092 | 3093 | <div class="flex-container"> |
| @@ -3236,8 +3237,9 @@ | ||
| 3236 | 3237 | <input type="text" id="instruct_activation_regex" class="text_pole textarea_compact" placeholder="e.g. /llama(-)?[3|3.1]/i"></input> |
| 3237 | 3238 | </div> |
| 3238 | 3239 | <div> |
| 3239 | - <label> | |
| 3240 | + <label for="instruct_system_prompt" class="flex-container"> | |
| 3240 | 3241 | <small data-i18n="System Prompt">System Prompt</small> |
| 3242 | + <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="instruct_system_prompt" title="Expand the editor" data-i18n="[title]Expand the editor"></i> | |
| 3241 | 3243 | </label> |
| 3242 | 3244 | <div contenteditable="true" id="instruct_system_prompt" class="text_pole textarea_compact"></div> |
| 3243 | 3245 | </div> |
| @@ -1416,6 +1416,7 @@ jQuery(function () { | ||
| 1416 | 1416 | $(document).on('click', '.editor_maximize', function () { |
| 1417 | 1417 | const broId = $(this).attr('data-for'); |
| 1418 | 1418 | const bro = $(`#${broId}`); |
| 1419 | + const contentEditable = bro.is('[contenteditable]'); | |
| 1419 | 1420 | const withTab = $(this).attr('data-tab'); |
| 1420 | 1421 | |
| 1421 | 1422 | if (!bro.length) { |
| @@ -1427,11 +1428,16 @@ jQuery(function () { | ||
| 1427 | 1428 | wrapper.classList.add('height100p', 'wide100p', 'flex-container'); |
| 1428 | 1429 | wrapper.classList.add('flexFlowColumn', 'justifyCenter', 'alignitemscenter'); |
| 1429 | 1430 | const textarea = document.createElement('textarea'); |
| 1430 | 1431 | textarea.value = String(contentEditable ? bro[0].innerText : bro.val()); |
| 1431 | 1432 | textarea.classList.add('height100p', 'wide100p', 'maximized_textarea'); |
| 1432 | 1433 | bro.hasClass('monospace') && textarea.classList.add('monospace'); |
| 1433 | 1434 | textarea.addEventListener('input', function () { |
| 1434 | - bro.val(textarea.value).trigger('input'); | |
| 1435 | + if (contentEditable) { | |
| 1436 | + bro[0].innerText = textarea.value; | |
| 1437 | + bro.trigger('input'); | |
| 1438 | + } else { | |
| 1439 | + bro.val(textarea.value).trigger('input'); | |
| 1440 | + } | |
| 1435 | 1441 | }); |
| 1436 | 1442 | wrapper.appendChild(textarea); |
| 1437 | 1443 | |