mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add toggles for Hotswaps and Message timer
This commit is contained in:
@ -1347,54 +1347,6 @@
|
|||||||
<div name="UI Customization" class="flex-container drawer25pWidth">
|
<div name="UI Customization" class="flex-container drawer25pWidth">
|
||||||
<div class="ui-settings">
|
<div class="ui-settings">
|
||||||
<h4>UI Customization</h4>
|
<h4>UI Customization</h4>
|
||||||
<div id="font-blur-UIpresets-block" class="flex-container flexFlowColumn">
|
|
||||||
<div id="font-scale-block" class="range-block">
|
|
||||||
<div class="range-block-title">
|
|
||||||
Font Scale
|
|
||||||
</div>
|
|
||||||
<div class="range-block-range-and-counter">
|
|
||||||
<div class="range-block-range">
|
|
||||||
<input type="range" id="font_scale" name="font_scale" min="0.8" max="1.2" step="0.05">
|
|
||||||
</div>
|
|
||||||
<div class="range-block-counter">
|
|
||||||
<div contenteditable="true" data-for="font_scale" id="font_scale_counter">
|
|
||||||
select
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="blur-strength-block" class="range-block">
|
|
||||||
<div class="range-block-title">
|
|
||||||
Blur Strength
|
|
||||||
</div>
|
|
||||||
<div class="range-block-range-and-counter">
|
|
||||||
<div class="range-block-range">
|
|
||||||
<input type="range" id="blur_strength" name="blur_strength" min="0" max="30" step="1">
|
|
||||||
</div>
|
|
||||||
<div class="range-block-counter">
|
|
||||||
<div contenteditable="true" data-for="blur_strength" id="blur_strength_counter">
|
|
||||||
select
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="shadow-width-block" class="range-block">
|
|
||||||
<div class="range-block-title">
|
|
||||||
Text Shadow Width
|
|
||||||
</div>
|
|
||||||
<div class="range-block-range-and-counter">
|
|
||||||
<div class="range-block-range">
|
|
||||||
<input type="range" id="shadow_width" name="shadow_width" min="0" max="5" step="1">
|
|
||||||
</div>
|
|
||||||
<div class="range-block-counter">
|
|
||||||
<div contenteditable="true" data-for="shadow_width" id="shadow_width_counter">
|
|
||||||
select
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
Avatar Style:<br>
|
Avatar Style:<br>
|
||||||
<label>
|
<label>
|
||||||
@ -1442,6 +1394,16 @@
|
|||||||
♡ Waifu Mode ♡
|
♡ Waifu Mode ♡
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label for="messageTimerEnabled" class="checkbox_label">
|
||||||
|
<input id="messageTimerEnabled" type="checkbox" />
|
||||||
|
Message Timer
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label for="hotswapEnabled" class="checkbox_label">
|
||||||
|
<input id="hotswapEnabled" type="checkbox" />
|
||||||
|
Characters Hotswap
|
||||||
|
</label>
|
||||||
|
|
||||||
<label for="movingUImode" class="checkbox_label">
|
<label for="movingUImode" class="checkbox_label">
|
||||||
<input id="movingUImode" type="checkbox" />
|
<input id="movingUImode" type="checkbox" />
|
||||||
Movable UI Panels
|
Movable UI Panels
|
||||||
@ -1479,6 +1441,53 @@
|
|||||||
<toolcool-color-picker id="blur-tint-color-picker"></toolcool-color-picker>
|
<toolcool-color-picker id="blur-tint-color-picker"></toolcool-color-picker>
|
||||||
Blur Tint
|
Blur Tint
|
||||||
</div>
|
</div>
|
||||||
|
<div id="font-blur-UIpresets-block" class="flex-container flexFlowColumn">
|
||||||
|
<div id="font-scale-block" class="range-block">
|
||||||
|
<div class="range-block-title">
|
||||||
|
Font Scale
|
||||||
|
</div>
|
||||||
|
<div class="range-block-range-and-counter">
|
||||||
|
<div class="range-block-range">
|
||||||
|
<input type="range" id="font_scale" name="font_scale" min="0.8" max="1.2" step="0.05">
|
||||||
|
</div>
|
||||||
|
<div class="range-block-counter">
|
||||||
|
<div contenteditable="true" data-for="font_scale" id="font_scale_counter">
|
||||||
|
select
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="blur-strength-block" class="range-block">
|
||||||
|
<div class="range-block-title">
|
||||||
|
Blur Strength
|
||||||
|
</div>
|
||||||
|
<div class="range-block-range-and-counter">
|
||||||
|
<div class="range-block-range">
|
||||||
|
<input type="range" id="blur_strength" name="blur_strength" min="0" max="30" step="1">
|
||||||
|
</div>
|
||||||
|
<div class="range-block-counter">
|
||||||
|
<div contenteditable="true" data-for="blur_strength" id="blur_strength_counter">
|
||||||
|
select
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="shadow-width-block" class="range-block">
|
||||||
|
<div class="range-block-title">
|
||||||
|
Text Shadow Width
|
||||||
|
</div>
|
||||||
|
<div class="range-block-range-and-counter">
|
||||||
|
<div class="range-block-range">
|
||||||
|
<input type="range" id="shadow_width" name="shadow_width" min="0" max="5" step="1">
|
||||||
|
</div>
|
||||||
|
<div class="range-block-counter">
|
||||||
|
<div contenteditable="true" data-for="shadow_width" id="shadow_width_counter">
|
||||||
|
select
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="UI-presets-block" class="flex-container flexFlowColumn">
|
<div id="UI-presets-block" class="flex-container flexFlowColumn">
|
||||||
<h4>
|
<h4>
|
||||||
UI Theme Preset
|
UI Theme Preset
|
||||||
|
@ -106,6 +106,8 @@ let power_user = {
|
|||||||
send_on_enter: send_on_enter_options.AUTO,
|
send_on_enter: send_on_enter_options.AUTO,
|
||||||
render_formulas: false,
|
render_formulas: false,
|
||||||
allow_name2_display: false,
|
allow_name2_display: false,
|
||||||
|
hotswap_enabled: true,
|
||||||
|
timer_enabled: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
let themes = [];
|
let themes = [];
|
||||||
@ -129,6 +131,9 @@ const storage_keys = {
|
|||||||
waifuMode: "TavernAI_waifuMode",
|
waifuMode: "TavernAI_waifuMode",
|
||||||
movingUI: "TavernAI_movingUI",
|
movingUI: "TavernAI_movingUI",
|
||||||
noShadows: "TavernAI_noShadows",
|
noShadows: "TavernAI_noShadows",
|
||||||
|
|
||||||
|
hotswap_enabled: 'HotswapEnabled',
|
||||||
|
timer_enabled: 'TimerEnabled',
|
||||||
};
|
};
|
||||||
|
|
||||||
let browser_has_focus = true;
|
let browser_has_focus = true;
|
||||||
@ -185,6 +190,18 @@ function fixMarkdown(text) {
|
|||||||
return newText;
|
return newText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function switchHotswap() {
|
||||||
|
const value = localStorage.getItem(storage_keys.hotswap_enabled);
|
||||||
|
power_user.hotswap_enabled = value === null ? true : value == "true";
|
||||||
|
$("body").toggleClass("no-hotswap", !power_user.hotswap_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchTimer() {
|
||||||
|
const value = localStorage.getItem(storage_keys.timer_enabled);
|
||||||
|
power_user.timer_enabled = value === null ? true : value == "true";
|
||||||
|
$("body").toggleClass("no-timer", !power_user.timer_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
function switchUiMode() {
|
function switchUiMode() {
|
||||||
const fastUi = localStorage.getItem(storage_keys.fast_ui_mode);
|
const fastUi = localStorage.getItem(storage_keys.fast_ui_mode);
|
||||||
power_user.fast_ui_mode = fastUi === null ? true : fastUi == "true";
|
power_user.fast_ui_mode = fastUi === null ? true : fastUi == "true";
|
||||||
@ -327,6 +344,8 @@ applyChatDisplay();
|
|||||||
switchWaifuMode()
|
switchWaifuMode()
|
||||||
switchMovingUI();
|
switchMovingUI();
|
||||||
noShadows();
|
noShadows();
|
||||||
|
switchHotswap();
|
||||||
|
switchTimer();
|
||||||
|
|
||||||
function loadPowerUserSettings(settings, data) {
|
function loadPowerUserSettings(settings, data) {
|
||||||
// Load from settings.json
|
// Load from settings.json
|
||||||
@ -343,10 +362,14 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
const waifuMode = localStorage.getItem(storage_keys.waifuMode);
|
const waifuMode = localStorage.getItem(storage_keys.waifuMode);
|
||||||
const movingUI = localStorage.getItem(storage_keys.movingUI);
|
const movingUI = localStorage.getItem(storage_keys.movingUI);
|
||||||
const noShadows = localStorage.getItem(storage_keys.noShadows);
|
const noShadows = localStorage.getItem(storage_keys.noShadows);
|
||||||
|
const hotswap = localStorage.getItem(storage_keys.hotswap_enabled);
|
||||||
|
const timer = localStorage.getItem(storage_keys.timer_enabled);
|
||||||
power_user.fast_ui_mode = fastUi === null ? true : fastUi == "true";
|
power_user.fast_ui_mode = fastUi === null ? true : fastUi == "true";
|
||||||
power_user.waifuMode = waifuMode === null ? false : waifuMode == "true";
|
power_user.waifuMode = waifuMode === null ? false : waifuMode == "true";
|
||||||
power_user.movingUI = movingUI === null ? false : movingUI == "true";
|
power_user.movingUI = movingUI === null ? false : movingUI == "true";
|
||||||
power_user.noShadows = noShadows === null ? false : noShadows == "true";
|
power_user.noShadows = noShadows === null ? false : noShadows == "true";
|
||||||
|
power_user.hotswap_enabled = hotswap === null ? true : hotswap == "true";
|
||||||
|
power_user.timer_enabled = timer === null ? true : timer == "true";
|
||||||
power_user.avatar_style = Number(localStorage.getItem(storage_keys.avatar_style) ?? avatar_styles.ROUND);
|
power_user.avatar_style = Number(localStorage.getItem(storage_keys.avatar_style) ?? avatar_styles.ROUND);
|
||||||
power_user.chat_display = Number(localStorage.getItem(storage_keys.chat_display) ?? chat_styles.DEFAULT);
|
power_user.chat_display = Number(localStorage.getItem(storage_keys.chat_display) ?? chat_styles.DEFAULT);
|
||||||
power_user.sheld_width = Number(localStorage.getItem(storage_keys.sheld_width) ?? sheld_width.DEFAULT);
|
power_user.sheld_width = Number(localStorage.getItem(storage_keys.sheld_width) ?? sheld_width.DEFAULT);
|
||||||
@ -379,6 +402,8 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
$("#play_sound_unfocused").prop("checked", power_user.play_sound_unfocused);
|
$("#play_sound_unfocused").prop("checked", power_user.play_sound_unfocused);
|
||||||
$("#auto_save_msg_edits").prop("checked", power_user.auto_save_msg_edits);
|
$("#auto_save_msg_edits").prop("checked", power_user.auto_save_msg_edits);
|
||||||
$("#allow_name2_display").prop("checked", power_user.allow_name2_display);
|
$("#allow_name2_display").prop("checked", power_user.allow_name2_display);
|
||||||
|
$("#hotswapEnabled").prop("checked", power_user.hotswap_enabled);
|
||||||
|
$("#messageTimerEnabled").prop("checked", power_user.timer_enabled);
|
||||||
$(`input[name="avatar_style"][value="${power_user.avatar_style}"]`).prop("checked", true);
|
$(`input[name="avatar_style"][value="${power_user.avatar_style}"]`).prop("checked", true);
|
||||||
$(`input[name="chat_display"][value="${power_user.chat_display}"]`).prop("checked", true);
|
$(`input[name="chat_display"][value="${power_user.chat_display}"]`).prop("checked", true);
|
||||||
$(`input[name="sheld_width"][value="${power_user.sheld_width}"]`).prop("checked", true);
|
$(`input[name="sheld_width"][value="${power_user.sheld_width}"]`).prop("checked", true);
|
||||||
@ -793,6 +818,20 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#messageTimerEnabled").on("input", function () {
|
||||||
|
const value = !!$(this).prop('checked');
|
||||||
|
power_user.timer_enabled = value;
|
||||||
|
localStorage.setItem(storage_keys.timer_enabled, power_user.timer_enabled);
|
||||||
|
switchTimer();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#hotswapEnabled").on("input", function () {
|
||||||
|
const value = !!$(this).prop('checked');
|
||||||
|
power_user.hotswap_enabled = value;
|
||||||
|
localStorage.setItem(storage_keys.hotswap_enabled, power_user.hotswap_enabled);
|
||||||
|
switchHotswap();
|
||||||
|
});
|
||||||
|
|
||||||
$(window).on('focus', function () {
|
$(window).on('focus', function () {
|
||||||
browser_has_focus = true;
|
browser_has_focus = true;
|
||||||
});
|
});
|
||||||
|
@ -634,6 +634,14 @@ code {
|
|||||||
box-shadow: 0 0 5px var(--black50a);
|
box-shadow: 0 0 5px var(--black50a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.no-hotswap .hotswap {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.no-timer .mes_timer {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
body.big-avatars .avatar {
|
body.big-avatars .avatar {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 90px;
|
height: 90px;
|
||||||
|
Reference in New Issue
Block a user