Skip to content

Commit c20c5f6

Browse files
committed
add butonOrder set
1 parent 2002660 commit c20c5f6

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 16 additions & 8 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.10.1
9+
// @version 2017.4.10.2
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -8094,7 +8094,7 @@ background-image:url("'+ prefs.icons.magnifier +'");\
80948094
}
80958095

80968096
function keydown(event) {
8097-
if (!prefs.floatBar.keys.enable || event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)
8097+
if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)
80988098
return;
80998099

81008100
if (floatBar && floatBar.shown && isKeyDownEffectiveTarget(event.target)) {
@@ -8131,12 +8131,6 @@ background-image:url("'+ prefs.icons.magnifier +'");\
81318131

81328132
document.addEventListener('mouseover', globalMouseoverHandler, true);
81338133

8134-
// 注册按键
8135-
//if (prefs.floatBar.keys.enable) {
8136-
document.addEventListener('keydown', keydown, false);
8137-
//}
8138-
8139-
81408134
var debug; // 调试函数
81418135

81428136
GM_config.init({
@@ -8162,6 +8156,7 @@ background-image:url("'+ prefs.icons.magnifier +'");\
81628156
"#pv-prefs label.sep-x { margin-right: 5px; }",
81638157
"#pv-prefs label.floatBar-key { margin-left: 20px; width: 100px; }",
81648158
"#pv-prefs input.color { width: 120px; }",
8159+
"#pv-prefs input.order { width: 250px; }",
81658160
].join('\n'),
81668161
fields: {
81678162
// 浮动工具栏
@@ -8222,6 +8217,12 @@ background-image:url("'+ prefs.icons.magnifier +'");\
82228217
"default": prefs.floatBar.minSizeLimit.h,
82238218
line: 'end',
82248219
},
8220+
'floatBar.butonOrder': {
8221+
label: '工具栏图标排序',
8222+
type: 'text',
8223+
className: 'order',
8224+
"default": prefs.floatBar.butonOrder.join(', '),
8225+
},
82258226
// 按键
82268227
'floatBar.keys.enable': {
82278228
label: '启用以下快捷键',
@@ -8475,6 +8476,11 @@ background-image:url("'+ prefs.icons.magnifier +'");\
84758476

84768477
loadPrefs();
84778478

8479+
// 注册按键
8480+
if (prefs.floatBar.keys.enable) {
8481+
document.addEventListener('keydown', keydown, false);
8482+
}
8483+
84788484
function openPrefs() {
84798485
GM_config.open();
84808486
}
@@ -8494,6 +8500,8 @@ background-image:url("'+ prefs.icons.magnifier +'");\
84948500
// 特殊的
84958501
if (keyStr == 'magnifier.wheelZoom.range' || keyStr == 'imgWindow.zoom.range') {
84968502
lastPref[lastKey] = value.split(/[,]\s*/).map(function(s) { return parseFloat(s)});
8503+
} else if(keyStr == 'floatBar.butonOrder') {
8504+
lastPref[lastKey] = value.replace(/^\s*|\s*$/g,"").split(/\s*[,]\s*/);
84978505
} else {
84988506
lastPref[lastKey] = value;
84998507
}

0 commit comments

Comments
 (0)