buttonify instruct header toggles, style instruct columns when disabled
| @@ -3196,7 +3196,7 @@ | ||
| 3196 | 3196 | |
| 3197 | 3197 | </div> |
| 3198 | 3198 | <div id="InstructSettingsColumn" class="flex-container flexNoGap flexFlowColumn flex1"> |
| 3199 | 3199 | <div nameid="instructSettingsBlock"> |
| 3200 | 3200 | <h4 class="standoutHeader title_restorable justifySpaceBetween"> |
| 3201 | 3201 | <div class="flex-container"> |
| 3202 | 3202 | <span data-i18n="Instruct Mode">Instruct Mode</span> |
| @@ -3206,12 +3206,12 @@ | ||
| 3206 | 3206 | </div> |
| 3207 | 3207 | <div class="flex-container"> |
| 3208 | 3208 | <label for="instruct_enabled" class="checkbox_label flex1"> |
| 3209 | 3209 | <input id="instruct_enabled" type="checkbox" style="display:none;" /> |
| 3210 | 3210 | <small data-i18n="Enabled"><i class="fa-solid fa-power-off menu_button margin0"></i></small> |
| 3211 | 3211 | </label> |
| 3212 | 3212 | <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"> |
| 3213 | 3213 | <input id="instruct_bind_to_context" type="checkbox" style="display:none;" /> |
| 3214 | 3214 | <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> |
| 3215 | 3215 | </label> |
| 3216 | 3216 | </div> |
| 3217 | 3217 | </h4> |
| @@ -3266,6 +3266,7 @@ | ||
| 3266 | 3266 | <small data-i18n="Force for Groups and Personas">Force for Groups and Personas</small> |
| 3267 | 3267 | </label> |
| 3268 | 3268 | </div> |
| 3269 | + </div> | |
| 3269 | 3270 | <hr> |
| 3270 | 3271 | <div name="tokenizerSettingsBlock"> |
| 3271 | 3272 | <div data-newbie-hidden name="tokenizerSelectorBlock"> |
| @@ -3300,7 +3301,8 @@ | ||
| 3300 | 3301 | <input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" /> |
| 3301 | 3302 | </div> |
| 3302 | 3303 | </div> |
| 3303 | - | |
| 3304 | + <div> | |
| 3305 | + <h4 class="standoutHeader">Misc.</h4> | |
| 3304 | 3306 | <div> |
| 3305 | 3307 | <small> |
| 3306 | 3308 | <span data-i18n="Non-markdown strings"> |
| @@ -87,8 +87,16 @@ export async function loadInstructMode(data) { | ||
| 87 | 87 | |
| 88 | 88 | if (power_user.instruct.enabled) { |
| 89 | 89 | $('#instruct_enabled').parent().find('i').addClass('toggleEnabled'); |
| 90 | + $('#instructSettingsBlock, #InstructSequencesColumn').removeClass('disabled'); | |
| 90 | 91 | } else { |
| 91 | 92 | $('#instruct_enabled').parent().find('i').removeClass('toggleEnabled'); |
| 93 | + $('#instructSettingsBlock, #InstructSequencesColumn').addClass('disabled'); | |
| 94 | + } | |
| 95 | + | |
| 96 | + if (power_user.instruct.bind_to_context) { | |
| 97 | + $('#instruct_bind_to_context').parent().find('i').addClass('toggleEnabled'); | |
| 98 | + } else { | |
| 99 | + $('#instruct_bind_to_context').parent().find('i').removeClass('toggleEnabled'); | |
| 92 | 100 | } |
| 93 | 101 | |
| 94 | 102 | controls.forEach(control => { |
| @@ -639,8 +647,12 @@ jQuery(() => { | ||
| 639 | 647 | //color toggle for the main switch |
| 640 | 648 | if (power_user.instruct.enabled) { |
| 641 | 649 | $('#instruct_enabled').parent().find('i').addClass('toggleEnabled'); |
| 650 | + $('#instructSettingsBlock, #InstructSequencesColumn') | |
| 651 | + .removeClass('disabled'); | |
| 642 | 652 | } else { |
| 643 | 653 | $('#instruct_enabled').parent().find('i').removeClass('toggleEnabled'); |
| 654 | + $('#instructSettingsBlock, #InstructSequencesColumn') | |
| 655 | + .addClass('disabled'); | |
| 644 | 656 | } |
| 645 | 657 | |
| 646 | 658 | if (!power_user.instruct.bind_to_context) { |
| @@ -656,6 +668,14 @@ jQuery(() => { | ||
| 656 | 668 | } |
| 657 | 669 | }); |
| 658 | 670 | |
| 671 | + $('#instruct_bind_to_context').on('change', function () { | |
| 672 | + if (power_user.instruct.bind_to_context) { | |
| 673 | + $('#instruct_bind_to_context').parent().find('i').addClass('toggleEnabled'); | |
| 674 | + } else { | |
| 675 | + $('#instruct_bind_to_context').parent().find('i').removeClass('toggleEnabled'); | |
| 676 | + } | |
| 677 | + }); | |
| 678 | + | |
| 659 | 679 | $('#instruct_presets').on('change', function () { |
| 660 | 680 | const name = String($(this).find(':selected').val()); |
| 661 | 681 | const preset = instruct_presets.find(x => x.name === name); |