Add option to forbid external images

This commit is contained in:
Cohee
2024-01-24 15:47:54 +02:00
parent 625a07ac1f
commit 4823bcf4ff
3 changed files with 31 additions and 0 deletions

View File

@ -237,6 +237,7 @@ let power_user = {
compact_input_area: true,
auto_connect: false,
auto_load_chat: false,
forbid_external_images: false,
};
let themes = [];
@ -1529,6 +1530,7 @@ function loadPowerUserSettings(settings, data) {
$('#reduced_motion').prop('checked', power_user.reduced_motion);
$('#auto-connect-checkbox').prop('checked', power_user.auto_connect);
$('#auto-load-chat-checkbox').prop('checked', power_user.auto_load_chat);
$('#forbid_external_images').prop('checked', power_user.forbid_external_images);
for (const theme of themes) {
const option = document.createElement('option');
@ -3234,6 +3236,12 @@ $(document).ready(() => {
saveSettingsDebounced();
});
$('#forbid_external_images').on('input', function () {
power_user.forbid_external_images = !!$(this).prop('checked');
saveSettingsDebounced();
reloadCurrentChat();
});
$(document).on('click', '#debug_table [data-debug-function]', function () {
const functionId = $(this).data('debug-function');
const functionRecord = debug_functions.find(f => f.functionId === functionId);