mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Migrate advanced formatting settings to settings.json
This commit is contained in:
@ -39,16 +39,9 @@ import {
|
|||||||
} from "./scripts/group-chats.js";
|
} from "./scripts/group-chats.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
force_pygmalion_formatting,
|
|
||||||
collapse_newlines,
|
|
||||||
pin_examples,
|
|
||||||
collapseNewlines,
|
collapseNewlines,
|
||||||
disable_description_formatting,
|
loadPowerUserSettings,
|
||||||
disable_personality_formatting,
|
power_user,
|
||||||
disable_scenario_formatting,
|
|
||||||
always_force_name2,
|
|
||||||
custom_chat_separator,
|
|
||||||
multigen,
|
|
||||||
} from "./scripts/power-user.js";
|
} from "./scripts/power-user.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -479,7 +472,7 @@ async function getStatus() {
|
|||||||
if (online_status == undefined) {
|
if (online_status == undefined) {
|
||||||
online_status = "no_connection";
|
online_status = "no_connection";
|
||||||
}
|
}
|
||||||
if (online_status.toLowerCase().indexOf("pygmalion") != -1 || (online_status !== "no_connection" && force_pygmalion_formatting)) {
|
if (online_status.toLowerCase().indexOf("pygmalion") != -1 || (online_status !== "no_connection" && power_user.force_pygmalion_formatting)) {
|
||||||
is_pygmalion = true;
|
is_pygmalion = true;
|
||||||
online_status += " (Pyg. formatting on)";
|
online_status += " (Pyg. formatting on)";
|
||||||
} else {
|
} else {
|
||||||
@ -1071,7 +1064,7 @@ function baseChatReplace(value, name1, name2) {
|
|||||||
value = value.replace(/<USER>/gi, name1);
|
value = value.replace(/<USER>/gi, name1);
|
||||||
value = value.replace(/<BOT>/gi, name2);
|
value = value.replace(/<BOT>/gi, name2);
|
||||||
|
|
||||||
if (collapse_newlines) {
|
if (power_user.collapse_newlines) {
|
||||||
value = collapseNewlines(value);
|
value = collapseNewlines(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1222,12 +1215,12 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_pygmalion) {
|
if (is_pygmalion) {
|
||||||
storyString += appendToStoryString(charDescription, disable_description_formatting ? '' : name2 + "'s Persona: ");
|
storyString += appendToStoryString(charDescription, power_user.disable_description_formatting ? '' : name2 + "'s Persona: ");
|
||||||
storyString += appendToStoryString(charPersonality, disable_personality_formatting ? '' : 'Personality: ');
|
storyString += appendToStoryString(charPersonality, power_user.disable_personality_formatting ? '' : 'Personality: ');
|
||||||
storyString += appendToStoryString(Scenario, disable_scenario_formatting ? '' : 'Scenario: ');
|
storyString += appendToStoryString(Scenario, power_user.disable_scenario_formatting ? '' : 'Scenario: ');
|
||||||
} else {
|
} else {
|
||||||
if (charDescription !== undefined) {
|
if (charDescription !== undefined) {
|
||||||
if (charPersonality.length > 0 && !disable_personality_formatting) {
|
if (charPersonality.length > 0 && !power_user.disable_personality_formatting) {
|
||||||
charPersonality = name2 + "'s personality: " + charPersonality;
|
charPersonality = name2 + "'s personality: " + charPersonality;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1243,13 +1236,13 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (custom_chat_separator && custom_chat_separator.length) {
|
if (power_user.custom_chat_separator && power_user.custom_chat_separator.length) {
|
||||||
for (let i = 0; i < mesExamplesArray.length; i++) {
|
for (let i = 0; i < mesExamplesArray.length; i++) {
|
||||||
mesExamplesArray[i] = mesExamplesArray[i].replace(/<START>/gi, custom_chat_separator);
|
mesExamplesArray[i] = mesExamplesArray[i].replace(/<START>/gi, power_user.custom_chat_separator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pin_examples && main_api !== 'openai') {
|
if (power_user.pin_examples && main_api !== 'openai') {
|
||||||
for (let example of mesExamplesArray) {
|
for (let example of mesExamplesArray) {
|
||||||
if (!is_pygmalion) {
|
if (!is_pygmalion) {
|
||||||
if (!storyString.endsWith('\n')) {
|
if (!storyString.endsWith('\n')) {
|
||||||
@ -1262,7 +1255,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pygmalion does that anyway
|
// Pygmalion does that anyway
|
||||||
if (always_force_name2 && !is_pygmalion) {
|
if (power_user.always_force_name2 && !is_pygmalion) {
|
||||||
force_name2 = true;
|
force_name2 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1382,7 +1375,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
count_exm_add = 0;
|
count_exm_add = 0;
|
||||||
|
|
||||||
if (i === chat2.length - 1) {
|
if (i === chat2.length - 1) {
|
||||||
if (!pin_examples) {
|
if (!power_user.pin_examples) {
|
||||||
let mesExmString = '';
|
let mesExmString = '';
|
||||||
for (let iii = 0; iii < mesExamplesArray.length; iii++) {
|
for (let iii = 0; iii < mesExamplesArray.length; iii++) {
|
||||||
mesExmString += mesExamplesArray[iii];
|
mesExmString += mesExamplesArray[iii];
|
||||||
@ -1402,7 +1395,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
if (!storyString.endsWith('\n')) {
|
if (!storyString.endsWith('\n')) {
|
||||||
storyString += '\n';
|
storyString += '\n';
|
||||||
}
|
}
|
||||||
storyString += !disable_scenario_formatting ? `Circumstances and context of the dialogue: ${Scenario}\n` : `${Scenario}\n`;
|
storyString += !power_user.disable_scenario_formatting ? `Circumstances and context of the dialogue: ${Scenario}\n` : `${Scenario}\n`;
|
||||||
}
|
}
|
||||||
console.log('calling runGenerate');
|
console.log('calling runGenerate');
|
||||||
await runGenerate();
|
await runGenerate();
|
||||||
@ -1535,8 +1528,8 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add a custom dingus (if defined)
|
// add a custom dingus (if defined)
|
||||||
if (custom_chat_separator && custom_chat_separator.length) {
|
if (power_user.custom_chat_separator && power_user.custom_chat_separator.length) {
|
||||||
mesSendString = custom_chat_separator + '\n' + mesSendString;
|
mesSendString = power_user.custom_chat_separator + '\n' + mesSendString;
|
||||||
}
|
}
|
||||||
// add non-pygma dingus
|
// add non-pygma dingus
|
||||||
else if (!is_pygmalion) {
|
else if (!is_pygmalion) {
|
||||||
@ -1568,7 +1561,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
|
|
||||||
finalPromt = finalPromt.replace(/\r/gm, '');
|
finalPromt = finalPromt.replace(/\r/gm, '');
|
||||||
|
|
||||||
if (collapse_newlines) {
|
if (power_user.collapse_newlines) {
|
||||||
finalPromt = collapseNewlines(finalPromt);
|
finalPromt = collapseNewlines(finalPromt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1733,7 +1726,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
getMessage = data;
|
getMessage = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (collapse_newlines) {
|
if (power_user.collapse_newlines) {
|
||||||
getMessage = collapseNewlines(getMessage);
|
getMessage = collapseNewlines(getMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1875,7 +1868,7 @@ function saveReply(type, getMessage, this_mes_is_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isMultigenEnabled() {
|
function isMultigenEnabled() {
|
||||||
return multigen && (main_api == 'textgenerationwebui' || main_api == 'kobold' || main_api == 'novel');
|
return power_user.multigen && (main_api == 'textgenerationwebui' || main_api == 'kobold' || main_api == 'novel');
|
||||||
}
|
}
|
||||||
|
|
||||||
function activateSendButtons() {
|
function activateSendButtons() {
|
||||||
@ -2331,6 +2324,9 @@ async function getSettings(type) {
|
|||||||
// Horde
|
// Horde
|
||||||
loadHordeSettings(settings);
|
loadHordeSettings(settings);
|
||||||
|
|
||||||
|
// Load power user settings
|
||||||
|
loadPowerUserSettings(settings);
|
||||||
|
|
||||||
//Enable GUI deference settings if GUI is selected for Kobold
|
//Enable GUI deference settings if GUI is selected for Kobold
|
||||||
if (main_api === "kobold") {
|
if (main_api === "kobold") {
|
||||||
if (preset_settings == "gui") {
|
if (preset_settings == "gui") {
|
||||||
@ -2427,6 +2423,7 @@ async function saveSettings(type) {
|
|||||||
textgenerationwebui_settings: textgenerationwebui_settings,
|
textgenerationwebui_settings: textgenerationwebui_settings,
|
||||||
swipes: swipes,
|
swipes: swipes,
|
||||||
horde_settings: horde_settings,
|
horde_settings: horde_settings,
|
||||||
|
power_user: power_user,
|
||||||
...nai_settings,
|
...nai_settings,
|
||||||
...kai_settings,
|
...kai_settings,
|
||||||
...oai_settings,
|
...oai_settings,
|
||||||
|
@ -15,8 +15,7 @@ import {
|
|||||||
} from "../script.js";
|
} from "../script.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
fast_ui_mode,
|
power_user,
|
||||||
pin_examples,
|
|
||||||
} from "./power-user.js";
|
} from "./power-user.js";
|
||||||
|
|
||||||
import { LoadLocal, SaveLocal, ClearLocal, CheckLocal, LoadLocalBool } from "./f-localStorage.js";
|
import { LoadLocal, SaveLocal, ClearLocal, CheckLocal, LoadLocalBool } from "./f-localStorage.js";
|
||||||
@ -156,7 +155,7 @@ function RA_CountCharTokens() {
|
|||||||
characters[this_chid].description +
|
characters[this_chid].description +
|
||||||
characters[this_chid].personality +
|
characters[this_chid].personality +
|
||||||
characters[this_chid].scenario +
|
characters[this_chid].scenario +
|
||||||
(pin_examples ? characters[this_chid].mes_example : '') // add examples to permanent if they are pinned
|
(power_user.pin_examples ? characters[this_chid].mes_example : '') // add examples to permanent if they are pinned
|
||||||
)).length;
|
)).length;
|
||||||
} else { console.log("RA_TC -- no valid char found, closing."); } // if neither, probably safety char or some error in loading
|
} else { console.log("RA_TC -- no valid char found, closing."); } // if neither, probably safety char or some error in loading
|
||||||
}
|
}
|
||||||
@ -206,7 +205,7 @@ function RA_checkOnlineStatus() {
|
|||||||
} else {
|
} else {
|
||||||
if (online_status !== undefined && online_status !== "no_connection") {
|
if (online_status !== undefined && online_status !== "no_connection") {
|
||||||
$("#send_textarea").attr("placeholder", "Type a message..."); //on connect, placeholder tells user to type message
|
$("#send_textarea").attr("placeholder", "Type a message..."); //on connect, placeholder tells user to type message
|
||||||
const formColor = fast_ui_mode ? "var(--black90a)" : "var(--black60a)";
|
const formColor = power_user.fast_ui_mode ? "var(--black90a)" : "var(--black60a)";
|
||||||
$("#send_form").css("background-color", formColor); //on connect, form BG changes to transprent black
|
$("#send_form").css("background-color", formColor); //on connect, form BG changes to transprent black
|
||||||
$("#API-status-top").removeClass("redOverlayGlow");
|
$("#API-status-top").removeClass("redOverlayGlow");
|
||||||
connection_made = true;
|
connection_made = true;
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
import { groups, selected_group } from "./group-chats.js";
|
import { groups, selected_group } from "./group-chats.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
pin_examples,
|
power_user,
|
||||||
} from "./power-user.js";
|
} from "./power-user.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -294,7 +294,7 @@ async function prepareOpenAIMessages(name2, storyString, worldInfoBefore, worldI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The user wants to always have all example messages in the context
|
// The user wants to always have all example messages in the context
|
||||||
if (pin_examples) {
|
if (power_user.pin_examples) {
|
||||||
// first we send *all* example messages
|
// first we send *all* example messages
|
||||||
// we don't check their token size since if it's bigger than the context, the user is fucked anyway
|
// we don't check their token size since if it's bigger than the context, the user is fucked anyway
|
||||||
// and should've have selected that option (maybe have some warning idk, too hard to add)
|
// and should've have selected that option (maybe have some warning idk, too hard to add)
|
||||||
|
@ -1,28 +1,24 @@
|
|||||||
|
import { saveSettingsDebounced } from "../script.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
loadPowerUserSettings,
|
||||||
collapseNewlines,
|
collapseNewlines,
|
||||||
collapse_newlines,
|
power_user,
|
||||||
force_pygmalion_formatting,
|
|
||||||
pin_examples,
|
|
||||||
disable_description_formatting,
|
|
||||||
disable_scenario_formatting,
|
|
||||||
disable_personality_formatting,
|
|
||||||
always_force_name2,
|
|
||||||
custom_chat_separator,
|
|
||||||
fast_ui_mode,
|
|
||||||
multigen,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let collapse_newlines = false;
|
let power_user = {
|
||||||
let force_pygmalion_formatting = false;
|
collapse_newlines: false,
|
||||||
let pin_examples = false;
|
force_pygmalion_formatting: false,
|
||||||
let disable_description_formatting = false;
|
pin_examples: false,
|
||||||
let disable_scenario_formatting = false;
|
disable_description_formatting: false,
|
||||||
let disable_personality_formatting = false;
|
disable_scenario_formatting: false,
|
||||||
let always_force_name2 = false;
|
disable_personality_formatting: false,
|
||||||
let fast_ui_mode = false;
|
always_force_name2: false,
|
||||||
let multigen = false;
|
multigen: false,
|
||||||
let avatar_style = 0;
|
custom_chat_separator: '',
|
||||||
let custom_chat_separator = '';
|
fast_ui_mode: false,
|
||||||
|
avatar_style: 0,
|
||||||
|
};
|
||||||
|
|
||||||
const storage_keys = {
|
const storage_keys = {
|
||||||
collapse_newlines: "TavernAI_collapse_newlines",
|
collapse_newlines: "TavernAI_collapse_newlines",
|
||||||
@ -43,8 +39,8 @@ function collapseNewlines(x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switchUiMode() {
|
function switchUiMode() {
|
||||||
fast_ui_mode = localStorage.getItem(storage_keys.fast_ui_mode) == "true";
|
power_user.fast_ui_mode = localStorage.getItem(storage_keys.fast_ui_mode) == "true";
|
||||||
if (fast_ui_mode) {
|
if (power_user.fast_ui_mode) {
|
||||||
$("body").addClass("no-blur");
|
$("body").addClass("no-blur");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -53,8 +49,8 @@ function switchUiMode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function applyAvatarStyle() {
|
function applyAvatarStyle() {
|
||||||
avatar_style = Number(localStorage.getItem(storage_keys.avatar_style) ?? 0);
|
power_user.avatar_style = Number(localStorage.getItem(storage_keys.avatar_style) ?? 0);
|
||||||
switch (avatar_style) {
|
switch (power_user.avatar_style) {
|
||||||
case 0:
|
case 0:
|
||||||
$("body").removeClass("big-avatars");
|
$("body").removeClass("big-avatars");
|
||||||
break;
|
break;
|
||||||
@ -67,90 +63,101 @@ function applyAvatarStyle() {
|
|||||||
applyAvatarStyle();
|
applyAvatarStyle();
|
||||||
switchUiMode();
|
switchUiMode();
|
||||||
|
|
||||||
function loadPowerUserSettings() {
|
// TODO delete in next release
|
||||||
collapse_newlines = localStorage.getItem(storage_keys.collapse_newlines) == "true";
|
function loadFromLocalStorage() {
|
||||||
force_pygmalion_formatting = localStorage.getItem(storage_keys.force_pygmalion_formatting) == "true";
|
power_user.collapse_newlines = localStorage.getItem(storage_keys.collapse_newlines) == "true";
|
||||||
pin_examples = localStorage.getItem(storage_keys.pin_examples) == "true";
|
power_user.force_pygmalion_formatting = localStorage.getItem(storage_keys.force_pygmalion_formatting) == "true";
|
||||||
disable_description_formatting = localStorage.getItem(storage_keys.disable_description_formatting) == "true";
|
power_user.pin_examples = localStorage.getItem(storage_keys.pin_examples) == "true";
|
||||||
disable_scenario_formatting = localStorage.getItem(storage_keys.disable_scenario_formatting) == "true";
|
power_user.disable_description_formatting = localStorage.getItem(storage_keys.disable_description_formatting) == "true";
|
||||||
disable_personality_formatting = localStorage.getItem(storage_keys.disable_personality_formatting) == "true";
|
power_user.disable_scenario_formatting = localStorage.getItem(storage_keys.disable_scenario_formatting) == "true";
|
||||||
always_force_name2 = localStorage.getItem(storage_keys.always_force_name2) == "true";
|
power_user.disable_personality_formatting = localStorage.getItem(storage_keys.disable_personality_formatting) == "true";
|
||||||
custom_chat_separator = localStorage.getItem(storage_keys.custom_chat_separator);
|
power_user.always_force_name2 = localStorage.getItem(storage_keys.always_force_name2) == "true";
|
||||||
fast_ui_mode = localStorage.getItem(storage_keys.fast_ui_mode) == "true";
|
power_user.custom_chat_separator = localStorage.getItem(storage_keys.custom_chat_separator);
|
||||||
multigen = localStorage.getItem(storage_keys.multigen) == "true";
|
power_user.multigen = localStorage.getItem(storage_keys.multigen) == "true";
|
||||||
avatar_style = Number(localStorage.getItem(storage_keys.avatar_style) ?? 0);
|
}
|
||||||
|
|
||||||
$("#force-pygmalion-formatting-checkbox").prop("checked", force_pygmalion_formatting);
|
function loadPowerUserSettings(settings) {
|
||||||
$("#collapse-newlines-checkbox").prop("checked", collapse_newlines);
|
// Migrate legacy settings
|
||||||
$("#pin-examples-checkbox").prop("checked", pin_examples);
|
loadFromLocalStorage();
|
||||||
$("#disable-description-formatting-checkbox").prop("checked", disable_description_formatting);
|
|
||||||
$("#disable-scenario-formatting-checkbox").prop("checked", disable_scenario_formatting);
|
// Now do it properly from settings.json
|
||||||
$("#disable-personality-formatting-checkbox").prop("checked", disable_personality_formatting);
|
if (settings.power_user !== undefined) {
|
||||||
$("#always-force-name2-checkbox").prop("checked", always_force_name2);
|
Object.assign(power_user, settings.power_user);
|
||||||
$("#custom_chat_separator").val(custom_chat_separator);
|
}
|
||||||
$("#fast_ui_mode").prop("checked", fast_ui_mode);
|
|
||||||
$("#multigen").prop("checked", multigen);
|
// These are still local storage
|
||||||
$(`input[name="avatar_style"][value="${avatar_style}"]`).prop("checked", true);
|
power_user.fast_ui_mode = localStorage.getItem(storage_keys.fast_ui_mode) == "true";
|
||||||
|
power_user.avatar_style = Number(localStorage.getItem(storage_keys.avatar_style) ?? 0);
|
||||||
|
|
||||||
|
$("#force-pygmalion-formatting-checkbox").prop("checked", power_user.force_pygmalion_formatting);
|
||||||
|
$("#collapse-newlines-checkbox").prop("checked", power_user.collapse_newlines);
|
||||||
|
$("#pin-examples-checkbox").prop("checked", power_user.pin_examples);
|
||||||
|
$("#disable-description-formatting-checkbox").prop("checked", power_user.disable_description_formatting);
|
||||||
|
$("#disable-scenario-formatting-checkbox").prop("checked", power_user.disable_scenario_formatting);
|
||||||
|
$("#disable-personality-formatting-checkbox").prop("checked", power_user.disable_personality_formatting);
|
||||||
|
$("#always-force-name2-checkbox").prop("checked", power_user.always_force_name2);
|
||||||
|
$("#custom_chat_separator").val(power_user.custom_chat_separator);
|
||||||
|
$("#fast_ui_mode").prop("checked", power_user.fast_ui_mode);
|
||||||
|
$("#multigen").prop("checked", power_user.multigen);
|
||||||
|
$(`input[name="avatar_style"][value="${power_user.avatar_style}"]`).prop("checked", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
// Auto-load from local storage
|
// Settings that go to settings.json
|
||||||
loadPowerUserSettings();
|
|
||||||
|
|
||||||
$("#collapse-newlines-checkbox").change(function () {
|
$("#collapse-newlines-checkbox").change(function () {
|
||||||
collapse_newlines = !!$(this).prop("checked");
|
power_user.collapse_newlines = !!$(this).prop("checked");
|
||||||
localStorage.setItem(storage_keys.collapse_newlines, collapse_newlines);
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#force-pygmalion-formatting-checkbox").change(function () {
|
$("#force-pygmalion-formatting-checkbox").change(function () {
|
||||||
force_pygmalion_formatting = !!$(this).prop("checked");
|
power_user.force_pygmalion_formatting = !!$(this).prop("checked");
|
||||||
localStorage.setItem(storage_keys.force_pygmalion_formatting, force_pygmalion_formatting);
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#pin-examples-checkbox").change(function () {
|
$("#pin-examples-checkbox").change(function () {
|
||||||
pin_examples = !!$(this).prop("checked");
|
power_user.pin_examples = !!$(this).prop("checked");
|
||||||
localStorage.setItem(storage_keys.pin_examples, pin_examples);
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#disable-description-formatting-checkbox").change(function () {
|
$("#disable-description-formatting-checkbox").change(function () {
|
||||||
disable_description_formatting = !!$(this).prop('checked');
|
power_user.disable_description_formatting = !!$(this).prop('checked');
|
||||||
localStorage.setItem(storage_keys.disable_description_formatting, disable_description_formatting);
|
saveSettingsDebounced();
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#disable-scenario-formatting-checkbox").change(function () {
|
$("#disable-scenario-formatting-checkbox").change(function () {
|
||||||
disable_scenario_formatting = !!$(this).prop('checked');
|
power_user.disable_scenario_formatting = !!$(this).prop('checked');
|
||||||
localStorage.setItem(storage_keys.disable_scenario_formatting, disable_scenario_formatting);
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#disable-personality-formatting-checkbox").change(function () {
|
$("#disable-personality-formatting-checkbox").change(function () {
|
||||||
disable_personality_formatting = !!$(this).prop('checked');
|
power_user.disable_personality_formatting = !!$(this).prop('checked');
|
||||||
localStorage.setItem(storage_keys.disable_personality_formatting, disable_personality_formatting);
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#always-force-name2-checkbox").change(function () {
|
$("#always-force-name2-checkbox").change(function () {
|
||||||
always_force_name2 = !!$(this).prop("checked");
|
power_user.always_force_name2 = !!$(this).prop("checked");
|
||||||
localStorage.setItem(storage_keys.always_force_name2, always_force_name2);
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#custom_chat_separator").on('input', function() {
|
$("#custom_chat_separator").on('input', function() {
|
||||||
custom_chat_separator = $(this).val();
|
power_user.custom_chat_separator = $(this).val();
|
||||||
localStorage.setItem(storage_keys.custom_chat_separator, custom_chat_separator);
|
saveSettingsDebounced();
|
||||||
|
});
|
||||||
|
$("#multigen").change(function () {
|
||||||
|
power_user.multigen = $(this).prop("checked");
|
||||||
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Settings that go to local storage
|
||||||
$("#fast_ui_mode").change(function () {
|
$("#fast_ui_mode").change(function () {
|
||||||
fast_ui_mode = $(this).prop("checked");
|
power_user.fast_ui_mode = $(this).prop("checked");
|
||||||
localStorage.setItem(storage_keys.fast_ui_mode, fast_ui_mode);
|
localStorage.setItem(storage_keys.fast_ui_mode, power_user.fast_ui_mode);
|
||||||
switchUiMode();
|
switchUiMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#multigen").change(function () {
|
|
||||||
multigen = $(this).prop("checked");
|
|
||||||
localStorage.setItem(storage_keys.multigen, multigen);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(`input[name="avatar_style"]`).on('input', function (e) {
|
$(`input[name="avatar_style"]`).on('input', function (e) {
|
||||||
avatar_style = Number(e.target.value);
|
power_user.avatar_style = Number(e.target.value);
|
||||||
localStorage.setItem(storage_keys.avatar_style, avatar_style);
|
localStorage.setItem(storage_keys.avatar_style, power_user.avatar_style);
|
||||||
applyAvatarStyle();
|
applyAvatarStyle();
|
||||||
});
|
});
|
||||||
});
|
});
|
Reference in New Issue
Block a user