Hide radio controls in drawers

This commit is contained in:
Cohee 2024-03-24 21:25:27 +02:00
parent e25c419491
commit e153861043
2 changed files with 59 additions and 40 deletions

View File

@ -130,7 +130,7 @@
<span name="samplerHelpButton" class="note-link-span topRightInset fa-solid fa-circle-question"></span> <span name="samplerHelpButton" class="note-link-span topRightInset fa-solid fa-circle-question"></span>
</a> </a>
<div class="scrollableInner"> <div class="scrollableInner">
<div class="flex-container" id="ai_response_configuration"> <div class="flex-container flexNoGap" id="ai_response_configuration">
<div id="respective-presets-block" class="width100p"> <div id="respective-presets-block" class="width100p">
<div id="kobold_api-presets"> <div id="kobold_api-presets">
<h4 class="margin0"><span data-i18n="kobldpresets">Kobold Presets</span> <h4 class="margin0"><span data-i18n="kobldpresets">Kobold Presets</span>
@ -1623,10 +1623,16 @@
</div><!-- end of textgen settings--> </div><!-- end of textgen settings-->
<div id="openai_settings"> <div id="openai_settings">
<div class=""> <div class="">
<div class="range-block marginBot10"> <div class="inline-drawer wide100p flexFlowColumn">
<h4 class="range-block-title justifyLeft marginBot5" <div class="inline-drawer-toggle inline-drawer-header">
<span data-i18n="Character Names Behavior">Character Names Behavior</span> <div class="flex-container alignItemsCenter flexNoGap">
</h4> <b data-i18n="Character Names Behavior">Character Names Behavior</b>
<span title="Helps the model to associate messages with characters." class="note-link-span fa-solid fa-circle-question"></span>
<small class="flexBasis100p">(<span id="character_names_display"></span>)</small>
</div>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
</div>
<div class="inline-drawer-content">
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none"> <label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none">
<input type="radio" id="character_names_none" name="character_names" value="0"> <input type="radio" id="character_names_none" name="character_names" value="0">
<span data-i18n="None">None</span> <span data-i18n="None">None</span>
@ -1650,18 +1656,20 @@
Prepend character names to message contents. Prepend character names to message contents.
</small> </small>
</label> </label>
<div class="toggle-description justifyLeft marginTop5">
<span data-i18n="Helps the model to associate messages with characters.">Helps the model to associate messages with characters.</span>
</div>
<!-- Hidden input for loading radio buttons from presets. Don't remove! --> <!-- Hidden input for loading radio buttons from presets. Don't remove! -->
<input type="hidden" id="names_behavior" class="displayNone" /> <input type="hidden" id="names_behavior" class="displayNone" />
</div> </div>
<div class="range-block marginBot10"> </div>
<h4 class="range-block-title justifyLeft marginBot5 flex-container alignItemsCenter"> <div class="inline-drawer wide100p flexFlowColumn marginBot10">
<span data-i18n="Continue Postfix">Continue Postfix</span> <div class="inline-drawer-toggle inline-drawer-header">
<i class="right_menu_button fa-solid fa-circle-exclamation" title="The next chunk of the continued message will be appended using this as a separator."></i> <div class="flex-container alignItemsCenter flexNoGap">
</h4> <b data-i18n="Continue Postfix">Continue Postfix</b>
<div class="flex-container flexFlowColumn"> <span title="The next chunk of the continued message will be appended using this as a separator." class="note-link-span fa-solid fa-circle-question"></span>
<small class="flexBasis100p">(<span id="continue_postfix_display"></span>)</small>
</div>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
</div>
<div class="inline-drawer-content">
<label class="checkbox_label flexWrap alignItemsCenter" for="continue_postfix_space"> <label class="checkbox_label flexWrap alignItemsCenter" for="continue_postfix_space">
<input type="radio" id="continue_postfix_space" name="continue_postfix" value="0"> <input type="radio" id="continue_postfix_space" name="continue_postfix" value="0">
<span data-i18n="Space">Space</span> <span data-i18n="Space">Space</span>
@ -1674,10 +1682,10 @@
<input type="radio" id="continue_postfix_double_newline" name="continue_postfix" value="2"> <input type="radio" id="continue_postfix_double_newline" name="continue_postfix" value="2">
<span data-i18n="Double Newline">Double Newline</span> <span data-i18n="Double Newline">Double Newline</span>
</label> </label>
</div>
<!-- Hidden input for loading radio buttons from presets. Don't remove! --> <!-- Hidden input for loading radio buttons from presets. Don't remove! -->
<input type="hidden" id="continue_postfix" class="displayNone" /> <input type="hidden" id="continue_postfix" class="displayNone" />
</div> </div>
</div>
<div class="range-block"> <div class="range-block">
<label for="wrap_in_quotes" title="Wrap user messages in quotes before sending" data-i18n="[title]Wrap user messages in quotes before sending" class="checkbox_label widthFreeExpand"> <label for="wrap_in_quotes" title="Wrap user messages in quotes before sending" data-i18n="[title]Wrap user messages in quotes before sending" class="checkbox_label widthFreeExpand">
<input id="wrap_in_quotes" type="checkbox" /><span data-i18n="Wrap in Quotes"> <input id="wrap_in_quotes" type="checkbox" /><span data-i18n="Wrap in Quotes">

