add fuzzy and include matching for autocomplete

This commit is contained in:
LenAnderson
2024-03-25 10:44:52 -04:00
parent 488fe15ab6
commit da6372cf86
6 changed files with 106 additions and 6 deletions

View File

@ -237,6 +237,9 @@ let power_user = {
bogus_folders: false,
show_tag_filters: false,
aux_field: 'character_version',
stscript: {
matching: 'fuzzy',
},
restore_user_input: true,
reduced_motion: false,
compact_input_area: true,
@ -1527,6 +1530,7 @@ function loadPowerUserSettings(settings, data) {
$('#chat_width_slider').val(power_user.chat_width);
$('#token_padding').val(power_user.token_padding);
$('#aux_field').val(power_user.aux_field);
$('#stscript_matching').val(power_user.stscript.matching);
$('#restore_user_input').prop('checked', power_user.restore_user_input);
$('#chat_truncation').val(power_user.chat_truncation);
@ -3372,6 +3376,12 @@ $(document).ready(() => {
printCharacters(false);
});
$('#stscript_matching').on('change', function () {
const value = $(this).find(':selected').val();
power_user.stscript.matching = String(value);
saveSettingsDebounced();
});
$('#restore_user_input').on('input', function () {
power_user.restore_user_input = !!$(this).prop('checked');
saveSettingsDebounced();