|
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.7.25.1 |
| 9 | +// @version 2017.7.25.2 |
10 | 10 | // @created 2011-6-15 |
11 | 11 | // @namespace http://userscripts.org/users/NLF |
12 | 12 | // @homepage http://hoothin.com |
|
575 | 575 | getImage: function() { |
576 | 576 | return this.src.replace(/.*bdstatic\.com.*\/([^\/]+)\.jpg/i,"http://imgsrc.baidu.com/baike/pic/item/$1.jpg"); |
577 | 577 | } |
| 578 | + }, |
| 579 | + {name: "nvshens", |
| 580 | + url: /nvshens\.com|onvshen\.com/, |
| 581 | + getImage: function() { |
| 582 | + return this.src.replace(/(\img\.onvshen\.com.*)(?:thumb\/|_s)(.*)/i,"$1$2"); |
| 583 | + } |
| 584 | + }, |
| 585 | + {name: "24meitu", |
| 586 | + url: /24meitu\.com|25meinv\.com|aisimeinv\.com|24tupian\.com|24meinv\.me/, |
| 587 | + getImage: function() { |
| 588 | + return this.src.replace(/\/m([^\/]+)$/i,"/$1"); |
| 589 | + } |
578 | 590 | } |
579 | 591 | ]; |
580 | 592 |
|
@@ -2507,7 +2519,7 @@ padding-left:24px;">'+shareItem.name+'</span>'); |
2507 | 2519 | var target=e.target; |
2508 | 2520 | e.preventDefault(); |
2509 | 2521 | if(eleMaps['sidebar-container'].contains(target)){//缩略图区滚动滚轮翻图片 |
2510 | | - var distance=self.thumbSpanOuterSize/3; |
| 2522 | + var distance=self.thumbSpanOuterSize; |
2511 | 2523 |
|
2512 | 2524 | if(e.deltaY<0 || e.deltaX<0){//向上滚 |
2513 | 2525 | distance=-distance; |
@@ -3494,13 +3506,86 @@ padding-left:24px;">'+shareItem.name+'</span>'); |
3494 | 3506 | return absolute_regex.test(src) ? src : ((src.charAt(0) == "/" ? root_domain : root_page) + src); |
3495 | 3507 | }, |
3496 | 3508 | completePages:[], |
3497 | | - nextPage:function(){ |
| 3509 | + prePage:function(){ |
3498 | 3510 | var pageObj=this.getPage(),self=this,textSpan=this.eleMaps['head-command-nextPage'].querySelector("span"); |
3499 | 3511 | textSpan.innerHTML="正在加载"; |
3500 | 3512 | var loadOver=function(){ |
3501 | 3513 | textSpan.innerHTML="<font color='red'>加载完毕</font>"; |
3502 | 3514 | setTimeout(function(){textSpan.innerHTML="加载更多";},1500); |
3503 | 3515 | }; |
| 3516 | + if(!pageObj.pre){ |
| 3517 | + loadOver(); |
| 3518 | + return; |
| 3519 | + } |
| 3520 | + var preUrl=pageObj.pre; |
| 3521 | + if(preUrl.tagName!="A"){ |
| 3522 | + var childA=preUrl.querySelector("a"); |
| 3523 | + if(childA){ |
| 3524 | + preUrl=childA; |
| 3525 | + }else{ |
| 3526 | + while(preUrl=preUrl.parentElement){ |
| 3527 | + if(preUrl.nodeName=='A'){ |
| 3528 | + break; |
| 3529 | + } |
| 3530 | + } |
| 3531 | + if(!preUrl)return; |
| 3532 | + } |
| 3533 | + } |
| 3534 | + var href=preUrl.getAttribute("href"); |
| 3535 | + if(self.completePages.indexOf(href)!=-1){ |
| 3536 | + loadOver(); |
| 3537 | + return; |
| 3538 | + }else{ |
| 3539 | + self.completePages.push(href); |
| 3540 | + } |
| 3541 | + GM_xmlhttpRequest({ |
| 3542 | + method: 'GET', |
| 3543 | + overrideMimeType:"text/html;charset="+document.charset, |
| 3544 | + url: self.canonicalUri(href), |
| 3545 | + onload: function(d) { |
| 3546 | + let html=document.implementation.createHTMLDocument(''); |
| 3547 | + html.documentElement.innerHTML = d.responseText; |
| 3548 | + self.curPage=html; |
| 3549 | + let imgs=html.querySelectorAll('img'); |
| 3550 | + var container = document.querySelector('.pv-gallery-container'), |
| 3551 | + preloadContainer = document.querySelector('.pv-gallery-preloaded-img-container'); |
| 3552 | + imgs = Array.prototype.slice.call(imgs).filter(function(img){ |
| 3553 | + return !(container.contains(img) || preloadContainer.contains(img)); |
| 3554 | + }); |
| 3555 | + imgs.forEach(function(img) { |
| 3556 | + var isrc=img.getAttribute("src"); |
| 3557 | + var nimg = new Image(); |
| 3558 | + nimg.src = isrc; |
| 3559 | + nimg.onload=function(){ |
| 3560 | + if (self._dataCache[this.src]) return; |
| 3561 | + var result = findPic(this); |
| 3562 | + if (result) { |
| 3563 | + self.data.push(result); |
| 3564 | + self._appendThumbSpans([result]); |
| 3565 | + self.loadThumb(); |
| 3566 | + } |
| 3567 | + self._dataCache[this.src] = true; |
| 3568 | + }; |
| 3569 | + }); |
| 3570 | + if(prefs.gallery.loadAll)self.prePage(); |
| 3571 | + else loadOver(); |
| 3572 | + }, |
| 3573 | + onerror: function(e) { |
| 3574 | + } |
| 3575 | + }); |
| 3576 | + }, |
| 3577 | + nextPage:function(){ |
| 3578 | + var pageObj=this.getPage(),self=this,textSpan=this.eleMaps['head-command-nextPage'].querySelector("span"); |
| 3579 | + textSpan.innerHTML="正在加载"; |
| 3580 | + var loadOver=function(){ |
| 3581 | + if(prefs.gallery.loadAll){ |
| 3582 | + self.curPage=document; |
| 3583 | + self.prePage(); |
| 3584 | + }else{ |
| 3585 | + textSpan.innerHTML="<font color='red'>加载完毕</font>"; |
| 3586 | + setTimeout(function(){textSpan.innerHTML="加载更多";},1500); |
| 3587 | + } |
| 3588 | + }; |
3504 | 3589 | if(!pageObj.next){ |
3505 | 3590 | loadOver(); |
3506 | 3591 | return; |
|
0 commit comments