Skip to content

Commit a4d3ac0

Browse files
committed
add totop
1 parent 7aa3e85 commit a4d3ac0

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 11 additions & 2 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.16.1
9+
// @version 2018.4.16.2
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -4581,6 +4581,9 @@
45814581
<head>\
45824582
<title>' + title + ' '+i18n("exportImages")+'</title>\
45834583
<style>\
4584+
.toTop{width:28px;height:28px;border-radius:14px;position: fixed;right:2px;bottom: 2px;cursor: pointer;background-color:#000;opacity:.3;padding:0em!important;border:0px!important;}\
4585+
.toTop:hover{opacity:1}\
4586+
.toTop>span{height:28px;line-height:28px;display:block;color:#FFF;text-align:center;font-size:20px;}\
45844587
.grid{-moz-column-count:4;-webkit-column-count:4;column-count:4;-moz-column-gap: 1em;-webkit-column-gap: 1em;column-gap: 1em;}\
45854588
.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;}\
45864589
.grid>div>img{width: 100%;margin-bottom:10px;}\
@@ -4592,15 +4595,21 @@
45924595
.select{opacity: 0.33;}\
45934596
</style>\
45944597
</head>\
4598+
<div class="toTop">\
4599+
<span>↑</span>\
4600+
</div>\
45954601
<body class="'+prefs.gallery.exportType+'">\
4596-
<img id="bigImg" style="pointer-events:none;position:fixed;z-index:999;max-height:100vh;">\
4602+
<img id="bigImg" style="pointer-events:none;position:fixed;z-index:999;max-height:100vh;top:0px;">\
45974603
<p>【'+i18n("picTitle")+'】:' + title + '</p>\
45984604
<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> \
45994605
<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);">\
46004606
</p>';
46014607

46024608
html += arr.join('\n') +
46034609
'<script type="text/javascript">\
4610+
document.querySelector(".toTop").addEventListener("click", function(){\
4611+
document.body.scrollIntoView();\
4612+
});\
46044613
[].forEach.call(document.querySelectorAll("div>img"),function(i){\
46054614
i.onmouseover=i.onmousemove=function(e){if(e.ctrlKey)document.querySelector("#bigImg").src=this.src;};\
46064615
i.onmouseout=function(e){document.querySelector("#bigImg").src="";}\

0 commit comments

Comments
 (0)