mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
buttonify instruct header toggles, style instruct columns when disabled
This commit is contained in:
@ -3196,7 +3196,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="InstructSettingsColumn" class="flex-container flexNoGap flexFlowColumn flex1">
|
<div id="InstructSettingsColumn" class="flex-container flexNoGap flexFlowColumn flex1">
|
||||||
<div name="instructSettingsBlock">
|
<div id="instructSettingsBlock">
|
||||||
<h4 class="standoutHeader title_restorable justifySpaceBetween">
|
<h4 class="standoutHeader title_restorable justifySpaceBetween">
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<span data-i18n="Instruct Mode">Instruct Mode</span>
|
<span data-i18n="Instruct Mode">Instruct Mode</span>
|
||||||
@ -3206,12 +3206,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<label for="instruct_enabled" class="checkbox_label flex1">
|
<label for="instruct_enabled" class="checkbox_label flex1">
|
||||||
<input id="instruct_enabled" type="checkbox" />
|
<input id="instruct_enabled" type="checkbox" style="display:none;" />
|
||||||
<small data-i18n="Enabled"><i class="fa-solid fa-power-off"></i></small>
|
<small data-i18n="Enabled"><i class="fa-solid fa-power-off menu_button margin0"></i></small>
|
||||||
</label>
|
</label>
|
||||||
<label for="instruct_bind_to_context" class="checkbox_label flex1" title="If enabled, Context templates will be automatically selected based on selected Instruct template name or by preference." data-i18n="[title]instruct_bind_to_context">
|
<label for="instruct_bind_to_context" class="checkbox_label flex1" title="If enabled, Context templates will be automatically selected based on selected Instruct template name or by preference." data-i18n="[title]instruct_bind_to_context">
|
||||||
<input id="instruct_bind_to_context" type="checkbox" />
|
<input id="instruct_bind_to_context" type="checkbox" style="display:none;" />
|
||||||
<small data-i18n="Bind to Context"><i class="fa-solid fa-link"></i></small>
|
<small data-i18n="Bind to Context"><i class="fa-solid fa-link menu_button margin0" title="If enabled, Context templates will be automatically selected based on selected Instruct template name or by preference."></i></small>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</h4>
|
</h4>
|
||||||
@ -3266,6 +3266,7 @@
|
|||||||
<small data-i18n="Force for Groups and Personas">Force for Groups and Personas</small>
|
<small data-i18n="Force for Groups and Personas">Force for Groups and Personas</small>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div name="tokenizerSettingsBlock">
|
<div name="tokenizerSettingsBlock">
|
||||||
<div data-newbie-hidden name="tokenizerSelectorBlock">
|
<div data-newbie-hidden name="tokenizerSelectorBlock">
|
||||||
@ -3300,7 +3301,8 @@
|
|||||||
<input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" />
|
<input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<h4 class="standoutHeader">Misc.</h4>
|
||||||
<div>
|
<div>
|
||||||
<small>
|
<small>
|
||||||
<span data-i18n="Non-markdown strings">
|
<span data-i18n="Non-markdown strings">
|
||||||
|
@ -87,8 +87,16 @@ export async function loadInstructMode(data) {
|
|||||||
|
|
||||||
if (power_user.instruct.enabled) {
|
if (power_user.instruct.enabled) {
|
||||||
$('#instruct_enabled').parent().find('i').addClass('toggleEnabled');
|
$('#instruct_enabled').parent().find('i').addClass('toggleEnabled');
|
||||||
|
$('#instructSettingsBlock, #InstructSequencesColumn').removeClass('disabled');
|
||||||
} else {
|
} else {
|
||||||
$('#instruct_enabled').parent().find('i').removeClass('toggleEnabled');
|
$('#instruct_enabled').parent().find('i').removeClass('toggleEnabled');
|
||||||
|
$('#instructSettingsBlock, #InstructSequencesColumn').addClass('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (power_user.instruct.bind_to_context) {
|
||||||
|
$('#instruct_bind_to_context').parent().find('i').addClass('toggleEnabled');
|
||||||
|
} else {
|
||||||
|
$('#instruct_bind_to_context').parent().find('i').removeClass('toggleEnabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.forEach(control => {
|
controls.forEach(control => {
|
||||||
@ -639,8 +647,12 @@ jQuery(() => {
|
|||||||
//color toggle for the main switch
|
//color toggle for the main switch
|
||||||
if (power_user.instruct.enabled) {
|
if (power_user.instruct.enabled) {
|
||||||
$('#instruct_enabled').parent().find('i').addClass('toggleEnabled');
|
$('#instruct_enabled').parent().find('i').addClass('toggleEnabled');
|
||||||
|
$('#instructSettingsBlock, #InstructSequencesColumn')
|
||||||
|
.removeClass('disabled');
|
||||||
} else {
|
} else {
|
||||||
$('#instruct_enabled').parent().find('i').removeClass('toggleEnabled');
|
$('#instruct_enabled').parent().find('i').removeClass('toggleEnabled');
|
||||||
|
$('#instructSettingsBlock, #InstructSequencesColumn')
|
||||||
|
.addClass('disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!power_user.instruct.bind_to_context) {
|
if (!power_user.instruct.bind_to_context) {
|
||||||
@ -656,6 +668,14 @@ jQuery(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#instruct_bind_to_context').on('change', function () {
|
||||||
|
if (power_user.instruct.bind_to_context) {
|
||||||
|
$('#instruct_bind_to_context').parent().find('i').addClass('toggleEnabled');
|
||||||
|
} else {
|
||||||
|
$('#instruct_bind_to_context').parent().find('i').removeClass('toggleEnabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#instruct_presets').on('change', function () {
|
$('#instruct_presets').on('change', function () {
|
||||||
const name = String($(this).find(':selected').val());
|
const name = String($(this).find(':selected').val());
|
||||||
const preset = instruct_presets.find(x => x.name === name);
|
const preset = instruct_presets.find(x => x.name === name);
|
||||||
|
Reference in New Issue
Block a user