From cee92cddf34ca6d3127027cdf7d18ea53c27d8da Mon Sep 17 00:00:00 2001 From: Bruno FS Date: Fri, 28 Apr 2023 12:50:05 -0300 Subject: [PATCH] added changes are optional --- public/script.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 883df8d81..6775261f9 100644 --- a/public/script.js +++ b/public/script.js @@ -440,6 +440,8 @@ let novel_tier; let novelai_settings; let novelai_setting_names; +let scrollChatToBottomAuto = true; +let autoFixGeneratedTextMarkdown = true; //css var bg1_toggle = true; // inits the BG as BG1 var css_mes_bg = $('
').css("background"); @@ -1068,8 +1070,10 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true } function scrollChatToBottom() { - // var $textchat = $("#chat"); - // $textchat.scrollTop(($textchat[0].scrollHeight)); + if (scrollChatToBottomAuto) { + var $textchat = $("#chat"); + $textchat.scrollTop(($textchat[0].scrollHeight)); + } } function substituteParams(content, _name1, _name2) { @@ -2873,6 +2877,12 @@ async function getSettings(type) { // Load- character tags loadTagsSettings(settings); + // Others, TODO: move to power user settings + if (settings.scrollChatToBottomAuto !== undefined) + scrollChatToBottomAuto = !!settings.scrollChatToBottomAuto; + if (settings.autoFixGeneratedTextMarkdown !== undefined) + autoFixGeneratedTextMarkdown = !!settings.autoFixGeneratedTextMarkdown; + //Enable GUI deference settings if GUI is selected for Kobold if (main_api === "kobold") { }