diff --git a/public/index.html b/public/index.html index b6ae3eb29..99dd6a030 100644 --- a/public/index.html +++ b/public/index.html @@ -4184,7 +4184,7 @@ - Swipe # for All Messages + Swipe # for All Messages diff --git a/public/script.js b/public/script.js index 5ebc7592e..18e8e7f16 100644 --- a/public/script.js +++ b/public/script.js @@ -98,7 +98,6 @@ import { resetMovableStyles, forceCharacterEditorTokenize, applyPowerUserSettings, - switchSwipeNumAllMessages, } from './scripts/power-user.js'; import { @@ -7664,14 +7663,12 @@ export function showSwipeButtons() { //allows for writing individual swipe counters for past messages const lastSwipeCounter = $('.last_mes .swipes-counter'); lastSwipeCounter.text(swipeCounterText).show(); - - switchSwipeNumAllMessages(); } export function hideSwipeButtons() { - $('#chat').find('.swipe_right').hide(); - $('#chat').find('.last_mes .swipes-counter').hide(); - $('#chat').find('.swipe_left').hide(); + chatElement.find('.swipe_right').hide(); + chatElement.find('.last_mes .swipes-counter').hide(); + chatElement.find('.swipe_left').hide(); } /** diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index b175860c8..7a302f392 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -60,7 +60,6 @@ import { ToolManager } from '../../tool-calling.js'; export { MODULE_NAME }; const MODULE_NAME = 'sd'; -const UPDATE_INTERVAL = 1000; // This is a 1x1 transparent PNG const PNG_PIXEL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='; const CUSTOM_STOP_EVENT = 'sd_stop_generation'; @@ -3687,8 +3686,6 @@ async function addSDGenButtons() { const button = $('#sd_gen'); const dropdown = $('#sd_dropdown'); dropdown.hide(); - button.hide(); - messageButton.hide(); let popper = Popper.createPopper(button.get(0), dropdown.get(0), { placement: 'top', @@ -3770,18 +3767,6 @@ function isValidState() { } } -async function moduleWorker() { - if (isValidState()) { - $('#sd_gen').show(); - $('.sd_message_gen').show(); - } - else { - $('#sd_gen').hide(); - $('.sd_message_gen').hide(); - } -} - -setInterval(moduleWorker, UPDATE_INTERVAL); let buttonAbortController = null; async function sdMessageButton(e) { diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index e27a90fbc..a2ee59e15 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -472,9 +472,9 @@ function switchCompactInputArea() { $('#compact_input_area').prop('checked', power_user.compact_input_area); } -export function switchSwipeNumAllMessages() { +function switchSwipeNumAllMessages() { $('#show_swipe_num_all_messages').prop('checked', power_user.show_swipe_num_all_messages); - $('.mes:not(.last_mes) .swipes-counter').css('opacity', '').toggle(power_user.show_swipe_num_all_messages); + $('body').toggleClass('swipeAllMessages', !!power_user.show_swipe_num_all_messages); } var originalSliderValues = []; diff --git a/public/style.css b/public/style.css index 69ff17b49..6f935ec4c 100644 --- a/public/style.css +++ b/public/style.css @@ -1040,8 +1040,14 @@ body .panelControlBar { height: var(--swipeCounterHeight); } -.mes:not(.last_mes) .swipes-counter { - opacity: 0.3; +body:not(.swipeAllMessages) .mes:not(.last_mes) .swipes-counter { + visibility: hidden; +} + +body.swipeAllMessages .mes:not(.last_mes) .swipes-counter { + /* Avoid expensive DOM queries */ + opacity: 0.3 !important; + display: flex !important; } .swipe_left {