Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions GelbooruImageViewer.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,8 @@ Main = {
switch(site.name) {
case "gelbooru":
Main.r[0] = /<a href="?([^">]+)"?[^>]*>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 alt="img" src="([^"]+)/i;
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -1047,7 +1047,11 @@ Main = {
img.setAttribute("src", img.getAttribute(`data-${key}`));
img.removeAttribute(`data-${key}`);
}
const span = el.firstElementChild;
const span = $.c('span')
const span_id = 's' + el.firstElementChild.id.slice(1)
span.appendChild(el.firstElementChild);
span.classList.add("thumb");
span.id = span_id;
el.parentNode.replaceChild(span, el);
return span;
},
Expand Down Expand Up @@ -1090,6 +1094,7 @@ Main = {
if (slideshow) Btn.cb();
slideshow = !(a = $.current());
Main.el = $.rm(Main.el);
if (site.gelbooru) $("#container").style.display = "";
d.body.classList.remove("sliding");
a.classList.add("outlined");
$.off("mousemove", $.zoom);
Expand All @@ -1114,6 +1119,7 @@ Main = {
_on: e => 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]");
Expand All @@ -1132,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;
Expand Down