|
4 | 4 | // @name:zh-TW Picviewer CE+ |
5 | 5 | // @author NLF && ywzhaiqi && hoothin |
6 | 6 | // @description Powerful picture viewing tool online, which can popup/scale/rotate/batch save pictures or find the HD original picture automatically |
7 | | -// @description:zh-CN NLF 的围观图修改版,增加高清原图查找显示(在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存、查找原图) |
8 | | -// @description:zh-TW NLF 的圍觀圖修改版,增加高清原圖查詢顯示(線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存、查詢原圖) |
9 | | -// @version 2019.9.2.1 |
| 7 | +// @description:zh-CN 在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存、查找原图 |
| 8 | +// @description:zh-TW 線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存、查詢原圖 |
| 9 | +// @version 2019.9.19.1 |
10 | 10 | // @created 2011-6-15 |
11 | 11 | // @namespace http://userscripts.org/users/NLF |
12 | 12 | // @homepage http://hoothin.com |
|
27 | 27 | // @require https://greasyfork.org/scripts/6158-gm-config-cn/code/GM_config%20CN.js?version=23710 |
28 | 28 | // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rixixi@sina.com&item_name=Greasy+Fork+donation |
29 | 29 | // @contributionAmount 1 |
| 30 | +// @require https://cdn.jsdelivr.net/npm/file-saver@2.0.2/dist/FileSaver.min.js |
30 | 31 | // @run-at document-end |
31 | 32 | // @include http://* |
32 | 33 | // @include https://* |
|
92 | 93 | cantFind:"图片不在文档中,或者被隐藏了,无法定位!", |
93 | 94 | exportImages:"导出大图", |
94 | 95 | exportImagesTip:"导出所有图片到新窗口", |
95 | | - downloadImage:"下载图片", |
96 | | - downloadImageTip:"下载当前图片", |
| 96 | + downloadImage:"下载所有图片", |
| 97 | + downloadImageTip:"下载当前所有显示图片", |
97 | 98 | copyImagesUrl:"复制所有", |
98 | 99 | copyImagesUrlTip:"复制所有大图地址", |
99 | 100 | copySuccess:"已成功复制 #t# 张大图地址", |
|
275 | 276 | cantFind:"圖片不在文檔中,或者被隱藏了,無法定位!", |
276 | 277 | exportImages:"導出大圖", |
277 | 278 | exportImagesTip:"導出所有圖片到新窗口", |
278 | | - downloadImage:"下載圖片", |
279 | | - downloadImageTip:"下載當前圖片", |
| 279 | + downloadImage:"下載所有圖片", |
| 280 | + downloadImageTip:"下載當前所有顯示圖片", |
280 | 281 | copyImagesUrl:"複製所有", |
281 | 282 | copyImagesUrlTip:"複製所有大圖地址", |
282 | 283 | copySuccess:"已成功複製 #t# 張大圖地址", |
|
458 | 459 | cantFind:"The image is not in the document, or it is hidden and cannot be located!", |
459 | 460 | exportImages:"Export big Images", |
460 | 461 | exportImagesTip:"Export all images to new window", |
461 | | - downloadImage:"Download Image", |
462 | | - downloadImageTip:"Download the current picture", |
| 462 | + downloadImage:"Download all shown Images", |
| 463 | + downloadImageTip:"Download the current shown pictures", |
463 | 464 | copyImagesUrl:"Copy all images Urls", |
464 | 465 | copyImagesUrlTip:"Copy all large image Urls", |
465 | 466 | copySuccess:"Successfully copied #t# Url", |
|
2439 | 2440 | '<span class="pv-gallery-head-command-drop-list-item" data-command="psImage" title="'+i18n("onlineEditTip",prefs.gallery.editSite)+'">'+i18n("onlineEdit")+'</span>'+ |
2440 | 2441 | '<span class="pv-gallery-head-command-drop-list-item" data-command="exportImages" title="'+i18n("exportImagesTip")+'">'+i18n("exportImages")+'</span>'+ |
2441 | 2442 | '<span class="pv-gallery-head-command-drop-list-item" data-command="copyImages" title="'+i18n("copyImagesUrlTip")+'">'+i18n("copyImagesUrl")+'</span>'+ |
| 2443 | + '<span class="pv-gallery-head-command-drop-list-item" data-command="downloadImage" title="'+i18n("downloadImageTip")+'">'+i18n("downloadImage")+'</span>'+ |
2442 | 2444 | '<span class="pv-gallery-head-command-drop-list-item" data-command="scrollIntoView" title="'+i18n("findInPageTip")+'">'+i18n("findInPage")+'</span>'+ |
2443 | 2445 | '<span class="pv-gallery-head-command-drop-list-item" data-command="enterCollection" title="'+i18n("viewCollectionTip")+'">'+i18n("viewCollection")+'</span>'+ |
2444 | | - '<span class="pv-gallery-head-command-drop-list-item" data-command="downloadImage" title="'+i18n("downloadImageTip")+'">'+i18n("downloadImage")+'</span>'+ |
2445 | 2446 | '<span class="pv-gallery-head-command-drop-list-item" data-command="openInNewWindow" title="'+i18n("openInNewWindowTip")+'">'+i18n("openInNewWindow")+'</span>'+ |
2446 | 2447 | '<span class="pv-gallery-head-command-drop-list-item" title="'+i18n("autoRefreshTip")+'">'+ |
2447 | 2448 | '<input type="checkbox" data-command="scrollToEndAndReload"/>'+ |
|
3030 | 3031 | },true); |
3031 | 3032 |
|
3032 | 3033 |
|
3033 | | - var downloadEle=document.createElement("a"),srcSplit; |
| 3034 | + var srcSplit; |
3034 | 3035 | //命令下拉列表的点击处理 |
3035 | 3036 | eleMaps['head-command-drop-list-others'].addEventListener('click',function(e){ |
3036 | 3037 | if(e.button!=0)return;//左键 |
|
3092 | 3093 | self.exportImages(); |
3093 | 3094 | break; |
3094 | 3095 | case 'downloadImage': |
3095 | | - srcSplit=self.src.split("/"); |
3096 | | - downloadEle.href=self.src; |
3097 | | - downloadEle.setAttribute("download",srcSplit[srcSplit.length-1]); |
3098 | | - downloadEle.click(); |
| 3096 | + var nodes = document.querySelectorAll('.pv-gallery-sidebar-thumb-container[data-src]'); |
| 3097 | + var urls = []; |
| 3098 | + [].forEach.call(nodes, function(node){ |
| 3099 | + if(getComputedStyle(node).display!="none"){ |
| 3100 | + srcSplit=node.dataset.src.split("/"); |
| 3101 | + saveAs(node.dataset.src, srcSplit[srcSplit.length-1]); |
| 3102 | + } |
| 3103 | + }); |
3099 | 3104 | break; |
3100 | 3105 | case 'copyImages': |
3101 | 3106 | self.copyImages(true); |
|
0 commit comments