Skip to content

Commit 86f6897

Browse files
committed
set for small pic
1 parent 03e1de8 commit 86f6897

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 22 additions & 3 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 2017.4.19.1
9+
// @version 2017.4.25.1
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -97,6 +97,7 @@
9797

9898
zoomresized: 25, // 图片尺寸最少相差比例,单位:%
9999
scaleSmallSize: 250, // 图库的新类别,缩放的图片,尺寸的高或宽都小于该值
100+
showSmallSize:true,//是否默认显示小尺寸图片
100101

101102
scrollEndAndLoad: false, // 滚动主窗口到最底部,然后自动重载库的图片。还有bug,有待进一步测试
102103
scrollEndAndLoad_num: 3, // 最后几张图片执行
@@ -2030,7 +2031,7 @@
20302031
// name: '小缩放'
20312032
// },
20322033
scaleSmall: {
2033-
shown: true,
2034+
shown: prefs.gallery.showSmallSize,
20342035
count: 0,
20352036
description: '小尺寸图片,实际尺寸的高和宽都小于 ' + prefs.gallery.scaleSmallSize + ' 像素',
20362037
name: '小尺寸'
@@ -2311,7 +2312,8 @@
23112312
//分类下拉列表的点击发生change事件的处理
23122313
eleMaps['head-command-drop-list-category'].addEventListener('change',function(e){
23132314
var target=e.target;
2314-
self.iStatisCopy[dataset(target,'type')].shown=target.checked;
2315+
var type=dataset(target,'type');
2316+
self.iStatisCopy[type].shown=target.checked;
23152317
self.switchThumbVisible();//切换图片类别显隐;
23162318
},true);
23172319

@@ -2746,6 +2748,7 @@ padding-left:24px;">'+shareItem.name+'</span>');
27462748

27472749

27482750
this._resizeHandler=this.resizeHandler.bind(this);
2751+
this._keyDownListener=this.keyDownListener.bind(this);
27492752

27502753
//插入动态生成的css数据。
27512754
this.globalSSheet.insertRule('.pv-gallery-sidebar-thumb-container{'+
@@ -3340,6 +3343,15 @@ padding-left:24px;">'+shareItem.name+'</span>');
33403343
index:index,
33413344
};
33423345
},
3346+
keyDownListener:function(e){
3347+
switch(e.keyCode){
3348+
case 27:
3349+
if(prefs.imgWindow.close.escKey){
3350+
this.close();
3351+
}
3352+
break;
3353+
}
3354+
},
33433355
show:function(reload){
33443356
this.shown=true;
33453357
galleryMode=true;
@@ -3355,8 +3367,10 @@ padding-left:24px;">'+shareItem.name+'</span>');
33553367
this.gallery.focus();
33563368
window.addEventListener('resize',this._resizeHandler,true);
33573369
}
3370+
document.addEventListener('keydown',this._keyDownListener,true);
33583371
},
33593372
close:function(reload){
3373+
document.removeEventListener('keydown',this._keyDownListener,true);
33603374
this.shown=false;
33613375
this.minimized=false;
33623376

@@ -8342,6 +8356,11 @@ background-image:url("'+ prefs.icons.magnifier +'");\
83428356
"default": prefs.gallery.scaleSmallSize,
83438357
after: ' 像素则归入小尺寸图片'
83448358
},
8359+
'gallery.showSmallSize':{
8360+
label: '默认显示小尺寸图片',
8361+
type: 'checkbox',
8362+
"default": prefs.gallery.showSmallSize
8363+
},
83458364
'gallery.transition': {
83468365
label: '显示图库切换图片的特效',
83478366
type: 'checkbox',

0 commit comments

Comments
 (0)