prevent interference with text inputs, greasyfork version bump

This commit is contained in:
17ms 2023-03-08 02:09:52 +02:00
parent 8a4c5ea26b
commit aa5082394d

View File

@ -6,7 +6,7 @@
// @namespace Violentmonkey Scripts // @namespace Violentmonkey Scripts
// @match *://boards.4chan*.org/*/thread/* // @match *://boards.4chan*.org/*/thread/*
// @exclude *://boards.4chan*.org/*/catalog // @exclude *://boards.4chan*.org/*/catalog
// @version 1.0 // @version 1.1
// ==/UserScript== // ==/UserScript==
// Shortcuts: decrease size, increase size, previous image, next image, jump to the source hash (i.e. post) // Shortcuts: decrease size, increase size, previous image, next image, jump to the source hash (i.e. post)
@ -110,9 +110,17 @@ const preloadImgs = async () => {
await img.decode() await img.decode()
imgs.push(img) imgs.push(img)
} }
if (imgs.length > 0) {
imgElem.src = imgs[0].src
}
} }
const keyUpEvent = async (e) => { const keyUpEvent = async (e) => {
if (["input", "textarea"].includes(e.target.tagName.toLowerCase())) {
return
}
if (e.key === keys[0]) { if (e.key === keys[0]) {
sizeDown(document.getElementById("drGallery")) sizeDown(document.getElementById("drGallery"))
} else if (e.key === keys[1]) { } else if (e.key === keys[1]) {