Skip to content

Commit cab78aa

Browse files
committed
Update Picviewer CE+.user.js
1 parent e86055c commit cab78aa

File tree

1 file changed

+56
-37
lines changed

1 file changed

+56
-37
lines changed

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// @description:ja オンラインで画像を強力に閲覧できるツール。ポップアップ表示、拡大・縮小、回転、一括保存などの機能を自動で実行できます
1313
// @description:pt-BR Poderosa ferramenta de visualização de imagens on-line, que pode pop-up/dimensionar/girar/salvar em lote imagens automaticamente
1414
// @description:ru Мощный онлайн-инструмент для просмотра изображений, который может автоматически отображать/масштабировать/вращать/пакетно сохранять изображения
15-
// @version 2024.12.4.1
15+
// @version 2024.12.7.1
1616
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAV1BMVEUAAAD////29vbKysoqKioiIiKysrKhoaGTk5N9fX3z8/Pv7+/r6+vk5OTb29vOzs6Ojo5UVFQzMzMZGRkREREMDAy4uLisrKylpaV4eHhkZGRPT08/Pz/IfxjQAAAAgklEQVQoz53RRw7DIBBAUb5pxr2m3/+ckfDImwyJlL9DDzQgDIUMRu1vWOxTBdeM+onApENF0qHjpkOk2VTwLVEF40Kbfj1wK8AVu2pQA1aBBYDHJ1wy9Cf4cXD5chzNAvsAnc8TjoLAhIzsBao9w1rlVTIvkOYMd9nm6xPi168t9AYkbANdajpjcwAAAABJRU5ErkJggg==
1717
// @namespace https://github.com/hoothin/UserScripts
1818
// @homepage https://github.com/hoothin/UserScripts/tree/master/Picviewer%20CE%2B
@@ -17961,43 +17961,48 @@ ImgOps | https://imgops.com/#b#`;
1796117961
}
1796217962
return total;
1796317963
}
17964-
var imgs = Array.from(body.querySelectorAll('*')).concat([body]).reduceRight((total, node) => {
17965-
return anylizeEle(total, node);
17966-
}, []);
17967-
[].forEach.call(document.head.querySelectorAll("link[rel*='icon']"), node => {
17968-
if (imageReg.test(node.href)) {
17969-
node.src = node.href;
17970-
linkMedias.push(node);
17971-
}
17972-
});
17973-
[].forEach.call(document.head.querySelectorAll('meta[itemprop="image"]'), node => {
17974-
if (imageReg.test(node.content)) {
17975-
node.src = node.content;
17976-
linkMedias.push(node);
17977-
}
17978-
});
17979-
imgs = imgs.reverse().sort((a, b) => {
17980-
if (a.offsetParent && !b.offsetParent) {
17981-
return -1;
17982-
}
17983-
if (!a.offsetParent && b.offsetParent) {
17984-
return 1;
17985-
}
17986-
return 0;
17987-
}).concat(linkMedias.reverse());
17988-
// 排除库里面的图片
17989-
imgs = imgs.filter(function(img){
17990-
if (img.parentNode) {
17991-
if (img.parentNode.id=="icons" || img.parentNode.id=="pagetual-preload") {
17992-
return false;
17993-
} else if (img.parentNode.classList && img.parentNode.classList.contains("search-jumper-btn")) {
17994-
return false;
17995-
} else if (img.classList && img.classList.contains("pagetual")) {
17996-
return false;
17964+
var imgs;
17965+
if (matchedRule.gallery) {
17966+
imgs = matchedRule.gallery();
17967+
} else {
17968+
imgs = Array.from(body.querySelectorAll('*')).concat([body]).reduceRight((total, node) => {
17969+
return anylizeEle(total, node);
17970+
}, []);
17971+
[].forEach.call(document.head.querySelectorAll("link[rel*='icon']"), node => {
17972+
if (imageReg.test(node.href)) {
17973+
node.src = node.href;
17974+
linkMedias.push(node);
1799717975
}
17998-
}
17999-
return !(container.contains(img) || (preloadContainer&&preloadContainer.contains(img)));
18000-
});
17976+
});
17977+
[].forEach.call(document.head.querySelectorAll('meta[itemprop="image"]'), node => {
17978+
if (imageReg.test(node.content)) {
17979+
node.src = node.content;
17980+
linkMedias.push(node);
17981+
}
17982+
});
17983+
imgs = imgs.reverse().sort((a, b) => {
17984+
if (a.offsetParent && !b.offsetParent) {
17985+
return -1;
17986+
}
17987+
if (!a.offsetParent && b.offsetParent) {
17988+
return 1;
17989+
}
17990+
return 0;
17991+
}).concat(linkMedias.reverse());
17992+
// 排除库里面的图片
17993+
imgs = imgs.filter(function(img){
17994+
if (img.parentNode) {
17995+
if (img.parentNode.id=="icons" || img.parentNode.id=="pagetual-preload") {
17996+
return false;
17997+
} else if (img.parentNode.classList && img.parentNode.classList.contains("search-jumper-btn")) {
17998+
return false;
17999+
} else if (img.classList && img.classList.contains("pagetual")) {
18000+
return false;
18001+
}
18002+
}
18003+
return !(container.contains(img) || (preloadContainer&&preloadContainer.contains(img)));
18004+
});
18005+
}
1800118006

1800218007
await sleep(0);
1800318008
// 已经在图库里面的
@@ -21198,6 +21203,10 @@ ImgOps | https://imgops.com/#b#`;
2119821203
margin-right: -5px;\
2119921204
padding: 3px;\
2120021205
}\
21206+
.pv-pic-search-state>span>strong {\
21207+
background: inherit;\
21208+
color: inherit;\
21209+
}\
2120121210
span.pv-pic-search-state>.pv-icon {\
2120221211
width: 20px;\
2120321212
height: 20px;\
@@ -24290,6 +24299,16 @@ ImgOps | https://imgops.com/#b#`;
2429024299
if (site.ext) {
2429124300
self.ext = site.ext;
2429224301
}
24302+
if (site.gallery) {
24303+
let gallery = site.gallery;
24304+
self.gallery = () => {
24305+
if (typeof gallery === "string") {
24306+
return document.querySelectorAll(gallery);
24307+
} else {
24308+
return gallery();
24309+
}
24310+
};
24311+
}
2429324312
if (site.video) {
2429424313
let reMatch = typeof site.video === "string" && site.video.match(/^\/(.*)\/(\w*)$/);
2429524314
if (reMatch) {

0 commit comments

Comments
 (0)