View File

@ -2750,6 +2750,9 @@ function setNamesBehaviorControls() {
$('#character_names_content').prop('checked', true); $('#character_names_content').prop('checked', true);
break; break;
} }
const checkedItemText = $('input[name="character_names"]:checked ~ span').text().trim();
$('#character_names_display').text(checkedItemText);
} }
function setContinuePostfixControls() { function setContinuePostfixControls() {
@ -2771,6 +2774,8 @@ function setContinuePostfixControls() {
} }
$('#continue_postfix').val(oai_settings.continue_postfix); $('#continue_postfix').val(oai_settings.continue_postfix);
const checkedItemText = $('input[name="continue_postfix"]:checked ~ span').text().trim();
$('#continue_postfix_display').text(checkedItemText);
} }
async function getStatusOpen() { async function getStatusOpen() {
@ -4414,16 +4419,19 @@ $(document).ready(async function () {
$('#character_names_none').on('input', function () { $('#character_names_none').on('input', function () {
oai_settings.names_behavior = character_names_behavior.NONE; oai_settings.names_behavior = character_names_behavior.NONE;
setNamesBehaviorControls();
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$('#character_names_completion').on('input', function () { $('#character_names_completion').on('input', function () {
oai_settings.names_behavior = character_names_behavior.COMPLETION; oai_settings.names_behavior = character_names_behavior.COMPLETION;
setNamesBehaviorControls();
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$('#character_names_content').on('input', function () { $('#character_names_content').on('input', function () {
oai_settings.names_behavior = character_names_behavior.CONTENT; oai_settings.names_behavior = character_names_behavior.CONTENT;
setNamesBehaviorControls();
saveSettingsDebounced(); saveSettingsDebounced();
}); });
@ -4435,16 +4443,19 @@ $(document).ready(async function () {
$('#continue_postfix_space').on('input', function () { $('#continue_postfix_space').on('input', function () {
oai_settings.continue_postfix = continue_postfix_types.SPACE; oai_settings.continue_postfix = continue_postfix_types.SPACE;
setContinuePostfixControls();
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$('#continue_postfix_newline').on('input', function () { $('#continue_postfix_newline').on('input', function () {
oai_settings.continue_postfix = continue_postfix_types.NEWLINE; oai_settings.continue_postfix = continue_postfix_types.NEWLINE;
setContinuePostfixControls();
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$('#continue_postfix_double_newline').on('input', function () { $('#continue_postfix_double_newline').on('input', function () {
oai_settings.continue_postfix = continue_postfix_types.DOUBLE_NEWLINE; oai_settings.continue_postfix = continue_postfix_types.DOUBLE_NEWLINE;
setContinuePostfixControls();
saveSettingsDebounced(); saveSettingsDebounced();
}); });