|
6 | 6 | // @description Powerful picture viewing tool online, which can popup/scale/rotate/batch save pictures or find the HD original picture automatically |
7 | 7 | // @description:zh-CN NLF 的围观图修改版,增加高清原图查找显示(在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存、查找原图) |
8 | 8 | // @description:zh-TW NLF 的圍觀圖修改版,增加高清原圖查詢顯示(線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存、查詢原圖) |
9 | | -// @version 2017.3.25.1 |
| 9 | +// @version 2017.3.28.1 |
10 | 10 | // @created 2011-6-15 |
11 | 11 | // @namespace http://userscripts.org/users/NLF |
12 | 12 | // @homepage http://hoothin.com |
|
307 | 307 | url:/^https?:\/\/[^.]*\.deviantart\.com/i, |
308 | 308 | getImage:function(img, a){ |
309 | 309 | var oldsrc=this.src; |
310 | | - var newsrc = a.getAttribute('data-super-img') || a.getAttribute('data-super-full-img') |
311 | | - || oldsrc.replace(/(http:\/\/[^\/]+\/fs\d+\/)200H\/(.*)/i,'$1$2'); |
| 310 | + var newsrc; |
| 311 | + if(this.className=="fakethumb" && this.parentNode && this.parentNode.parentNode && this.parentNode.parentNode.parentNode && this.parentNode.parentNode.parentNode.dataset){ |
| 312 | + newsrc=this.parentNode.parentNode.parentNode.dataset.superFullImg; |
| 313 | + } |
| 314 | + if(!newsrc) |
| 315 | + newsrc = a.getAttribute('data-super-img') || a.getAttribute('data-super-full-img') |
| 316 | + || oldsrc.replace(/(http:\/\/[^\/]+\/fs\d+\/)200H\/(.*)/i,'$1$2'); |
312 | 317 | return newsrc==oldsrc? '' : newsrc; |
313 | 318 | }, |
314 | 319 | }, |
|
543 | 548 | getImage: function() { |
544 | 549 | return this.src.replace(/\/thumb\//i,"/original/").replace(/\/thumbnails\//i,"/"); |
545 | 550 | } |
| 551 | + }, |
| 552 | + {name: "dribbble", |
| 553 | + url: /dribbble\.com/, |
| 554 | + getImage: function() { |
| 555 | + return this.src.replace(/_teaser(.[^\.]+)$/i,"$1"); |
| 556 | + } |
546 | 557 | } |
547 | 558 | ]; |
548 | 559 |
|
@@ -7969,6 +7980,23 @@ background-image:url("'+ prefs.icons.magnifier +'");\ |
7969 | 7980 | // } |
7970 | 7981 | // } |
7971 | 7982 | // } |
| 7983 | + if (target.nodeName != 'IMG'){ |
| 7984 | + var imgChild=target.querySelectorAll('img'); |
| 7985 | + if(imgChild.length==1){ |
| 7986 | + target=imgChild[0]; |
| 7987 | + }else if(target.parentNode){ |
| 7988 | + if(target.parentNode.nodeName=='IMG'){ |
| 7989 | + target=target.parentNode; |
| 7990 | + }else{ |
| 7991 | + if(unsafeWindow.getComputedStyle(target).position=="absolute"){ |
| 7992 | + imgChild=target.parentNode.querySelectorAll('img'); |
| 7993 | + if(imgChild.length==1){ |
| 7994 | + target=imgChild[0]; |
| 7995 | + } |
| 7996 | + } |
| 7997 | + } |
| 7998 | + } |
| 7999 | + } |
7972 | 8000 |
|
7973 | 8001 | if (!target || !result && target.nodeName != 'IMG') return; |
7974 | 8002 |
|
|
0 commit comments