mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#1128 Auto-Expand Message Actions
This commit is contained in:
@ -152,6 +152,7 @@ let power_user = {
|
||||
mesIDDisplay_enabled: false,
|
||||
max_context_unlocked: false,
|
||||
message_token_count_enabled: false,
|
||||
expand_message_actions: false,
|
||||
prefer_character_prompt: true,
|
||||
prefer_character_jailbreak: true,
|
||||
quick_continue: false,
|
||||
@ -235,6 +236,7 @@ const storage_keys = {
|
||||
timestamp_model_icon: 'TimestampModelIcon',
|
||||
mesIDDisplay_enabled: 'mesIDDisplayEnabled',
|
||||
message_token_count_enabled: 'MessageTokenCountEnabled',
|
||||
expand_message_actions: 'ExpandMessageActions',
|
||||
};
|
||||
|
||||
let browser_has_focus = true;
|
||||
@ -368,6 +370,13 @@ function switchTokenCount() {
|
||||
$("#messageTokensEnabled").prop("checked", power_user.message_token_count_enabled);
|
||||
}
|
||||
|
||||
function switchMessageActions() {
|
||||
const value = localStorage.getItem(storage_keys.expand_message_actions);
|
||||
power_user.expand_message_actions = value === null ? false : value == "true";
|
||||
$("body").toggleClass("expandMessageActions", power_user.expand_message_actions);
|
||||
$("#expandMessageActions").prop("checked", power_user.expand_message_actions);
|
||||
}
|
||||
|
||||
function switchMesIDDisplay() {
|
||||
const value = localStorage.getItem(storage_keys.mesIDDisplay_enabled);
|
||||
power_user.mesIDDisplay_enabled = value === null ? true : value == "true";
|
||||
@ -662,6 +671,13 @@ async function applyTheme(name) {
|
||||
switchMesIDDisplay();
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'expand_message_actions',
|
||||
action: async () => {
|
||||
localStorage.setItem(storage_keys.expand_message_actions, String(power_user.expand_message_actions));
|
||||
switchMessageActions();
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'hotswap_enabled',
|
||||
action: async () => {
|
||||
@ -733,6 +749,7 @@ switchTimestamps();
|
||||
switchIcons();
|
||||
switchMesIDDisplay();
|
||||
switchTokenCount();
|
||||
switchMessageActions();
|
||||
|
||||
function loadPowerUserSettings(settings, data) {
|
||||
// Load from settings.json
|
||||
@ -2106,6 +2123,13 @@ $(document).ready(() => {
|
||||
switchTokenCount();
|
||||
});
|
||||
|
||||
$("#expandMessageActions").on("input", function () {
|
||||
const value = !!$(this).prop('checked');
|
||||
power_user.expand_message_actions = value;
|
||||
localStorage.setItem(storage_keys.expand_message_actions, String(power_user.expand_message_actions));
|
||||
switchMessageActions();
|
||||
});
|
||||
|
||||
$("#mesIDDisplayEnabled").on("input", function () {
|
||||
const value = !!$(this).prop('checked');
|
||||
power_user.mesIDDisplay_enabled = value;
|
||||
|
Reference in New Issue
Block a user