Skip to content

Commit 42fbbbf

Browse files
committed
Update Picviewer CE+.user.js
yande
1 parent 2de0c61 commit 42fbbbf

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// @description Powerful picture viewing tool online, which can popup/scale/rotate/batch save pictures automatically
77
// @description:zh-CN 在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存
88
// @description:zh-TW 線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存
9-
// @version 2021.8.21.2
9+
// @version 2021.9.24.1
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -1249,6 +1249,15 @@
12491249
getImage: function() {
12501250
return this.src.replace(/scale\-to\-width\-down\/\d+/i,"").replace(/smart\/width\/\d+\/height\/\d+/i,"");
12511251
}
1252+
},
1253+
{name: "yande",
1254+
url: /yande\.re/,
1255+
getImage: function() {
1256+
if(this && this.parentNode && this.parentNode.parentNode && this.parentNode.parentNode.nextSibling && this.parentNode.parentNode.nextSibling.classList && this.parentNode.parentNode.nextSibling.classList.contains("largeimg")){
1257+
return this.parentNode.parentNode.nextSibling.href;
1258+
}
1259+
return this.src;
1260+
}
12521261
}
12531262
];
12541263

@@ -4743,11 +4752,17 @@
47434752
}, 1000);
47444753
},
47454754
exportImages: function () { // 导出所有图片到新窗口
4746-
var nodes = document.querySelectorAll('.pv-gallery-sidebar-thumb-container[data-src]');
4747-
var arr = [].map.call(nodes, function(node){
4748-
if(unsafeWindow.getComputedStyle(node).display=="none")return "";
4749-
else return '<div><img src=' + node.dataset.src + '></div>'
4750-
});
4755+
var nodes = document.querySelectorAll('.pv-gallery-sidebar-thumb-container[data-src]'),i;
4756+
//var arr = Array.prototype.map.call(nodes, function(node){
4757+
// if(unsafeWindow.getComputedStyle(node).display=="none")return "";
4758+
// else return '<div><img src=' + node.dataset.src + '></div>'
4759+
//});
4760+
4761+
var arr=[];
4762+
for (i = 0; i < nodes.length; ++i) {
4763+
if(unsafeWindow.getComputedStyle(nodes[i]).display=="none")arr.push("");
4764+
else arr.push('<div><img src=' + nodes[i].dataset.src + '></div>');
4765+
}
47514766

47524767
var title = document.title;
47534768

0 commit comments

Comments
 (0)