Skip to content

Commit 479d7f5

Browse files
committed
Waterfall
1 parent c52d0e9 commit 479d7f5

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 17 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 or find the HD original picture automatically
77
// @description:zh-CN NLF 的围观图修改版,增加高清原图查找显示(在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存、查找原图)
88
// @description:zh-TW NLF 的圍觀圖修改版,增加高清原圖查詢顯示(線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存、查詢原圖)
9-
// @version 2018.4.15.1
9+
// @version 2018.4.15.2
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -4388,7 +4388,7 @@
43884388
var nodes = document.querySelectorAll('.pv-gallery-sidebar-thumb-container[data-src]');
43894389
var arr = [].map.call(nodes, function(node){
43904390
if(unsafeWindow.getComputedStyle(node).display=="none")return "";
4391-
else return '<div onclick="this.classList.toggle(\'select\')"><img src=' + node.dataset.src + ' /></div>'
4391+
else return '<div><img src=' + node.dataset.src + '></div>'
43924392
});
43934393

43944394
var title = document.title;
@@ -4397,23 +4397,34 @@
43974397
<head>\
43984398
<title>' + title + ' '+i18n("exportImages")+'</title>\
43994399
<style>\
4400-
.grid>div { float: left; max-height: 600px; max-width: 350px; margin: 2px; }\
4401-
.grid>div>img { max-height: 600px; max-width: 350px; }\
4400+
.grid{-moz-column-count:4;-webkit-column-count:4;column-count:4;-moz-column-gap: 1em;-webkit-column-gap: 1em;column-gap: 1em;}\
4401+
.grid>div{padding: 1em;margin: 0 0 1em 0;-moz-page-break-inside: avoid;-webkit-column-break-inside: avoid;break-inside: avoid;border: 1px solid #000;}\
4402+
.grid>div>img{width: 100%;margin-bottom:10px;}\
44024403
.list>div {text-align:center;}\
44034404
.list>div>img { max-width: 100%; }\
44044405
.gridBig{margin: 0px;}\
44054406
.gridBig>div { float: left;margin: 0px 0px 1px 1px;}\
44064407
.gridBig>div>img { max-width: 100%; }\
4407-
.select{box-shadow: 0px 0px 5px 3px rgb(255, 0, 0);}\
4408+
.select{opacity: 0.33;}\
44084409
</style>\
44094410
</head>\
44104411
<body class="'+prefs.gallery.exportType+'">\
4412+
<img id="bigImg" style="pointer-events:none;position:fixed;z-index:999;max-height:100vh;">\
44114413
<p>【'+i18n("picTitle")+'】:' + title + '</p>\
44124414
<p>【'+i18n("picNum")+'】:' + nodes.length + ' <select onchange="document.body.className=this.options[this.options.selectedIndex].value"><option value="grid" '+(prefs.gallery.exportType=="grid"?"selected='selected'":"")+'>'+i18n("grid")+'</option><option value="gridBig" '+(prefs.gallery.exportType=="gridBig"?"selected='selected'":"")+'>'+i18n("gridBig")+'</option><option value="list" '+(prefs.gallery.exportType=="list"?"selected='selected'":"")+'>'+i18n("list")+'</option> </select> \
44134415
<input type="button" value="'+i18n("exportImagesUrl")+'" onclick="var imgStr=\'\',selList=document.querySelectorAll(\'.select>img\');if(selList.length==0)[].forEach.call(document.querySelectorAll(\'img\'),function(i){imgStr+=i.src+\' \\n\'});else{[].forEach.call(selList,function(i){imgStr+=i.src+\' \\n\'});}window.prompt(\''+i18n("exportImagesUrlPop")+'\',imgStr);">\
44144416
</p>';
44154417

4416-
html += arr.join('\n') + '</body>'
4418+
html += arr.join('\n') +
4419+
'<script type="text/javascript">\
4420+
[].forEach.call(document.querySelectorAll("div>img"),function(i){\
4421+
i.onmouseover=i.onmousemove=function(e){if(e.ctrlKey)document.querySelector("#bigImg").src=this.src;};\
4422+
i.onmouseout=function(e){document.querySelector("#bigImg").src="";}\
4423+
});\
4424+
[].forEach.call(document.querySelectorAll("body>div"),function(i){\
4425+
i.onclick=function(){this.classList.toggle("select")}\
4426+
});\
4427+
</script></body>'
44174428
GM_openInTab('data:text/html;charset=utf-8,' + encodeURIComponent(html));
44184429
},
44194430
copyImages: function(isAlert) {

0 commit comments

Comments
 (0)