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>
</a>
<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="kobold_api-presets">
<h4 class="margin0"><span data-i18n="kobldpresets">Kobold Presets</span>
@ -1623,45 +1623,53 @@
</div><!-- end of textgen settings-->
<div id="openai_settings">
<div class="">
<div class="range-block marginBot10">
<h4 class="range-block-title justifyLeft marginBot5"
<span data-i18n="Character Names Behavior">Character Names Behavior</span>
</h4>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_none">
<input type="radio" id="character_names_none" name="character_names" value="0">
<span data-i18n="None">None</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Except for groups and past personas. Otherwise, make sure you provide names in the prompt."></i>
<small class="flexBasis100p" data-i18n="Don't add character names.">
Don't add character names.
</small>
</label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion">
<input type="radio" id="character_names_completion" name="character_names" value="1">
<span data-i18n="Completion">Completion Object</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Restrictions apply: only Latin alphanumerics and underscores. Doesn't work for all sources, notably: Claude, MistralAI, Google."></i>
<small class="flexBasis100p" data-i18n="Add character names to completion objects.">
Add character names to completion objects.
</small>
</label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content">
<input type="radio" id="character_names_content" name="character_names" value="2">
<span data-i18n="Message Content">Message Content</span>
<small class="flexBasis100p" data-i18n="Prepend character names to message contents.">
Prepend character names to message contents.
</small>
</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 class="inline-drawer wide100p flexFlowColumn">
<div class="inline-drawer-toggle inline-drawer-header">
<div class="flex-container alignItemsCenter flexNoGap">
<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">
<input type="radio" id="character_names_none" name="character_names" value="0">
<span data-i18n="None">None</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Except for groups and past personas. Otherwise, make sure you provide names in the prompt."></i>
<small class="flexBasis100p" data-i18n="Don't add character names.">
Don't add character names.
</small>
</label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_completion">
<input type="radio" id="character_names_completion" name="character_names" value="1">
<span data-i18n="Completion">Completion Object</span>
<i class="right_menu_button fa-solid fa-circle-exclamation" title="Restrictions apply: only Latin alphanumerics and underscores. Doesn't work for all sources, notably: Claude, MistralAI, Google."></i>
<small class="flexBasis100p" data-i18n="Add character names to completion objects.">
Add character names to completion objects.
</small>
</label>
<label class="checkbox_label flexWrap alignItemsCenter" for="character_names_content">
<input type="radio" id="character_names_content" name="character_names" value="2">
<span data-i18n="Message Content">Message Content</span>
<small class="flexBasis100p" data-i18n="Prepend character names to message contents.">
Prepend character names to message contents.
</small>
</label>
<!-- Hidden input for loading radio buttons from presets. Don't remove! -->
<input type="hidden" id="names_behavior" class="displayNone" />
</div>
<!-- Hidden input for loading radio buttons from presets. Don't remove! -->
<input type="hidden" id="names_behavior" class="displayNone" />
</div>
<div class="range-block marginBot10">
<h4 class="range-block-title justifyLeft marginBot5 flex-container alignItemsCenter">
<span data-i18n="Continue Postfix">Continue Postfix</span>
<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>
</h4>
<div class="flex-container flexFlowColumn">
<div class="inline-drawer wide100p flexFlowColumn marginBot10">
<div class="inline-drawer-toggle inline-drawer-header">
<div class="flex-container alignItemsCenter flexNoGap">
<b data-i18n="Continue Postfix">Continue Postfix</b>
<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">
<input type="radio" id="continue_postfix_space" name="continue_postfix" value="0">
<span data-i18n="Space">Space</span>
@ -1674,9 +1682,9 @@
<input type="radio" id="continue_postfix_double_newline" name="continue_postfix" value="2">
<span data-i18n="Double Newline">Double Newline</span>
</label>
<!-- Hidden input for loading radio buttons from presets. Don't remove! -->
<input type="hidden" id="continue_postfix" class="displayNone" />
</div>
<!-- Hidden input for loading radio buttons from presets. Don't remove! -->
<input type="hidden" id="continue_postfix" class="displayNone" />
</div>
<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">

View File

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