Remove the rest of local storage settings

0d88675c461d361a58558eeec98d74f76381e0d0

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -27Ignore whitespace
public/scripts/power-user.js+4 -27
@@ -301,20 +301,6 @@ let movingUIPresets = [];
301301export let context_presets = [];
302302
303303const 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-
318304 auto_connect_legacy: 'AutoConnectEnabled',
319305 auto_load_chat_legacy: 'AutoLoadChatEnabled',
320306
@@ -1093,8 +1079,6 @@ async function applyThemeColor(type) {
10931079}
10941080
10951081async function applyCustomCSS() {
1096- power_user.custom_css = String(localStorage.getItem(storage_keys.custom_css) ?? '');
1097-
10981082 $('#customCSS').val(power_user.custom_css);
10991083 var styleId = 'custom-style';
11001084 var style = document.getElementById(styleId);
@@ -1108,14 +1092,13 @@ async function applyCustomCSS() {
11081092}
11091093
11101094async function applyBlurStrength() {
11111095 document.documentElement.style.setProperty('--blurStrength', String(power_user.blur_strength));
11121096 $('#blur_strength_counter').val(power_user.blur_strength);
11131097 $('#blur_strength').val(power_user.blur_strength);
11141098}
11151099
11161100async 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);
11191102 $('#shadow_width_counter').val(power_user.shadow_width);
11201103 $('#shadow_width').val(power_user.shadow_width);
11211104
@@ -1124,11 +1107,11 @@ async function applyShadowWidth() {
11241107async function applyFontScale(type) {
11251108 //this is to allow forced setting on page load, theme swap, etc
11261109 if (type === 'forced') {
11271110 document.documentElement.style.setProperty('--fontScale', String(power_user.font_scale));
11281111 } else {
11291112 //this is to prevent the slider from updating page in real time
11301113 $('#font_scale').off('mouseup touchend').on('mouseup touchend', () => {
11311114 document.documentElement.style.setProperty('--fontScale', String(power_user.font_scale));
11321115 });
11331116 }
11341117
@@ -1163,14 +1146,12 @@ async function applyTheme(name) {
11631146 {
11641147 key: 'custom_css',
11651148 action: async () => {
1166- localStorage.setItem(storage_keys.custom_css, power_user.custom_css);
11671149 await applyCustomCSS();
11681150 },
11691151 },
11701152 {
11711153 key: 'shadow_width',
11721154 action: async () => {
1173- localStorage.setItem(storage_keys.shadow_width, power_user.shadow_width);
11741155 await applyShadowWidth();
11751156 },
11761157 },
@@ -1379,7 +1360,6 @@ function applyPowerUserSettings() {
13791360 switchMessageActions();
13801361}
13811362
1382-
13831363function getExampleMessagesBehavior() {
13841364 if (power_user.strip_examples) {
13851365 return 'strip';
@@ -3180,7 +3160,6 @@ $(document).ready(() => {
31803160 saveSettingsDebounced();
31813161 });
31823162
3183- // Settings that go to local storage
31843163 $('#fast_ui_mode').change(function () {
31853164 power_user.fast_ui_mode = $(this).prop('checked');
31863165 switchUiMode();
@@ -3195,7 +3174,6 @@ $(document).ready(() => {
31953174
31963175 $('#customCSS').on('input', () => {
31973176 power_user.custom_css = String($('#customCSS').val());
3198- localStorage.setItem(storage_keys.custom_css, power_user.custom_css);
31993177 saveSettingsDebounced();
32003178 applyCustomCSS();
32013179 });
@@ -3276,7 +3254,6 @@ $(document).ready(() => {
32763254 $('input[name="shadow_width"]').on('input', async function (e) {
32773255 power_user.shadow_width = Number(e.target.value);
32783256 $('#shadow_width_counter').val(power_user.shadow_width);
3279- localStorage.setItem(storage_keys.shadow_width, power_user.shadow_width);
32803257 await applyShadowWidth();
32813258 saveSettingsDebounced();
32823259 });