Skip to content

Commit 09c8191

Browse files
committed
fix
download with sitename, limit floatbar shown by shown size
1 parent 7f86ab8 commit 09c8191

1 file changed

Lines changed: 27 additions & 20 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 27 additions & 20 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 automatically
77
// @description:zh-CN 在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存
88
// @description:zh-TW 線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存
9-
// @version 2020.2.2.1
9+
// @version 2020.4.15.1
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -144,7 +144,7 @@
144144
forceShowTip:"非缩放的图片大小超过下面设定的尺寸时显示浮动工具栏",
145145
px:"像素",
146146
minSizeLimit:"缩放图片,超过该尺寸,显示浮框",
147-
minSizeLimitTip:"图片被缩放(图片原始大小与实际大小不一致)后,原图长宽大于设定值时显示浮动工具栏",
147+
minSizeLimitTip:"图片被缩放(图片原始大小与实际大小不一致)后,显示长宽大于设定值时显示浮动工具栏",
148148
listenBg:"监听背景图",
149149
listenBgTip:"在有背景图的元素上显示悬浮框",
150150
butonOrder:"工具栏图标排序",
@@ -328,7 +328,7 @@
328328
forceShowTip:"非縮放的圖片大小超過下面設定的尺寸時顯示浮動工具欄",
329329
px:"像素",
330330
minSizeLimit:"縮放圖片,超過該尺寸,顯示浮框",
331-
minSizeLimitTip:"圖片被縮放(圖片原始大小與實際大小不一致)後,原圖長寬大於設定值時顯示浮動工具欄",
331+
minSizeLimitTip:"圖片被縮放(圖片原始大小與實際大小不一致)後,顯示長寬大於設定值時顯示浮動工具欄",
332332
listenBg:"監聽背景圖",
333333
listenBgTip:"在有背景圖的元素上顯示懸浮框",
334334
butonOrder:"工具欄圖標排序",
@@ -512,7 +512,7 @@
512512
forceShowTip:"Floating toolbar when non-scaled image size exceeds the size set below",
513513
px:"px",
514514
minSizeLimit:"Zoom the image, beyond that size, display the float frame",
515-
minSizeLimitTip:"After the image is scaled (the original size of the image does not match the actual size), the floating toolbar is displayed when the original image length is greater than the set value.",
515+
minSizeLimitTip:"After the image is scaled (the original size of the image does not match the actual size), the floating toolbar is displayed when the shown image length is greater than the set value.",
516516
listenBg:"Listening background image",
517517
listenBgTip:"Show the hover box on the element with the background image",
518518
butonOrder:"Sort of toolbar icons",
@@ -622,11 +622,11 @@
622622
forceShow:{//在没有被缩放的图片上,但是大小超过下面设定的尺寸时,强制显示浮动框.
623623
enabled:true,//启用强制显示.
624624
size:{//图片尺寸.单位(像素);
625-
w:166,
626-
h:166,
625+
w:155,
626+
h:155,
627627
},
628628
},
629-
minSizeLimit:{//就算是图片被缩放了(看到的图片被设定了width或者height限定了大小,这种情况下),如果没有被缩放的原图片小于设定值,那么也不显示浮动工具栏.
629+
minSizeLimit:{//就算是图片被缩放了(看到的图片被设定了width或者height限定了大小,这种情况下),如果图片显示大小小于设定值,那么也不显示浮动工具栏.
630630
w:100,
631631
h:100,
632632
},
@@ -3101,7 +3101,7 @@
31013101
[].forEach.call(nodes, function(node){
31023102
if(getComputedStyle(node).display!="none"){
31033103
srcSplit=node.dataset.src.split("/");
3104-
saveAs(node.dataset.src, srcSplit[srcSplit.length-1]);
3104+
saveAs(node.dataset.src, location.host+"-"+srcSplit[srcSplit.length-1]);
31053105
}
31063106
});
31073107
break;
@@ -8713,7 +8713,24 @@ left: -45px;\
87138713
imgSrc = img.src||img.srcset, // img 节点的 src
87148714
xhr,
87158715
description; // 图片的注释
8716-
8716+
var imgCStyle=unsafeWindow.getComputedStyle(img);
8717+
var imgCS={
8718+
h: parseFloat(imgCStyle.height),
8719+
w: parseFloat(imgCStyle.width),
8720+
};
8721+
var imgAS={//实际尺寸。
8722+
h:img.naturalHeight,
8723+
w:img.naturalWidth,
8724+
};
8725+
if(!(imgAS.w==imgCS.w && imgAS.h==imgCS.h)){//如果不是两者完全相等,那么被缩放了.
8726+
if(imgCS.h <= prefs.floatBar.minSizeLimit.h || imgCS.w <= prefs.floatBar.minSizeLimit.w){//最小限定判断.
8727+
return;
8728+
}
8729+
}else{
8730+
if(imgCS.w <= prefs.floatBar.forceShow.size.w || imgCS.h <= prefs.floatBar.forceShow.size.h){
8731+
return;
8732+
}
8733+
}
87178734
if(!src && matchedRule && !base64Img){// 通过高级规则获取.
87188735
// 排除
87198736
if (matchedRule.exclude && matchedRule.exclude.test(imgSrc)) {
@@ -8786,20 +8803,10 @@ left: -45px;\
87868803
if(src)type='scale';
87878804
};
87888805

8789-
var imgAS={//实际尺寸。
8790-
h:img.naturalHeight,
8791-
w:img.naturalWidth,
8792-
};
87938806
if(!src || src==imgSrc){//本图片是否被缩放.
87948807
noActual=true;
8795-
8796-
var imgCStyle=unsafeWindow.getComputedStyle(img);
8797-
var imgCS={
8798-
h: parseFloat(imgCStyle.height),
8799-
w: parseFloat(imgCStyle.width),
8800-
};
88018808
if(!(imgAS.w==imgCS.w && imgAS.h==imgCS.h)){//如果不是两者完全相等,那么被缩放了.
8802-
if(imgAS.h > prefs.floatBar.minSizeLimit.h && imgAS.w > prefs.floatBar.minSizeLimit.w){//最小限定判断.
8809+
if(imgCS.h > prefs.floatBar.minSizeLimit.h && imgCS.w > prefs.floatBar.minSizeLimit.w){//最小限定判断.
88038810
src=imgSrc;
88048811
type='scale';
88058812
}

0 commit comments

Comments
 (0)