From 9903e85a66315c16e6f88ea1bb04a8c1d6ea7c18 Mon Sep 17 00:00:00 2001 From: BlipRanger <1860540+BlipRanger@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:03:49 -0400 Subject: [PATCH 01/11] Add random slash command --- public/script.js | 1 + public/scripts/power-user.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/public/script.js b/public/script.js index a473c1301..2a23757a9 100644 --- a/public/script.js +++ b/public/script.js @@ -172,6 +172,7 @@ export { select_rm_info, setCharacterId, setCharacterName, + replaceCurrentChat, setOnlineStatus, checkOnlineStatus, setEditedMessageId, diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index d6de47d9b..11688cc6f 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -14,6 +14,8 @@ import { getCurrentChatId, name1, name2, + replaceCurrentChat, + setCharacterId } from "../script.js"; import { favsToHotswap } from "./RossAscends-mods.js"; import { @@ -929,6 +931,14 @@ function doNewChat() { }, 1); } +function doRandomChat() { + setCharacterId(Math.floor(Math.random() * characters.length)); + setTimeout(() => { + replaceCurrentChat(); + }, 1); + +} + function doDelMode() { setTimeout(() => { $("#option_delete_mes").trigger('click') @@ -1326,5 +1336,6 @@ $(document).ready(() => { registerSlashCommand('vn', toggleWaifu, ['vn'], ' – swaps Visual Novel Mode On/Off', false, true); registerSlashCommand('newchat', doNewChat, ['newchat'], ' – start a new chat with current character', true, true); + registerSlashCommand('random', doRandomChat, ['random'], ' – start a new chat with a random character', true, true); registerSlashCommand('delmode', doDelMode, ['delmode'], ' – enter message deletion mode', true, true); }); From 2f2f88dedd44e4efe767b5bd53d281492297018b Mon Sep 17 00:00:00 2001 From: kingbri Date: Tue, 27 Jun 2023 21:01:12 -0400 Subject: [PATCH 02/11] World Info: Fix array splice method Character lore layers used array.splice() in the wrong way. Somehow this passed my testing through sheer luck. Rewrite for using indicies to splice and for more efficiency with iteration. Signed-off-by: kingbri --- public/script.js | 15 +++++++-------- public/scripts/world-info.js | 18 ++++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/public/script.js b/public/script.js index a160d723b..4665ab038 100644 --- a/public/script.js +++ b/public/script.js @@ -5543,21 +5543,20 @@ function openCharacterWorldPopup() { const fileName = getCharaFilename(chid); const tempExtraBooks = selectedWorlds.map((index) => world_names[index]).filter((e) => e !== undefined); - const existingCharLore = charLore.find((e) => e.name === fileName); - if (existingCharLore) { - if (tempExtraBooks.length === 0) { - charLore.splice(existingCharLore, 1); - } else { - existingCharLore.extraBooks = tempExtraBooks; - } - } else { + const existingCharIndex = charLore.findIndex((e) => e.name === fileName); + if (existingCharIndex === -1) { const newCharLoreEntry = { name: fileName, extraBooks: tempExtraBooks } charLore.push(newCharLoreEntry); + } else if (tempExtraBooks.length === 0) { + charLore.splice(existingCharIndex, 1); + } else { + charLore[existingCharIndex].extraBooks = tempExtraBooks; } + Object.assign(world_info, { charLore: charLore }); saveSettingsDebounced(); } diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 81df9197f..c292127e8 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -250,16 +250,18 @@ function displayWorldEntries(name, data) { return; } - const existingCharLores = world_info.charLore?.filter((e) => e.extraBooks.includes(name)); - if (existingCharLores && existingCharLores.length > 0) { - existingCharLores.forEach((charLore) => { - const tempCharLore = charLore.extraBooks.filter((e) => e !== name); - if (tempCharLore.length === 0) { - world_info.charLore.splice(charLore, 1); - } else { - charLore.extraBooks = tempCharLore; + if (world_info.charLore) { + world_info.charLore.forEach((charLore, index) => { + if (charLore.extraBooks?.includes(name)) { + const tempCharLore = charLore.extraBooks.filter((e) => e !== name); + if (tempCharLore.length === 0) { + world_info.charLore.splice(index, 1); + } else { + charLore.extraBooks = tempCharLore; + } } }); + saveSettingsDebounced(); } From 7fe758d69712c0aee997b1f884ba5fc8ffcdbcb6 Mon Sep 17 00:00:00 2001 From: RossAscends <124905043+RossAscends@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:53:36 +0900 Subject: [PATCH 03/11] ( ) skill issue ( ) MovingUI works now. --- public/scripts/RossAscends-mods.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index e82dea0f2..ab5bfaab3 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -481,6 +481,7 @@ export function dragElement(elmnt) { var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; var height, width, top, left; var elmntName = elmnt.attr('id'); + console.debug(`init drag for ${elmntName}`) const elmntNameEscaped = $.escapeSelector(elmntName); const elmntHeader = $(`#${elmntNameEscaped}header`); if (elmntHeader.length) { @@ -498,10 +499,13 @@ export function dragElement(elmnt) { || Number((String(target.height).replace('px', ''))) < 50 || Number((String(target.width).replace('px', ''))) < 50 || isMobile() === true - ) { return } + ) { + console.debug('aborting mutator') + return + } const style = getComputedStyle(target); - console.log(style.top, style.left) + //console.log(style.top, style.left) height = target.offsetHeight; width = target.offsetWidth; top = parseInt(style.top); @@ -514,6 +518,7 @@ export function dragElement(elmnt) { left=${left}`); */ if (!power_user.movingUIState[elmntName]) { + console.debug(`adding config property for ${elmntName}`) power_user.movingUIState[elmntName] = {}; } @@ -525,12 +530,13 @@ export function dragElement(elmnt) { power_user.movingUIState[elmntName].bottom = 'unset'; power_user.movingUIState[elmntName].margin = 'unset'; saveSettingsDebounced(); - saveSettingsDebounced(); + // Check if the element header exists and set the listener on the grabber if (elmntHeader.length) { elmntHeader.off('mousedown').on('mousedown', (e) => { + console.debug('listener started from header') dragMouseDown(e); }); } else { @@ -541,6 +547,7 @@ export function dragElement(elmnt) { observer.observe(elmnt.get(0), { attributes: true, attributeFilter: ['style'] }); function dragMouseDown(e) { + if (e) { e.preventDefault(); pos3 = e.clientX; //mouse X at click @@ -615,6 +622,7 @@ export function dragElement(elmnt) { } function closeDragElement() { + console.debug('drag finished') $(document).off('mouseup', closeDragElement); $(document).off('mousemove', elementDrag); $("body").css("overflow", ""); @@ -630,7 +638,9 @@ $("document").ready(function () { // initial status check setTimeout(() => { - if (isMobile === false) { + + if (isMobile() === false) { + console.debug('START MOVING UI') dragElement($("#sheld")); dragElement($("#left-nav-panel")); dragElement($("#right-nav-panel")); From a0814defff1c2558f4418c2738cb1d22c3562331 Mon Sep 17 00:00:00 2001 From: Cohee Date: Wed, 28 Jun 2023 10:51:14 +0300 Subject: [PATCH 04/11] Fix select2 noblur background --- public/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/style.css b/public/style.css index 1842738a1..28bcc604b 100644 --- a/public/style.css +++ b/public/style.css @@ -4249,7 +4249,8 @@ body.no-blur #character_popup, body.no-blur #world_popup, body.no-blur #dialogue_popup, body.no-blur #select_chat_popup, -body.no-blur .drawer-content { +body.no-blur .drawer-content, +body.no-blur .select2-results__options { background-color: black !important; } From 1d8ecacd8b0a8717c76c8bec11f6817801353fe6 Mon Sep 17 00:00:00 2001 From: Cohee Date: Wed, 28 Jun 2023 11:01:27 +0300 Subject: [PATCH 05/11] Update Horde documentation link --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index c94bcdbc9..cc7c6c253 100644 --- a/public/index.html +++ b/public/index.html @@ -1353,7 +1353,7 @@ You can select multiple models.
Avoid sending - sensitive information to the Horde. Learn more
+ sensitive information to the Horde. Learn more From 914282faf0bf005f72a6732c825b0524190678b7 Mon Sep 17 00:00:00 2001 From: Cohee Date: Wed, 28 Jun 2023 11:02:54 +0300 Subject: [PATCH 06/11] Remove spammy logs --- server.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/server.js b/server.js index 4cdb98a30..7d38187fc 100644 --- a/server.js +++ b/server.js @@ -822,7 +822,6 @@ function charaFormatData(data) { // This is supposed to save all the foreign keys that ST doesn't care about const _ = require('lodash'); const char = tryParse(data.json_data) || {}; - console.log(data.tags); // This function uses _.cond() to create a series of conditional checks that return the desired output based on the input data. // It checks if data.alternate_greetings is an array, a string, or neither, and acts accordingly. @@ -1865,7 +1864,6 @@ app.post("/importcharacter", urlencodedParser, async function (request, response charaWrite(uploadPath, char, png_name, response, { file_name: png_name }); } else if (jsonData.name !== undefined) { console.log('Found a v1 character file.'); - console.log(jsonData); let char = { "name": jsonData.name, "description": jsonData.description ?? '', From 7bec130bf7aef5ff89a2f60d8f4139b94c86da61 Mon Sep 17 00:00:00 2001 From: Cohee Date: Wed, 28 Jun 2023 11:06:57 +0300 Subject: [PATCH 07/11] Fix focused select border --- public/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/style.css b/public/style.css index 28bcc604b..141a9b398 100644 --- a/public/style.css +++ b/public/style.css @@ -4870,6 +4870,10 @@ body.waifuMode .zoomed_avatar { padding: 3px 5px; } +.select2-container.select2-container--focus .select2-selection--multiple { + border: 1px solid var(--white30a); +} + .select2-container .select2-selection--multiple .select2-selection__choice { border-radius: 5px; border-style: solid; From ebf51f3a172cf35b7316f319c243a90eba3ebb21 Mon Sep 17 00:00:00 2001 From: Cohee Date: Wed, 28 Jun 2023 11:15:38 +0300 Subject: [PATCH 08/11] Fix select2 selection remove style --- public/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/style.css b/public/style.css index 141a9b398..97a02127e 100644 --- a/public/style.css +++ b/public/style.css @@ -4922,6 +4922,10 @@ body.waifuMode .zoomed_avatar { border-radius: 2px; } +.select2-container .select2-selection--multiple .select2-selection__choice__remove { + color: var(--SmartThemeBodyColor); +} + /* Add the custom checkbox checkmark */ .select2-results__option--selected.select2-results__option:before { content: '\2713'; From 4a9d9b69e91f160b6e9116b575e08ed5963aa912 Mon Sep 17 00:00:00 2001 From: Cohee Date: Wed, 28 Jun 2023 11:19:50 +0300 Subject: [PATCH 09/11] Fix random chat slash breaking in groups --- public/scripts/power-user.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 3d4aa6f39..81c21361a 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -21,6 +21,7 @@ import { import { favsToHotswap, isMobile } from "./RossAscends-mods.js"; import { groups, + resetSelectedGroup, selected_group, } from "./group-chats.js"; @@ -994,6 +995,7 @@ function doNewChat() { } function doRandomChat() { + resetSelectedGroup(); setCharacterId(Math.floor(Math.random() * characters.length)); setTimeout(() => { replaceCurrentChat(); From d66542e88e5f2345948efbacb57cf83263dfae85 Mon Sep 17 00:00:00 2001 From: RossAscends <124905043+RossAscends@users.noreply.github.com> Date: Wed, 28 Jun 2023 20:40:29 +0900 Subject: [PATCH 10/11] fix: MovingUI breaking, typos, WI selector scroll --- public/index.html | 4 +- public/script.js | 12 ++-- public/scripts/RossAscends-mods.js | 96 ++++++++++++++++++++---------- public/scripts/power-user.js | 50 +++++++++------- public/scripts/world-info.js | 19 +++++- public/style.css | 5 +- 6 files changed, 124 insertions(+), 62 deletions(-) diff --git a/public/index.html b/public/index.html index c94bcdbc9..fb5754c9e 100644 --- a/public/index.html +++ b/public/index.html @@ -2773,7 +2773,7 @@
-

Creators's Tags

+

Creator's Tags

@@ -3455,4 +3455,4 @@ - + \ No newline at end of file diff --git a/public/script.js b/public/script.js index 0b8d68fe5..71bf545ae 100644 --- a/public/script.js +++ b/public/script.js @@ -7697,7 +7697,7 @@ $(document).ready(function () { eventSource.emit(event_types.GENERATION_STOPPED); }); - $('.drawer-toggle').click(function () { + $('.drawer-toggle').on('click', function () { var icon = $(this).find('.drawer-icon'); var drawer = $(this).parent().find('.drawer-content'); if (drawer.hasClass('resizing')) { return } @@ -7734,7 +7734,7 @@ $(document).ready(function () { } - } else if (drawerWasOpenAlready) { //to close + } else if (drawerWasOpenAlready) { //to close manually icon.toggleClass('closedIcon openIcon'); if (pinnedDrawerClicked) { @@ -7780,7 +7780,9 @@ $(document).ready(function () { if (jQuery.find('.openDrawer').length !== 0) { if (targetParentHasOpenDrawer === 0) { //console.log($('.openDrawer').not('.pinnedOpen').length); - $('.openDrawer').not('.pinnedOpen').slideToggle(200, "swing"); + $('.openDrawer').not('.pinnedOpen').addClass('resizing').slideToggle(200, "swing", function () { + $(this).closest('.drawer-content').removeClass('resizing') + }); $('.openIcon').toggleClass('closedIcon openIcon'); $('.openDrawer').not('.pinnedOpen').toggleClass('closedDrawer openDrawer'); @@ -7974,8 +7976,8 @@ $(document).ready(function () { const html = `

Enter the URL of the content to import

Supported sources:
    -
  • Chub characters (direct link or id)
    Example: lorebooks/bartleby/example-lorebook
  • -
  • Chub lorebooks (direct link or id)
    Example: Anonymous/example-character
  • +
  • Chub characters (direct link or id)
    Example: Anonymous/example-character
  • +
  • Chub lorebooks (direct link or id)
    Example: lorebooks/bartleby/example-lorebook
  • More coming soon...
    • ` const input = await callPopup(html, 'input'); diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index ab5bfaab3..6a0fa2509 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -27,7 +27,7 @@ import { SECRET_KEYS, secret_state, } from "./secrets.js"; -import { sortByCssOrder, debounce } from "./utils.js"; +import { sortByCssOrder, debounce, delay } from "./utils.js"; import { chat_completion_sources, oai_settings } from "./openai.js"; var NavToggle = document.getElementById("nav-toggle"); @@ -479,13 +479,30 @@ function OpenNavPanels() { export function dragElement(elmnt) { var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; - var height, width, top, left; + var height, width, top, left, right, bottom; + + var oldTop = Number((String($(elmnt).css('top')).replace('px', ''))) + var oldLeft = Number((String($(elmnt).css('left')).replace('px', ''))) + var oldWidth = Number((String($(elmnt).css('width')).replace('px', ''))) + var oldHeight = Number((String($(elmnt).css('width')).replace('px', ''))) + var oldRight = Number((String($(elmnt).css('right')).replace('px', ''))) + var oldBottom = Number((String($(elmnt).css('bottom')).replace('px', ''))) var elmntName = elmnt.attr('id'); - console.debug(`init drag for ${elmntName}`) + console.debug(`${elmntName} init state: +T: ${$(elmnt).css('top')} +L: ${$(elmnt).css('left')} +W: ${$(elmnt).css('width')} +H: ${$(elmnt).css('height')} +R: ${$(elmnt).css('right')} +B: ${$(elmnt).css('bottom')} +---`); + + const elmntNameEscaped = $.escapeSelector(elmntName); const elmntHeader = $(`#${elmntNameEscaped}header`); if (elmntHeader.length) { elmntHeader.off('mousedown').on('mousedown', (e) => { + dragMouseDown(e); }); } else { @@ -498,6 +515,7 @@ export function dragElement(elmnt) { || $(target).hasClass('resizing') || Number((String(target.height).replace('px', ''))) < 50 || Number((String(target.width).replace('px', ''))) < 50 + || power_user.movingUI === false || isMobile() === true ) { console.debug('aborting mutator') @@ -510,12 +528,8 @@ export function dragElement(elmnt) { width = target.offsetWidth; top = parseInt(style.top); left = parseInt(style.left); - - /* console.log(` - height=${height}, - width=${width}, - top=${top}, - left=${left}`); */ + right = parseInt(style.right); + bottom = parseInt(style.bottom); if (!power_user.movingUIState[elmntName]) { console.debug(`adding config property for ${elmntName}`) @@ -524,11 +538,32 @@ export function dragElement(elmnt) { power_user.movingUIState[elmntName].top = top; power_user.movingUIState[elmntName].left = left; - power_user.movingUIState[elmntName].width = width; - power_user.movingUIState[elmntName].height = height; - power_user.movingUIState[elmntName].right = 'unset'; - power_user.movingUIState[elmntName].bottom = 'unset'; - power_user.movingUIState[elmntName].margin = 'unset'; + + if (!isNaN(oldWidth) + && !isNaN(oldHeight) + && (oldHeight !== height || oldWidth !== width)) { + power_user.movingUIState[elmntName].width = width; + power_user.movingUIState[elmntName].height = height; + } else { + console.debug('skipping W/H setting') + } + power_user.movingUIState[elmntName].right = right; + power_user.movingUIState[elmntName].bottom = bottom; + if (!isNaN(oldTop) && !isNaN(oldLeft) && (oldTop !== top || oldLeft !== left)) { + console.debug('unsetting margin due to custom position') + console.debug(`${elmntName}: +T: ${oldTop}>>${top} +L: ${oldLeft}>> ${left} +H: ${oldHeight} >> ${height} +W: ${oldWidth}>> ${width} +R: ${oldRight} >> ${right} +B: ${oldBottom}>> ${bottom} +---`) + power_user.movingUIState[elmntName].margin = 'unset'; + } else { + console.log('skipped unsetting margins') + console.log(oldTop, top, oldLeft, left) + } saveSettingsDebounced(); @@ -632,29 +667,28 @@ export function dragElement(elmnt) { } } +export async function initMovingUI() { + if (isMobile() === false && power_user.movingUI === true) { + console.debug('START MOVING UI') + dragElement($("#sheld")); + dragElement($("#left-nav-panel")); + dragElement($("#right-nav-panel")); + dragElement($("#WorldInfo")); + await delay(1000) + console.debug('loading AN draggable function') + dragElement($("#floatingPrompt")) + + } +} + // --------------------------------------------------- $("document").ready(function () { // initial status check setTimeout(() => { - - if (isMobile() === false) { - console.debug('START MOVING UI') - dragElement($("#sheld")); - dragElement($("#left-nav-panel")); - dragElement($("#right-nav-panel")); - dragElement($("#WorldInfo")); - dragElement($("#floatingPrompt")); - } - RA_checkOnlineStatus - } - , 100); - - - - - //$('div').on('resize', saveMovingUIState()); + RA_checkOnlineStatus(); + }, 100); // read the state of AutoConnect and AutoLoadChat. $(AutoConnectCheckbox).prop("checked", LoadLocalBool("AutoConnectEnabled")); diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 3d4aa6f39..f99f746fb 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -18,7 +18,7 @@ import { replaceCurrentChat, setCharacterId } from "../script.js"; -import { favsToHotswap, isMobile } from "./RossAscends-mods.js"; +import { favsToHotswap, isMobile, initMovingUI } from "./RossAscends-mods.js"; import { groups, selected_group, @@ -310,7 +310,13 @@ function switchMovingUI() { const movingUI = localStorage.getItem(storage_keys.movingUI); power_user.movingUI = movingUI === null ? false : movingUI == "true"; $("body").toggleClass("movingUI", power_user.movingUI); - scrollChatToBottom(); + if (power_user.movingUI === true) { + initMovingUI() + if (power_user.movingUIState) { + loadMovingUIState(); + } + }; + //scrollChatToBottom(); } function noShadows() { @@ -649,7 +655,10 @@ function loadPowerUserSettings(settings, data) { } function loadMovingUIState() { - if (isMobile() === false && power_user.movingUIState) { + if (isMobile() === false + && power_user.movingUIState + && power_user.movingUI === true) { + console.debug('loading movingUI state') for (var elmntName of Object.keys(power_user.movingUIState)) { var elmntState = power_user.movingUIState[elmntName]; try { @@ -665,7 +674,7 @@ function loadMovingUIState() { } } } else { - console.debug('skipping movingUI state load for mobile') + console.debug('skipping movingUI state load') return } } @@ -940,6 +949,22 @@ function resetMovablePanels() { document.getElementById("right-nav-panel").style.width = ''; document.getElementById("right-nav-panel").style.margin = ''; + document.getElementById("WorldInfo").style.top = ''; + document.getElementById("WorldInfo").style.left = ''; + document.getElementById("WorldInfo").style.right = ''; + document.getElementById("WorldInfo").style.bottom = ''; + document.getElementById("WorldInfo").style.height = ''; + document.getElementById("WorldInfo").style.width = ''; + document.getElementById("WorldInfo").style.margin = ''; + + document.getElementById("floatingPrompt").style.top = ''; + document.getElementById("floatingPrompt").style.left = ''; + document.getElementById("floatingPrompt").style.right = ''; + document.getElementById("floatingPrompt").style.bottom = ''; + document.getElementById("floatingPrompt").style.height = ''; + document.getElementById("floatingPrompt").style.width = ''; + document.getElementById("floatingPrompt").style.margin = ''; + if ($("#expression-holder")) { document.getElementById("expression-holder").style.top = ''; document.getElementById("expression-holder").style.left = ''; @@ -960,23 +985,6 @@ function resetMovablePanels() { $(".zoomed_avatar").css('margin', ''); } - - document.getElementById("WorldInfo").style.top = ''; - document.getElementById("WorldInfo").style.left = ''; - document.getElementById("WorldInfo").style.right = ''; - document.getElementById("WorldInfo").style.bottom = ''; - document.getElementById("WorldInfo").style.height = ''; - document.getElementById("WorldInfo").style.width = ''; - document.getElementById("WorldInfo").style.margin = ''; - - document.getElementById("floatingPrompt").style.top = ''; - document.getElementById("floatingPrompt").style.left = ''; - document.getElementById("floatingPrompt").style.right = ''; - document.getElementById("floatingPrompt").style.bottom = ''; - document.getElementById("floatingPrompt").style.height = ''; - document.getElementById("floatingPrompt").style.width = ''; - document.getElementById("floatingPrompt").style.margin = ''; - $('*[data-dragged="true"]').removeAttr('data-dragged'); power_user.movingUIState = {} saveSettingsDebounced(); diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index c292127e8..90218cd17 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1370,4 +1370,21 @@ jQuery(() => { } } }); -}); + + $("#world_info").on('mousewheel', function (e) { + e.preventDefault(); + if ($(this).is(':animated')) { + return; //dont force multiple scroll animations + } + var wheelDelta = e.originalEvent.wheelDelta.toFixed(0); + var DeltaPosNeg = (wheelDelta >= 0) ? 1 : -1; //determine if scrolling up or down + var containerHeight = $(this).height().toFixed(0); + var optionHeight = $(this).find('option').first().height().toFixed(0); + var visibleOptions = (containerHeight / optionHeight).toFixed(0); //how many options we can see + var pixelsToScroll = (optionHeight * visibleOptions * DeltaPosNeg).toFixed(0); //scroll a full container height + var scrollTop = ($(this).scrollTop() - pixelsToScroll).toFixed(0); + + $(this).animate({ scrollTop: scrollTop }, 200); + }); + +}) diff --git a/public/style.css b/public/style.css index 1842738a1..37985cc40 100644 --- a/public/style.css +++ b/public/style.css @@ -3874,9 +3874,10 @@ label[for="extensions_autoconnect"] { max-height: calc(100svh - 70px); display: none; position: absolute; + top: 41px; left: 0; right: 0; - margin: 35px auto 0 auto; + margin: 0 auto; backdrop-filter: blur(calc(var(--SmartThemeBlurStrength))); -webkit-backdrop-filter: blur(calc(var(--SmartThemeBlurStrength))); z-index: 9999 !important; @@ -4925,4 +4926,4 @@ body.waifuMode .zoomed_avatar { background-color: var(--SmartThemeBlurTintColor); text-align: center; line-height: 14px; -} +} \ No newline at end of file From a1eb2b794e08fb3732f6fd16158b617f6366dec0 Mon Sep 17 00:00:00 2001 From: Cohee1207 Date: Wed, 28 Jun 2023 15:48:12 +0300 Subject: [PATCH 11/11] Rearrange Horde blocks --- public/index.html | 8 +++++--- public/scripts/horde.js | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 2ab1e8c86..c3bdb114d 100644 --- a/public/index.html +++ b/public/index.html @@ -1308,6 +1308,10 @@
        +
      • + Avoid sending sensitive information to the Horde. + Review the Privacy statement +
      • Register a Horde account for faster queue times @@ -1347,13 +1351,11 @@
        For privacy reasons, your API key will be hidden after you reload the page.

        - Model + Models

        - You can select multiple models.
        Avoid sending - sensitive information to the Horde. Learn more
        diff --git a/public/scripts/horde.js b/public/scripts/horde.js index 51fcd9c4b..061b1c640 100644 --- a/public/scripts/horde.js +++ b/public/scripts/horde.js @@ -271,6 +271,14 @@ jQuery(function () { placeholder: 'Select Horde models', allowClear: true, closeOnSelect: false, + templateSelection: function(data) { + // Customize the pillbox text by shortening the full text + return data.id; + }, + templateResult: function(data) { + // Return the full text for the dropdown + return data.text; + }, }); } })