From 1a58dbf6f5eaa8b6f5d153ed92a7fdc768122df3 Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 7 Sep 2023 20:34:32 -0400 Subject: [PATCH 1/5] Fix for menu buttons going over slide outs on mobile --- static/koboldai.css | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index 5ca2bf1c..1e2b2bf1 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -443,7 +443,7 @@ border-top-right-radius: var(--tabs_rounding); position: fixed; top:10px; left: 5px; - z-index:50; + z-index:21; display: inline-block; cursor: pointer; } @@ -465,7 +465,7 @@ border-top-right-radius: var(--tabs_rounding); position: absolute; top:10px; left: calc(var(--flyout_menu_width) - 20px); - z-index:50; + z-index:21; width: 25px; height: 25px; color: #999; @@ -492,7 +492,7 @@ border-top-right-radius: var(--tabs_rounding); top:8px; color: var(--text); left: calc(var(--flyout_menu_width) - 133px); - z-index:50; + z-index:21; width: 25px; height: 25px; display: inline-block; @@ -502,7 +502,7 @@ border-top-right-radius: var(--tabs_rounding); .SideMenu { height: 100%; - z-index: 4; + z-index: 20; color: var(--flyout_text); width: var(--flyout_menu_width); box-shadow: var(--left_menu_strong_shadow); @@ -900,7 +900,7 @@ border-top-right-radius: var(--tabs_rounding); position: fixed; top:10px; right: 5px; - z-index:50; + z-index:11; display: inline-block; cursor: pointer; grid-area: lefticon; @@ -914,12 +914,11 @@ border-top-right-radius: var(--tabs_rounding); } .rightSideMenu { - z-index: 3; height: 100%; position: fixed; color: var(--flyout_text); box-shadow: var(--right_menu_strong_shadow); - z-index: 3; + z-index: 10; top: 0; right: 0; background-color: var(--flyout_background); From 75bbe3a0fbe95b08200d7442367c2d8aa65c934e Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 7 Sep 2023 20:36:48 -0400 Subject: [PATCH 2/5] Fix for editing text before the prompt exists --- static/koboldai.js | 12 +++++++++--- templates/index_new.html | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/static/koboldai.js b/static/koboldai.js index 2c3c8850..9ab6b7a4 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -957,7 +957,6 @@ function var_changed(data) { if (current_action <= 0) { //console.log("setting action_count to "+current_action); const storyPrompt = $el("#story_prompt"); - if (storyPrompt) storyPrompt.classList.remove("hidden"); scroll_trigger_element = undefined; document.getElementById("Selected Text").onscroll = undefined; } @@ -3388,6 +3387,10 @@ function gametextwatcher(records) { if (!dirty_chunks.includes("game_text")) { dirty_chunks.push("game_text"); } + } else if ((record.target.nodeName == "#text") && (record.target.parentNode == game_text)) { + if (!dirty_chunks.includes("game_text")) { + dirty_chunks.push("game_text"); + } } } } @@ -3427,17 +3430,20 @@ function fix_dirty_game_text() { } else { node_text = node.data; } - if (!(node.nextElementSibling) || !(dirty_chunks.includes(node.nextElementSibling.getAttribute("chunk"))) || dirty_chunks.includes(node.previousElementSibling.getAttribute("chunk"))) { + if ((!(node.nextElementSibling) || !(dirty_chunks.includes(node.nextElementSibling.getAttribute("chunk"))) || dirty_chunks.includes(node.previousElementSibling.getAttribute("chunk"))) && (node.previousElementSibling)) { node.previousElementSibling.innerText = node.previousElementSibling.innerText + node_text; if (!dirty_chunks.includes(node.previousElementSibling.getAttribute("chunk"))) { dirty_chunks.push(node.previousElementSibling.getAttribute("chunk")); } } else { node.nextElementSibling.innerText = node.nextElementSibling.innerText + node_text; + if (!dirty_chunks.includes(node.nextElementSibling.getAttribute("chunk"))) { + dirty_chunks.push(node.nextElementSibling.getAttribute("chunk")); + } } //Looks like sometimes it splits the parent. Let's look for that and fix it too - if (node.nextElementSibling && (node.nextElementSibling.getAttribute("chunk") == node.previousElementSibling.getAttribute("chunk"))) { + if (node.nextElementSibling && node.previousElementSibling && (node.nextElementSibling.getAttribute("chunk") == node.previousElementSibling.getAttribute("chunk"))) { node.previousElementSibling.innerText = node.previousElementSibling.innerText + node.nextElementSibling.innerText; node.nextElementSibling.remove(); } diff --git a/templates/index_new.html b/templates/index_new.html index 64c4c76b..8654e59c 100644 --- a/templates/index_new.html +++ b/templates/index_new.html @@ -54,7 +54,7 @@
-
+ From eb7b82912df2c32528049f6ca318372ee8e86603 Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 7 Sep 2023 20:38:18 -0400 Subject: [PATCH 3/5] Fix for welcome message going away when clicked in --- static/koboldai.css | 2 ++ static/koboldai.js | 11 +++++++++++ templates/index_new.html | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/static/koboldai.css b/static/koboldai.css index 1e2b2bf1..9b10a928 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -2873,7 +2873,9 @@ body { } .welcome_container { + position: absolute; height: 100%; + width: 100%; display: flex; margin-top: auto; } diff --git a/static/koboldai.js b/static/koboldai.js index 9ab6b7a4..64bb119a 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -6106,6 +6106,17 @@ function closePopups(userAction=false) { if (allHidden) container.classList.add("hidden"); } +function hide_welcome_container() { + welcome_container = document.getElementById("welcome_container"); + welcome_container.classList.add("hidden"); + document.getElementById("Selected Text").focus(); +} + +function show_welcome_container() { + welcome_container = document.getElementById("welcome_container"); + welcome_container.classList.remove("hidden"); +} + $el("#popup-container").addEventListener("click", function(event) { if (event.target === this) closePopups(true); }); diff --git a/templates/index_new.html b/templates/index_new.html index 8654e59c..0f2fecaf 100644 --- a/templates/index_new.html +++ b/templates/index_new.html @@ -49,7 +49,7 @@

