mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-23 23:47:43 +01:00
Improved Advanced Formatting UI
This commit is contained in:
parent
be3ebcda0d
commit
ca37ac679e
@ -2097,14 +2097,14 @@
|
|||||||
<label for="context_story_string">
|
<label for="context_story_string">
|
||||||
<small data-i18n="Story String">Story String</small>
|
<small data-i18n="Story String">Story String</small>
|
||||||
</label>
|
</label>
|
||||||
<textarea id="context_story_string" class="text_pole textarea_compact" rows="3"></textarea>
|
<textarea id="context_story_string" class="text_pole textarea_compact autoSetHeight" rows="1"></textarea>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
<label for="context_example_separator">
|
<label for="context_example_separator">
|
||||||
<small data-i18n="Example Separator">Example Separator</small>
|
<small data-i18n="Example Separator">Example Separator</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="context_example_separator" class="text_pole textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="context_example_separator" class="text_pole textarea_compact autoSetHeight" maxlength="500" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
@ -2112,7 +2112,7 @@
|
|||||||
<small data-i18n="Chat Start">Chat Start</small>
|
<small data-i18n="Chat Start">Chat Start</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="context_chat_start" class="text_pole textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="context_chat_start" class="text_pole textarea_compact autoSetHeight" maxlength="500" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2150,7 +2150,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_activation_regex" class="text_pole textarea_compact" maxlength="5000" rows="1"></textarea>
|
<textarea id="instruct_activation_regex" class="text_pole textarea_compact autoSetHeight" maxlength="5000" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="instruct_wrap" class="checkbox_label">
|
<label for="instruct_wrap" class="checkbox_label">
|
||||||
@ -2175,14 +2175,21 @@
|
|||||||
<div class="prompt_overridden">
|
<div class="prompt_overridden">
|
||||||
Overridden by the Character Definitions.
|
Overridden by the Character Definitions.
|
||||||
</div>
|
</div>
|
||||||
<textarea id="instruct_system_prompt" class="text_pole textarea_compact" rows="4"></textarea>
|
<textarea id="instruct_system_prompt" class="text_pole textarea_compact autoSetHeight" rows="1"></textarea>
|
||||||
|
|
||||||
|
<div class="inline-drawer wide100p flexFlowColumn">
|
||||||
|
<div class="inline-drawer-toggle inline-drawer-header">
|
||||||
|
<b><span data-i18n="Instruct Mode Sequences">Instruct Mode Sequences</span></b>
|
||||||
|
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
|
||||||
|
</div>
|
||||||
|
<div class="inline-drawer-content">
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
<label for="instruct_input_sequence">
|
<label for="instruct_input_sequence">
|
||||||
<small data-i18n="Input Sequence">Input Sequence</small>
|
<small data-i18n="Input Sequence">Input Sequence</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_input_sequence" class="text_pole textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_input_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
@ -2190,7 +2197,7 @@
|
|||||||
<small data-i18n="Output Sequence">Output Sequence</small>
|
<small data-i18n="Output Sequence">Output Sequence</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_output_sequence" class="text_pole wide100p textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_output_sequence" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2200,7 +2207,7 @@
|
|||||||
<small data-i18n="First Output Sequence">First Output Sequence</small>
|
<small data-i18n="First Output Sequence">First Output Sequence</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_first_output_sequence" class="text_pole textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_first_output_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
@ -2208,7 +2215,7 @@
|
|||||||
<small data-i18n="Last Output Sequence">Last Output Sequence</small>
|
<small data-i18n="Last Output Sequence">Last Output Sequence</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_last_output_sequence" class="text_pole wide100p textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_last_output_sequence" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2218,7 +2225,7 @@
|
|||||||
<small data-i18n="System Sequence Prefix">System Sequence Prefix</small>
|
<small data-i18n="System Sequence Prefix">System Sequence Prefix</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_system_sequence" class="text_pole textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_system_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
@ -2226,7 +2233,7 @@
|
|||||||
<small data-i18n="System Sequence Suffix">System Sequence Suffix</small>
|
<small data-i18n="System Sequence Suffix">System Sequence Suffix</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_system_sequence_suffix" class="text_pole wide100p textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_system_sequence_suffix" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2236,7 +2243,7 @@
|
|||||||
<small data-i18n="Stop Sequence">Stop Sequence</small>
|
<small data-i18n="Stop Sequence">Stop Sequence</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_stop_sequence" class="text_pole textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_stop_sequence" class="text_pole textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
@ -2244,12 +2251,15 @@
|
|||||||
<small data-i18n="Separator">Separator</small>
|
<small data-i18n="Separator">Separator</small>
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<textarea id="instruct_separator_sequence" class="text_pole wide100p textarea_compact" maxlength="500" rows="1"></textarea>
|
<textarea id="instruct_separator_sequence" class="text_pole wide100p textarea_compact autoSetHeight" maxlength="500" placeholder="—" rows="1"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div name="ContextFormatting" class="flex1">
|
<div name="ContextFormatting" class="flex1">
|
||||||
<div>
|
<div>
|
||||||
<h4><span data-i18n="Tokenizer">Tokenizer</span>
|
<h4><span data-i18n="Tokenizer">Tokenizer</span>
|
||||||
|
@ -131,6 +131,7 @@ import {
|
|||||||
isDigitsOnly,
|
isDigitsOnly,
|
||||||
PAGINATION_TEMPLATE,
|
PAGINATION_TEMPLATE,
|
||||||
waitUntilCondition,
|
waitUntilCondition,
|
||||||
|
resetScrollHeight,
|
||||||
} from "./scripts/utils.js";
|
} from "./scripts/utils.js";
|
||||||
|
|
||||||
import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
|
import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
|
||||||
@ -8623,6 +8624,10 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the height of "autoSetHeight" textareas within the drawer to their scroll height
|
||||||
|
$(this).closest('.drawer').find('.drawer-content textarea.autoSetHeight').each(function() {
|
||||||
|
resetScrollHeight($(this));
|
||||||
|
});
|
||||||
|
|
||||||
} else if (drawerWasOpenAlready) { //to close manually
|
} else if (drawerWasOpenAlready) { //to close manually
|
||||||
icon.toggleClass('closedIcon openIcon');
|
icon.toggleClass('closedIcon openIcon');
|
||||||
@ -8689,6 +8694,11 @@ $(document).ready(function () {
|
|||||||
icon.toggleClass('down up');
|
icon.toggleClass('down up');
|
||||||
icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up');
|
icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up');
|
||||||
$(this).closest('.inline-drawer').find('.inline-drawer-content').stop().slideToggle();
|
$(this).closest('.inline-drawer').find('.inline-drawer-content').stop().slideToggle();
|
||||||
|
|
||||||
|
// Set the height of "autoSetHeight" textareas within the inline-drawer to their scroll height
|
||||||
|
$(this).closest('.inline-drawer').find('.inline-drawer-content textarea.autoSetHeight').each(function() {
|
||||||
|
resetScrollHeight($(this));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.mes .avatar', function () {
|
$(document).on('click', '.mes .avatar', function () {
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
power_user,
|
power_user,
|
||||||
context_presets,
|
context_presets,
|
||||||
} from "./power-user.js";
|
} from "./power-user.js";
|
||||||
|
import { resetScrollHeight } from "./utils.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {any[]} Instruct mode presets.
|
* @type {any[]} Instruct mode presets.
|
||||||
@ -55,6 +56,9 @@ export function loadInstructMode(data) {
|
|||||||
$element.on('input', function () {
|
$element.on('input', function () {
|
||||||
power_user.instruct[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
|
power_user.instruct[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
|
if (!control.isCheckbox) {
|
||||||
|
resetScrollHeight($element);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import {
|
|||||||
import { registerSlashCommand } from "./slash-commands.js";
|
import { registerSlashCommand } from "./slash-commands.js";
|
||||||
import { tokenizers } from "./tokenizers.js";
|
import { tokenizers } from "./tokenizers.js";
|
||||||
|
|
||||||
import { delay } from "./utils.js";
|
import { delay, resetScrollHeight } from "./utils.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
loadPowerUserSettings,
|
loadPowerUserSettings,
|
||||||
@ -906,6 +906,9 @@ function loadContextSettings() {
|
|||||||
$element.on('input', function () {
|
$element.on('input', function () {
|
||||||
power_user.context[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
|
power_user.context[control.property] = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
|
if (!control.isCheckbox) {
|
||||||
|
resetScrollHeight($element);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user