From 10e3c340d3012b9294131e2eb3c000d36975a2b2 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 10 Aug 2022 10:59:08 -0400 Subject: [PATCH] Added option to allow the game text to take up all space or stay centered when no menus are pinned --- static/koboldai.js | 7 +++++++ templates/settings flyout.html | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/static/koboldai.js b/static/koboldai.js index e3602f9a..c390861f 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -1342,10 +1342,15 @@ function send_world_info(uid) { //--------------------------------------------General UI Functions------------------------------------ function preserve_game_space(preserve) { var r = document.querySelector(':root'); + console.log("Setting cookie to: "+preserve); if (preserve) { + setCookie("preserve_game_space", "true"); r.style.setProperty('--setting_menu_closed_width_no_pins_width', '0px'); + document.getElementById('preserve_game_space_setting').checked = true; } else { + setCookie("preserve_game_space", "false"); r.style.setProperty('--setting_menu_closed_width_no_pins_width', '450px'); + document.getElementById('preserve_game_space_setting').checked = false; } } @@ -2054,4 +2059,6 @@ $(document).ready(function(){ } else { story_unpin(); } + console.log("cookie: "+getCookie("preserve_game_space")); + preserve_game_space((getCookie("preserve_game_space") == "true")); }); \ No newline at end of file diff --git a/templates/settings flyout.html b/templates/settings flyout.html index b368b8b0..62a43cf3 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -30,6 +30,7 @@ Model Story User + UI Help
@@ -86,4 +87,7 @@ {% endwith %}
+ \ No newline at end of file