From 999c1b11057f8a20bf2435b7399b7410e01f3eba Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 21 Oct 2023 20:41:19 +0300 Subject: [PATCH] Hide chat BG titles --- public/scripts/backgrounds.js | 4 +++- public/style.css | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/scripts/backgrounds.js b/public/scripts/backgrounds.js index 1087f43b1..0e3b1cbe4 100644 --- a/public/scripts/backgrounds.js +++ b/public/scripts/backgrounds.js @@ -302,7 +302,9 @@ async function onDeleteBackgroundClick(e) { const autoBgPrompt = `Pause your roleplay and choose a location ONLY from the provided list that is the most suitable for the current scene. Do not output any other text:\n{0}`; async function autoBackgroundCommand() { - const options = Array.from(document.querySelectorAll('.BGSampleTitle')).map(x => ({ element: x, text: x.innerText.trim() })).filter(x => x.text.length > 0); + /** @type {HTMLElement[]} */ + const bgTitles = Array.from(document.querySelectorAll('#bg_menu_content .BGSampleTitle')); + const options = bgTitles.map(x => ({ element: x, text: x.innerText.trim() })).filter(x => x.text.length > 0); if (options.length == 0) { toastr.warning('No backgrounds to choose from. Please upload some images to the "backgrounds" folder.'); return; diff --git a/public/style.css b/public/style.css index 5f4cbcbe7..25731c8cd 100644 --- a/public/style.css +++ b/public/style.css @@ -1565,6 +1565,10 @@ input[type=search]:focus::-webkit-search-cancel-button { font-size: calc(var(--fontScale) * 0.9em); } +.bg_example[custom="true"] .BGSampleTitle { + display: none; +} + .bg_button { width: 15px; height: 15px;