Add checkbox for restoring user input on page refresh

This commit is contained in:
Cohee
2023-11-28 00:29:34 +02:00
parent d263760b25
commit 87707b565f
3 changed files with 31 additions and 1 deletions

View File

@ -223,6 +223,7 @@ let power_user = {
servers: [],
bogus_folders: false,
aux_field: 'character_version',
restore_user_input: true,
};
let themes = [];
@ -1380,6 +1381,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);
$("#restore_user_input").prop("checked", power_user.restore_user_input);
$("#chat_truncation").val(power_user.chat_truncation);
$('#chat_truncation_counter').val(power_user.chat_truncation);
@ -3054,6 +3056,11 @@ $(document).ready(() => {
printCharacters(false);
});
$('#restore_user_input').on('input', function () {
power_user.restore_user_input = !!$(this).prop('checked');
saveSettingsDebounced();
});
$(document).on('click', '#debug_table [data-debug-function]', function () {
const functionId = $(this).data('debug-function');
const functionRecord = debug_functions.find(f => f.functionId === functionId);