From 4a3c97043eec1edc187acf4ca7ffbd308c149813 Mon Sep 17 00:00:00 2001 From: wexavier Date: Wed, 5 Aug 2020 20:26:14 +0300 Subject: [PATCH 1/2] Fix #19 Signed-off-by: wexavier --- GelbooruImageViewer.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GelbooruImageViewer.user.js b/GelbooruImageViewer.user.js index f689333..f3f1c6f 100644 --- a/GelbooruImageViewer.user.js +++ b/GelbooruImageViewer.user.js @@ -945,7 +945,7 @@ Main = { let a, id, alt; if (!(typeof node === "object" && node.nodeType === 1)) return; if (node.tagName === "LI" && String(node.id)[0] === "p" && ~String(node.className).indexOf("creator-id-")) return setTimeout(Main.myImuoto, 0, node); - if (site.gelbooru && node.classList.contains("thumbnail-preview")) node = Main.gelbooruFix(node); + if (site.gelbooru && node.classList.contains("thumbnail-preview") && node.tagName !== "IMG") node = Main.gelbooruFix(node); if (node.matches(Main.sel) && (a = node.firstElementChild) && !a.dataset.full) { alt = $("img[alt]", node); if (!(alt && (alt = alt.title || alt.alt))) @@ -1048,6 +1048,7 @@ Main = { img.removeAttribute(`data-${key}`); } const span = el.firstElementChild; + span.className = "thumb"; el.parentNode.replaceChild(span, el); return span; }, From 79cc56e66cf7e1b913077e03afb73f1f42d4849d Mon Sep 17 00:00:00 2001 From: wexavier Date: Mon, 8 Feb 2021 22:59:15 +0200 Subject: [PATCH 2/2] Fix #19 (2) --- GelbooruImageViewer.user.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/GelbooruImageViewer.user.js b/GelbooruImageViewer.user.js index f3f1c6f..16b70a6 100644 --- a/GelbooruImageViewer.user.js +++ b/GelbooruImageViewer.user.js @@ -891,8 +891,8 @@ Main = { switch(site.name) { case "gelbooru": Main.r[0] = /]+)"?[^>]*>Orig/; - Main.r[1] = /src="?([^">]+)"? id="?image"?[^>]*\/>/; - Main.css += "span.thumb {\n float: left;\n display: inline-block;\n width: 180px;\n height: 180px;\n text-align: center\n}\nspan.thumb + center::before {\n content: '';\n display: block;\n clear: both\n}\n.slideshow hr {\n margin: initial;\nborder: initial;\n height: initial\n}"; + Main.r[1] = /id="?image"?[^>]*\ src="?([^">]+)"?/; + Main.css += "span.thumb {\n float: left;\n display: inline-block;\n width: 180px;\n height: 180px;\n text-align: center\n}\nspan.thumb img {\n max-width: 170px; max-height: 170px;\n}\nspan.thumb + center::before {\n content: '';\n display: block;\n clear: both\n}\n.slideshow hr {\n margin: initial;\nborder: initial;\n height: initial\n}"; break; case "splatoon": case "booru": Main.r[0] = Main.r[1] = /img e.button === 1 && $.keyDown({ keyCode: 38, event: e }), on(a) { if (site.sankakucomplex) uW.Sankaku.Pagination.auto_enabled = false; + if (site.gelbooru) $("#container").style.display = "None"; d.body.classList.add("sliding"); { const arr = $$("a.outlined[data-full]"); @@ -1133,7 +1138,7 @@ Main = { $.on("keyup", $.keyUp); $.on("keydown", $.keyDown); $.on("mousemove", $.zoom); - Pos.fn(); Btn.fn(); $.preload(); + Pos.fn(); Btn.fn(); //$.preload(); }, isGif(match) { return match && match[1] ? match[1].toLowerCase() === "gif" : null;