Remove the rest of local storage settings
| @@ -301,20 +301,6 @@ let movingUIPresets = []; | |||
| 301 | export let context_presets = []; | 301 | export let context_presets = []; |
| 302 | 302 | ||
| 303 | const storage_keys = { | 303 | const storage_keys = { |
| 304 | main_text_color: 'TavernAI_main_text_color', | ||
| 305 | italics_text_color: 'TavernAI_italics_text_color', | ||
| 306 | underline_text_color: 'TavernAI_underline_text_color', | ||
| 307 | quote_text_color: 'TavernAI_quote_text_color', | ||
| 308 | blur_tint_color: 'TavernAI_blur_tint_color', | ||
| 309 | chat_tint_color: 'TavernAI_chat_tint_color', | ||
| 310 | user_mes_blur_tint_color: 'TavernAI_user_mes_blur_tint_color', | ||
| 311 | bot_mes_blur_tint_color: 'TavernAI_bot_mes_blur_tint_color', | ||
| 312 | shadow_color: 'TavernAI_shadow_color', | ||
| 313 | shadow_width: 'TavernAI_shadow_width', | ||
| 314 | border_color: 'TavernAI_border_color', | ||
| 315 | |||
| 316 | custom_css: 'TavernAI_custom_css', | ||
| 317 | |||
| 318 | auto_connect_legacy: 'AutoConnectEnabled', | 304 | auto_connect_legacy: 'AutoConnectEnabled', |
| 319 | auto_load_chat_legacy: 'AutoLoadChatEnabled', | 305 | auto_load_chat_legacy: 'AutoLoadChatEnabled', |
| 320 | 306 | ||
| @@ -1093,8 +1079,6 @@ async function applyThemeColor(type) { | |||
| 1093 | } | 1079 | } |
| 1094 | 1080 | ||
| 1095 | async function applyCustomCSS() { | 1081 | async function applyCustomCSS() { |
| 1096 | power_user.custom_css = String(localStorage.getItem(storage_keys.custom_css) ?? ''); | ||
| 1097 | |||
| 1098 | $('#customCSS').val(power_user.custom_css); | 1082 | $('#customCSS').val(power_user.custom_css); |
| 1099 | var styleId = 'custom-style'; | 1083 | var styleId = 'custom-style'; |
| 1100 | var style = document.getElementById(styleId); | 1084 | var style = document.getElementById(styleId); |
| @@ -1108,14 +1092,13 @@ async function applyCustomCSS() { | |||
| 1108 | } | 1092 | } |
| 1109 | 1093 | ||
| 1110 | async function applyBlurStrength() { | 1094 | async function applyBlurStrength() { |
| 1111 | document.documentElement.style.setProperty('--blurStrength', power_user.blur_strength); | 1095 | document.documentElement.style.setProperty('--blurStrength', String(power_user.blur_strength)); |
| 1112 | $('#blur_strength_counter').val(power_user.blur_strength); | 1096 | $('#blur_strength_counter').val(power_user.blur_strength); |
| 1113 | $('#blur_strength').val(power_user.blur_strength); | 1097 | $('#blur_strength').val(power_user.blur_strength); |
| 1114 | } | 1098 | } |
| 1115 | 1099 | ||
| 1116 | async function applyShadowWidth() { | 1100 | async function applyShadowWidth() { |
| 1117 | power_user.shadow_width = Number(localStorage.getItem(storage_keys.shadow_width) ?? 2); | 1101 | document.documentElement.style.setProperty('--shadowWidth', String(power_user.shadow_width)); |
| 1118 | document.documentElement.style.setProperty('--shadowWidth', power_user.shadow_width); | ||
| 1119 | $('#shadow_width_counter').val(power_user.shadow_width); | 1102 | $('#shadow_width_counter').val(power_user.shadow_width); |
| 1120 | $('#shadow_width').val(power_user.shadow_width); | 1103 | $('#shadow_width').val(power_user.shadow_width); |
| 1121 | 1104 | ||
| @@ -1124,11 +1107,11 @@ async function applyShadowWidth() { | |||
| 1124 | async function applyFontScale(type) { | 1107 | async function applyFontScale(type) { |
| 1125 | //this is to allow forced setting on page load, theme swap, etc | 1108 | //this is to allow forced setting on page load, theme swap, etc |
| 1126 | if (type === 'forced') { | 1109 | if (type === 'forced') { |
| 1127 | document.documentElement.style.setProperty('--fontScale', power_user.font_scale); | 1110 | document.documentElement.style.setProperty('--fontScale', String(power_user.font_scale)); |
| 1128 | } else { | 1111 | } else { |
| 1129 | //this is to prevent the slider from updating page in real time | 1112 | //this is to prevent the slider from updating page in real time |
| 1130 | $('#font_scale').off('mouseup touchend').on('mouseup touchend', () => { | 1113 | $('#font_scale').off('mouseup touchend').on('mouseup touchend', () => { |
| 1131 | document.documentElement.style.setProperty('--fontScale', power_user.font_scale); | 1114 | document.documentElement.style.setProperty('--fontScale', String(power_user.font_scale)); |
| 1132 | }); | 1115 | }); |
| 1133 | } | 1116 | } |
| 1134 | 1117 | ||
| @@ -1163,14 +1146,12 @@ async function applyTheme(name) { | |||
| 1163 | { | 1146 | { |
| 1164 | key: 'custom_css', | 1147 | key: 'custom_css', |
| 1165 | action: async () => { | 1148 | action: async () => { |
| 1166 | localStorage.setItem(storage_keys.custom_css, power_user.custom_css); | ||
| 1167 | await applyCustomCSS(); | 1149 | await applyCustomCSS(); |
| 1168 | }, | 1150 | }, |
| 1169 | }, | 1151 | }, |
| 1170 | { | 1152 | { |
| 1171 | key: 'shadow_width', | 1153 | key: 'shadow_width', |
| 1172 | action: async () => { | 1154 | action: async () => { |
| 1173 | localStorage.setItem(storage_keys.shadow_width, power_user.shadow_width); | ||
| 1174 | await applyShadowWidth(); | 1155 | await applyShadowWidth(); |
| 1175 | }, | 1156 | }, |
| 1176 | }, | 1157 | }, |
| @@ -1379,7 +1360,6 @@ function applyPowerUserSettings() { | |||
| 1379 | switchMessageActions(); | 1360 | switchMessageActions(); |
| 1380 | } | 1361 | } |
| 1381 | 1362 | ||
| 1382 | |||
| 1383 | function getExampleMessagesBehavior() { | 1363 | function getExampleMessagesBehavior() { |
| 1384 | if (power_user.strip_examples) { | 1364 | if (power_user.strip_examples) { |
| 1385 | return 'strip'; | 1365 | return 'strip'; |
| @@ -3180,7 +3160,6 @@ $(document).ready(() => { | |||
| 3180 | saveSettingsDebounced(); | 3160 | saveSettingsDebounced(); |
| 3181 | }); | 3161 | }); |
| 3182 | 3162 | ||
| 3183 | // Settings that go to local storage | ||
| 3184 | $('#fast_ui_mode').change(function () { | 3163 | $('#fast_ui_mode').change(function () { |
| 3185 | power_user.fast_ui_mode = $(this).prop('checked'); | 3164 | power_user.fast_ui_mode = $(this).prop('checked'); |
| 3186 | switchUiMode(); | 3165 | switchUiMode(); |
| @@ -3195,7 +3174,6 @@ $(document).ready(() => { | |||
| 3195 | 3174 | ||
| 3196 | $('#customCSS').on('input', () => { | 3175 | $('#customCSS').on('input', () => { |
| 3197 | power_user.custom_css = String($('#customCSS').val()); | 3176 | power_user.custom_css = String($('#customCSS').val()); |
| 3198 | localStorage.setItem(storage_keys.custom_css, power_user.custom_css); | ||
| 3199 | saveSettingsDebounced(); | 3177 | saveSettingsDebounced(); |
| 3200 | applyCustomCSS(); | 3178 | applyCustomCSS(); |
| 3201 | }); | 3179 | }); |
| @@ -3276,7 +3254,6 @@ $(document).ready(() => { | |||
| 3276 | $('input[name="shadow_width"]').on('input', async function (e) { | 3254 | $('input[name="shadow_width"]').on('input', async function (e) { |
| 3277 | power_user.shadow_width = Number(e.target.value); | 3255 | power_user.shadow_width = Number(e.target.value); |
| 3278 | $('#shadow_width_counter').val(power_user.shadow_width); | 3256 | $('#shadow_width_counter').val(power_user.shadow_width); |
| 3279 | localStorage.setItem(storage_keys.shadow_width, power_user.shadow_width); | ||
| 3280 | await applyShadowWidth(); | 3257 | await applyShadowWidth(); |
| 3281 | saveSettingsDebounced(); | 3258 | saveSettingsDebounced(); |
| 3282 | }); | 3259 | }); |