|
6 | 6 | // @description Powerful picture viewing tool online, which can popup/scale/rotate/batch save pictures or find the HD original picture automatically |
7 | 7 | // @description:zh-CN NLF 的围观图修改版,增加高清原图查找显示(在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存、查找原图) |
8 | 8 | // @description:zh-TW NLF 的圍觀圖修改版,增加高清原圖查詢顯示(線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存、查詢原圖) |
9 | | -// @version 2018.4.15.1 |
| 9 | +// @version 2018.4.15.2 |
10 | 10 | // @created 2011-6-15 |
11 | 11 | // @namespace http://userscripts.org/users/NLF |
12 | 12 | // @homepage http://hoothin.com |
|
4388 | 4388 | var nodes = document.querySelectorAll('.pv-gallery-sidebar-thumb-container[data-src]'); |
4389 | 4389 | var arr = [].map.call(nodes, function(node){ |
4390 | 4390 | 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>' |
4392 | 4392 | }); |
4393 | 4393 |
|
4394 | 4394 | var title = document.title; |
|
4397 | 4397 | <head>\ |
4398 | 4398 | <title>' + title + ' '+i18n("exportImages")+'</title>\ |
4399 | 4399 | <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;}\ |
4402 | 4403 | .list>div {text-align:center;}\ |
4403 | 4404 | .list>div>img { max-width: 100%; }\ |
4404 | 4405 | .gridBig{margin: 0px;}\ |
4405 | 4406 | .gridBig>div { float: left;margin: 0px 0px 1px 1px;}\ |
4406 | 4407 | .gridBig>div>img { max-width: 100%; }\ |
4407 | | - .select{box-shadow: 0px 0px 5px 3px rgb(255, 0, 0);}\ |
| 4408 | + .select{opacity: 0.33;}\ |
4408 | 4409 | </style>\ |
4409 | 4410 | </head>\ |
4410 | 4411 | <body class="'+prefs.gallery.exportType+'">\ |
| 4412 | + <img id="bigImg" style="pointer-events:none;position:fixed;z-index:999;max-height:100vh;">\ |
4411 | 4413 | <p>【'+i18n("picTitle")+'】:' + title + '</p>\ |
4412 | 4414 | <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> \ |
4413 | 4415 | <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);">\ |
4414 | 4416 | </p>'; |
4415 | 4417 |
|
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>' |
4417 | 4428 | GM_openInTab('data:text/html;charset=utf-8,' + encodeURIComponent(html)); |
4418 | 4429 | }, |
4419 | 4430 | copyImages: function(isAlert) { |
|
0 commit comments