From c2fba39cc7a875dee2d4e6b2f18be3638bff26a1 Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Fri, 17 Feb 2023 23:26:17 -0800 Subject: [PATCH 1/5] Select but don't empty the search box upon selection As per your request. --- ui/media/js/searchable-models.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/media/js/searchable-models.js b/ui/media/js/searchable-models.js index c9cf3ea9..70f1559b 100644 --- a/ui/media/js/searchable-models.js +++ b/ui/media/js/searchable-models.js @@ -346,7 +346,8 @@ class ModelDropdown this.modelList.style.display = 'block' this.selectEntry() this.showAllEntries() - this.modelFilter.value = '' + //this.modelFilter.value = '' + this.modelFilter.select() // preselect the entire string so user can just start typing. this.modelFilter.focus() this.modelFilter.style.cursor = 'auto' } From e051dbc2c73b9b4a14110d6a2b3632df9d8feac6 Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Sat, 18 Feb 2023 00:00:00 -0800 Subject: [PATCH 2/5] Fix autoscroll behavior for the first image When the first image is generated, the autoscroll triggers before the image is fully displayed by the browser. This causes it to not be positioned properly. The fix is to listen for the "load" event on the IMG element before triggering the scrolling event. Once the image fully loaded and rendered, the browser correctly detects the size of the viewport and renders properly. --- ui/plugins/ui/Autoscroll.plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/plugins/ui/Autoscroll.plugin.js b/ui/plugins/ui/Autoscroll.plugin.js index 72905c6d..24818ce2 100644 --- a/ui/plugins/ui/Autoscroll.plugin.js +++ b/ui/plugins/ui/Autoscroll.plugin.js @@ -39,7 +39,10 @@ function Autoscroll(target) { if (autoScroll.checked && target !== null) { - target.parentElement.parentElement.parentElement.scrollIntoView(); + const img = target.querySelector('img') + img.addEventListener('load', function() { + img.closest('.imageTaskContainer').scrollIntoView() + }, { once: true }) } } })() From 31a1c4b2b2a3947d636a6e09c48e2f68bfc0d373 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sun, 19 Feb 2023 12:44:10 +0100 Subject: [PATCH 3/5] Download all: Fix file name suffix --- ui/media/js/main.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 2d99e341..17ecaf2a 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1165,12 +1165,10 @@ saveAllImagesBtn.addEventListener('click', (e) => { let req = htmlTaskMap.get(container) container.querySelectorAll(".imgContainer img").forEach(img => { if (img.closest('.imgItem').style.display === 'none') { - // console.log('skipping hidden image', img) return } - onDownloadImageClick(req, img) - // console.log(req) + onDownloadImageClick(req.reqBody, img) }) }) }) From 4df9a22dd6a17a073bd13eea14d4f84090554161 Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Sun, 19 Feb 2023 12:08:06 -0800 Subject: [PATCH 4/5] Fix the centering of sharpness brushes Fixing a visual glitch that becomes visible when a plugin adds borders to the brushes to make them more visible. See this for context; https://discord.com/channels/1014774730907209781/1058857864954904607/1076694770845487155 --- ui/media/js/image-editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/media/js/image-editor.js b/ui/media/js/image-editor.js index bea3b3ec..e6792cbf 100644 --- a/ui/media/js/image-editor.js +++ b/ui/media/js/image-editor.js @@ -244,8 +244,8 @@ var IMAGE_EDITOR_SECTIONS = [ var sub_element = document.createElement("div") sub_element.style.background = `var(--background-color3)` sub_element.style.filter = `blur(${blur_amount}px)` - sub_element.style.width = `${size - 4}px` - sub_element.style.height = `${size - 4}px` + sub_element.style.width = `${size - 2}px` + sub_element.style.height = `${size - 2}px` sub_element.style['border-radius'] = `${size}px` element.style.background = "none" element.appendChild(sub_element) From 41a3309cbe8c1b1c86e11ecf3949ae135cec8016 Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Sun, 19 Feb 2023 15:59:20 -0800 Subject: [PATCH 5/5] Fix the toggling of image modifiers The toggling of image modifiers doesn't get properly applied if weights are changed after restoring the image modifiers. --- ui/plugins/ui/modifiers-toggle.plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/plugins/ui/modifiers-toggle.plugin.js b/ui/plugins/ui/modifiers-toggle.plugin.js index e7416164..14eb5627 100644 --- a/ui/plugins/ui/modifiers-toggle.plugin.js +++ b/ui/plugins/ui/modifiers-toggle.plugin.js @@ -40,7 +40,7 @@ // refresh activeTags let modifierName = i.parentElement.getElementsByClassName('modifier-card-label')[0].getElementsByTagName("p")[0].dataset.fullName activeTags = activeTags.map(obj => { - if (obj.name === modifierName) { + if (trimModifiers(obj.name) === trimModifiers(modifierName)) { return {...obj, inactive: (obj.element.classList.contains('modifier-toggle-inactive'))}; }