Disconnected

-
+
From 41716a250db3f1952f93d16d27b76ed6a39a383b Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 7 Sep 2023 20:55:19 -0400 Subject: [PATCH 4/5] Fix for model parameters not triggering a parameter refresh if a validation rule is not present --- static/koboldai.js | 51 +++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/static/koboldai.js b/static/koboldai.js index 64bb119a..b2a5f0ed 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -1806,31 +1806,6 @@ function model_settings_checker() { valid = (check_value < this.check_data['value']); } if (valid || missing_element) { - //if we are supposed to refresh when this value changes we'll resubmit - if ((this.getAttribute("refresh_model_inputs") == "true") && !missing_element && !this.noresubmit) { - //get an object of all the input settings from the user - data = {} - settings_area = document.getElementById(document.getElementById("modelplugin").value + "_settings_area"); - if (settings_area) { - for (const element of settings_area.querySelectorAll(".model_settings_input:not(.hidden)")) { - var element_data = element.value; - if (element.getAttribute("data_type") == "int") { - element_data = parseInt(element_data); - } else if (element.getAttribute("data_type") == "float") { - element_data = parseFloat(element_data); - } else if (element.getAttribute("data_type") == "bool") { - element_data = element.checked; - } - data[element.id.split("|")[1].replace("_value", "")] = element_data; - } - } - data = {...data, ...selected_model_data}; - - data['plugin'] = document.getElementById("modelplugin").value; - data['valid_backends'] = getOptions("modelplugin"); - - socket.emit("resubmit_model_info", data); - } if ('sum' in this.check_data) { for (const temp of this.check_data['sum']) { if (document.getElementById(this.id.split("|")[0] +"|" + temp + "_value")) { @@ -1899,6 +1874,32 @@ function model_settings_checker() { } + + //if we are supposed to refresh when this value changes we'll resubmit + if ((this != window) && (this.getAttribute("refresh_model_inputs") == "true") && !missing_element && !this.noresubmit) { + //get an object of all the input settings from the user + data = {} + settings_area = document.getElementById(document.getElementById("modelplugin").value + "_settings_area"); + if (settings_area) { + for (const element of settings_area.querySelectorAll(".model_settings_input:not(.hidden)")) { + var element_data = element.value; + if (element.getAttribute("data_type") == "int") { + element_data = parseInt(element_data); + } else if (element.getAttribute("data_type") == "float") { + element_data = parseFloat(element_data); + } else if (element.getAttribute("data_type") == "bool") { + element_data = element.checked; + } + data[element.id.split("|")[1].replace("_value", "")] = element_data; + } + } + data = {...data, ...selected_model_data}; + + data['plugin'] = document.getElementById("modelplugin").value; + data['valid_backends'] = getOptions("modelplugin"); + + socket.emit("resubmit_model_info", data); + } } function set_toggle(id) { From 8e914f5d465e99c6eaa3edc4bf33619b0c5bdd8f Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 7 Sep 2023 21:11:49 -0400 Subject: [PATCH 5/5] Added some padding to the welcome container --- static/koboldai.css | 1 + 1 file changed, 1 insertion(+) diff --git a/static/koboldai.css b/static/koboldai.css index 9b10a928..9aca6da1 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -2878,6 +2878,7 @@ body { width: 100%; display: flex; margin-top: auto; + padding-bottom: 10px; } #welcome_text {