Configurable chat truncation amount

This commit is contained in:
Cohee
2023-11-19 21:57:54 +02:00
parent a02446c4cc
commit ac07c8324d
4 changed files with 33 additions and 7 deletions

View File

@ -107,6 +107,7 @@ let power_user = {
target_length: 400,
},
markdown_escape_strings: '',
chat_truncation: 100,
ui_mode: ui_mode.POWER,
fast_ui_mode: true,
@ -1373,6 +1374,9 @@ function loadPowerUserSettings(settings, data) {
$("#token_padding").val(power_user.token_padding);
$("#aux_field").val(power_user.aux_field);
$("#chat_truncation").val(power_user.chat_truncation);
$('#chat_truncation_counter').val(power_user.chat_truncation);
$("#font_scale").val(power_user.font_scale);
$("#font_scale_counter").val(power_user.font_scale);
@ -2559,6 +2563,12 @@ $(document).ready(() => {
setHotswapsDebounced();
});
$('#chat_truncation').on('input', function () {
power_user.chat_truncation = Number($('#chat_truncation').val());
$('#chat_truncation_counter').val(power_user.chat_truncation);
saveSettingsDebounced();
});
$(`input[name="font_scale"]`).on('input', async function (e) {
power_user.font_scale = Number(e.target.value);
$("#font_scale_counter").val(power_user.font_scale);