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.7.25.2
9+ // @version 2017.7.26.1
1010// @created 2011-6-15
1111// @namespace http://userscripts.org/users/NLF
1212// @homepage http://hoothin.com
@@ -7698,6 +7698,19 @@ background-image:url("'+ prefs.icons.magnifier +'");\
76987698 if ( img ) return { url :img . src , node :img , rect :rect ( img ) , distinct :true } ;
76997699 }
77007700
7701+ function decodeURIComponentEx ( uriComponent ) {
7702+ if ( ! uriComponent ) {
7703+ return uriComponent ;
7704+ }
7705+ var ret ;
7706+ try {
7707+ ret = decodeURIComponent ( uriComponent ) ;
7708+ } catch ( ex ) {
7709+ ret = unescape ( uriComponent ) ;
7710+ }
7711+ return ret ;
7712+ } ;
7713+
77017714 function findInfo ( url , node , noHtml , skipHost ) {
77027715 for ( var i = 0 , len = hosts . length , tn = tag ( node ) , h , m , html , urls , URL , http ; i < len && ( h = hosts [ i ] ) ; i ++ ) {
77037716 if ( h . e && ! matches ( node , h . e ) || h == skipHost ) continue ;
@@ -7718,10 +7731,10 @@ background-image:url("'+ prefs.icons.magnifier +'");\
77187731 }
77197732 if ( ! m || tn == 'IMG' && ! ( 's' in h ) ) continue ;
77207733 if ( 's' in h ) {
7721- urls = ( Array . isArray ( h . s ) ? h . s : [ h . s ] ) . map ( function ( s ) { if ( typeof s == 'string' ) return decodeURIComponent ( replace ( s , m , h . r , http ) ) ; if ( typeof s == 'function' ) return s ( m , node ) ; return s ; } ) ;
7734+ urls = ( Array . isArray ( h . s ) ? h . s : [ h . s ] ) . map ( function ( s ) { if ( typeof s == 'string' ) return decodeURIComponentEx ( replace ( s , m , h . r , http ) ) ; if ( typeof s == 'function' ) return s ( m , node ) ; return s ; } ) ;
77227735 if ( Array . isArray ( urls [ 0 ] ) ) urls = urls [ 0 ] ;
77237736 if ( urls [ 0 ] === false ) continue ;
7724- urls = urls . map ( function ( u ) { return u ? decodeURIComponent ( u ) : u ; } ) ;
7737+ urls = urls . map ( function ( u ) { return u ? decodeURIComponentEx ( u ) : u ; } ) ;
77257738 } else {
77267739 urls = [ m . input ] ;
77277740 }
@@ -8141,7 +8154,7 @@ background-image:url("'+ prefs.icons.magnifier +'");\
81418154
81428155 var target = e . target ;
81438156
8144- if ( ! target || target . classList . contains ( 'pv-pic-ignored' ) ) {
8157+ if ( ! target || ! target . classList || target . classList . contains ( 'pv-pic-ignored' ) ) {
81458158 return ;
81468159 }
81478160
0 commit comments