Skip to content

Commit 6bc4e31

Browse files
committed
Update Picviewer CE+.user.js
1 parent 7d3f26d commit 6bc4e31

File tree

1 file changed

+50
-51
lines changed

1 file changed

+50
-51
lines changed

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 50 additions & 51 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 2025.8.22.1
15+
// @version 2025.8.29.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
@@ -25323,6 +25323,32 @@ ImgOps | https://imgops.com/#b#`;
2532325323
};
2532425324
}
2532525325
}
25326+
var checkUniqueImgWin = function() {
25327+
if (canPreview) {
25328+
if (result.type != "link" && result.type != "rule" && result.src == result.imgSrc) {
25329+
if (result.imgAS.w < result.imgCS.w * 1.6 && result.imgAS.h < result.imgCS.h * 1.6) {
25330+
if (result.img && result.img.childElementCount) {
25331+
if (result.type == "force") return false;
25332+
if (prefs.floatBar.globalkeys.invertInitShow) return false;
25333+
}
25334+
var wSize = getWindowSize();
25335+
if (prefs.floatBar.globalkeys.invertInitShow && result.imgAS.w <= wSize.w && result.imgAS.h <= wSize.h) return false;
25336+
}
25337+
}
25338+
uniqueImgWinInitX = clientX;
25339+
uniqueImgWinInitY = clientY;
25340+
if (uniqueImgWin && !uniqueImgWin.removed) {
25341+
if (uniqueImgWin.src == result.src) return true;
25342+
uniqueImgWin.remove();
25343+
}
25344+
waitUntilMove(_target, () => {
25345+
new LoadingAnimC(result, 'popup', prefs.waitImgLoad, prefs.framesPicOpenInTopWindow);
25346+
});
25347+
return true;
25348+
} else {
25349+
return false;
25350+
}
25351+
};
2532625352
if (!result) {
2532725353
if (target.nodeName.toUpperCase() != 'IMG' && target.dataset.role == "img") {
2532825354
let img = target.parentNode.querySelector('img');
@@ -25340,13 +25366,34 @@ ImgOps | https://imgops.com/#b#`;
2534025366
};
2534125367
}
2534225368
} else if (target.nodeName.toUpperCase() != 'IMG') {
25369+
if (selectionClientRect &&
25370+
clientX > selectionClientRect.left &&
25371+
clientX < selectionClientRect.left + selectionClientRect.width &&
25372+
clientY > selectionClientRect.top &&
25373+
clientY < selectionClientRect.top + selectionClientRect.height) {
25374+
result = {
25375+
src: selectionStr,
25376+
type: "link",
25377+
imgSrc: selectionStr,
25378+
noActual:true,
25379+
img: target
25380+
};
25381+
checkUniqueImgWin();
25382+
25383+
if (!floatBar) {
25384+
floatBar = new FloatBarC();
25385+
}
25386+
floatBar.start(result);
25387+
25388+
return;
25389+
}
2534325390
let found = false;
2534425391
if (target.nodeName.toUpperCase() == "AREA") target = target.parentNode;
2534525392
var broEle, broImg;
2534625393
if (target.nodeName.toUpperCase() != 'A' && target.parentNode && target.parentNode.style && !/flex|grid|table/.test(getComputedStyle(target.parentNode).display)) {
2534725394
broEle = target.previousElementSibling;
2534825395
while (broEle) {
25349-
if (broEle.offsetWidth) {
25396+
if (broEle.offsetWidth && broEle.offsetWidth > target.offsetWidth>>1) {
2535025397
if (broEle.nodeName == "IMG") broImg = broEle;
2535125398
else if (broEle.nodeName == "PICTURE") broImg = broEle.querySelector("img");
2535225399
}
@@ -25357,7 +25404,7 @@ ImgOps | https://imgops.com/#b#`;
2535725404
else if (!broEle) {
2535825405
broEle = target.nextElementSibling;
2535925406
while (broEle) {
25360-
if (broEle.offsetWidth) {
25407+
if (broEle.offsetWidth && broEle.offsetWidth > target.offsetWidth>>1) {
2536125408
if (broEle.nodeName == "IMG") broImg = broEle;
2536225409
else if (broEle.nodeName == "PICTURE") broImg = broEle.querySelector("img");
2536325410
}
@@ -25582,56 +25629,8 @@ ImgOps | https://imgops.com/#b#`;
2558225629
}
2558325630
}
2558425631
}
25585-
var checkUniqueImgWin = function() {
25586-
if (canPreview) {
25587-
if (result.type != "link" && result.type != "rule" && result.src == result.imgSrc) {
25588-
if (result.imgAS.w < result.imgCS.w * 1.6 && result.imgAS.h < result.imgCS.h * 1.6) {
25589-
if (result.img && result.img.childElementCount) {
25590-
if (result.type == "force") return false;
25591-
if (prefs.floatBar.globalkeys.invertInitShow) return false;
25592-
}
25593-
var wSize = getWindowSize();
25594-
if (prefs.floatBar.globalkeys.invertInitShow && result.imgAS.w <= wSize.w && result.imgAS.h <= wSize.h) return false;
25595-
}
25596-
}
25597-
uniqueImgWinInitX = clientX;
25598-
uniqueImgWinInitY = clientY;
25599-
if (uniqueImgWin && !uniqueImgWin.removed) {
25600-
if (uniqueImgWin.src == result.src) return true;
25601-
uniqueImgWin.remove();
25602-
}
25603-
waitUntilMove(_target, () => {
25604-
new LoadingAnimC(result, 'popup', prefs.waitImgLoad, prefs.framesPicOpenInTopWindow);
25605-
});
25606-
return true;
25607-
} else {
25608-
return false;
25609-
}
25610-
};
2561125632

2561225633
if (!result && target.nodeName.toUpperCase() != 'IMG') {
25613-
if (selectionClientRect &&
25614-
clientX > selectionClientRect.left &&
25615-
clientX < selectionClientRect.left + selectionClientRect.width &&
25616-
clientY > selectionClientRect.top &&
25617-
clientY < selectionClientRect.top + selectionClientRect.height) {
25618-
result = {
25619-
src: selectionStr,
25620-
type: "link",
25621-
imgSrc: selectionStr,
25622-
noActual:true,
25623-
img: target
25624-
};
25625-
checkUniqueImgWin();
25626-
25627-
if (!floatBar) {
25628-
floatBar = new FloatBarC();
25629-
}
25630-
floatBar.start(result);
25631-
25632-
return;
25633-
}
25634-
2563525634
let i = 0;
2563625635
while(target) {
2563725636
if (i++ > 5) {

0 commit comments

Comments
 (0)