|
31 | 31 | // @name:da Pagetual |
32 | 32 | // @name:fr-CA Pagetual |
33 | 33 | // @namespace hoothin |
34 | | -// @version 1.9.37.121 |
| 34 | +// @version 1.9.37.122 |
35 | 35 | // @description Perpetual pages - powerful auto-pager script. Auto fetching next paginated web pages and inserting into current page for infinite scroll. Support thousands of web sites without any rule. |
36 | 36 | // @description:zh-CN 终极自动翻页 - 加载并拼接下一分页内容至当前页尾,智能适配任意网页 |
37 | 37 | // @description:zh-TW 終極自動翻頁 - 加載並拼接下一分頁內容至當前頁尾,智能適配任意網頁 |
|
8014 | 8014 | margin-top: 30px!important; |
8015 | 8015 | pointer-events: all; |
8016 | 8016 | } |
8017 | | - .pagetual_pageBar span>svg { |
| 8017 | + .pagetual_pageBar a>svg { |
8018 | 8018 | -moz-transition:transform 0.5s ease, opacity 0.3s ease; |
8019 | 8019 | -webkit-transition:transform 0.5s ease, opacity 0.3s ease; |
8020 | 8020 | transition:transform 0.5 ease, opacity 0.3s ease; |
8021 | 8021 | opacity: 0; |
8022 | 8022 | } |
8023 | | - .pagetual_pageBar.stop span>svg{ |
| 8023 | + .pagetual_pageBar.stop a>svg{ |
8024 | 8024 | opacity: 1; |
8025 | 8025 | } |
8026 | | - .pagetual_pageBar.stop span>svg>path{ |
| 8026 | + .pagetual_pageBar.stop a>svg>path{ |
8027 | 8027 | transform: scale(.8); |
8028 | 8028 | transform-origin: center; |
8029 | 8029 | -moz-transition:transform 0.3s ease; |
8030 | 8030 | -webkit-transition:transform 0.3s ease; |
8031 | 8031 | transition:transform 0.3 ease; |
8032 | 8032 | } |
8033 | | - .pagetual_pageBar.stop:hover span>svg>path{ |
| 8033 | + .pagetual_pageBar.stop:hover a>svg>path{ |
8034 | 8034 | transform: unset; |
8035 | 8035 | } |
8036 | | - .pagetual_pageBar:hover span>svg { |
| 8036 | + .pagetual_pageBar:hover a>svg { |
8037 | 8037 | opacity: 1; |
8038 | 8038 | } |
8039 | | - .pagetual_pageBar span>svg.upSvg:hover { |
| 8039 | + .pagetual_pageBar a>svg.upSvg:hover { |
8040 | 8040 | transform: rotate(360deg) scale3d(1.2, 1.2, 1.2); |
8041 | 8041 | } |
8042 | | - .pagetual_pageBar span>svg.downSvg:hover { |
| 8042 | + .pagetual_pageBar a>svg.downSvg:hover { |
8043 | 8043 | transform: rotate(540deg) scale3d(1.2, 1.2, 1.2)!important; |
8044 | 8044 | } |
8045 | 8045 | .pagetual_pageBar .pagetual_pageNum{ |
|
8773 | 8773 | inLi = compareNodeName(example, ["li"]) || (example.nextElementSibling && compareNodeName(example.nextElementSibling, ["li"])); |
8774 | 8774 | } |
8775 | 8775 | let pageBar = document.createElement(inTable ? "tr" : (inLi ? "li" : "div")); |
8776 | | - let upSpan = document.createElement("span"); |
8777 | | - let downSpan = document.createElement("span"); |
| 8776 | + let upSpan = document.createElement("a"); |
| 8777 | + let downSpan = document.createElement("a"); |
8778 | 8778 | let pageText = document.createElement("a"); |
8779 | 8779 | let pageNum; |
8780 | 8780 | pageBar.className = isHideBar ? "pagetual_pageBar autopagerize_page_info hide" : "pagetual_pageBar autopagerize_page_info"; |
|
8787 | 8787 | upSpan.innerHTML = createHTML(upSvg); |
8788 | 8788 | upSpan.children[0].style.cssText = upSvgCSS; |
8789 | 8789 | upSpan.title = i18n("toTop"); |
| 8790 | + upSpan.href = ruleParser.initUrl || ''; |
8790 | 8791 | downSpan.innerHTML = createHTML(downSvg); |
8791 | 8792 | downSpan.children[0].style.cssText = downSvgCSS; |
8792 | 8793 | downSpan.title = i18n("toBottom"); |
|
9006 | 9007 | } |
9007 | 9008 |
|
9008 | 9009 | upSpan.addEventListener("click", e => { |
| 9010 | + e.stopPropagation(); |
| 9011 | + if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { |
| 9012 | + if (e.altKey) location.href = upSpan.href; |
| 9013 | + return; |
| 9014 | + } |
9009 | 9015 | getBody(document).scrollTop = 0; |
9010 | 9016 | document.documentElement.scrollTop = 0; |
9011 | 9017 | e.preventDefault(); |
9012 | | - e.stopPropagation(); |
| 9018 | + }); |
| 9019 | + downSpan.addEventListener("mousedown", e => { |
| 9020 | + if (ruleParser.nextLinkHref && ruleParser.nextLinkHref != '#') { |
| 9021 | + downSpan.href = ruleParser.nextLinkHref; |
| 9022 | + } else downSpan.href = ''; |
9013 | 9023 | }); |
9014 | 9024 | downSpan.addEventListener("click", e => { |
9015 | | - if (!e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey) { |
9016 | | - changeStop(true); |
| 9025 | + e.stopPropagation(); |
| 9026 | + if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { |
| 9027 | + if (e.altKey && downSpan.getAttribute('href')) location.href = upSpan.href; |
| 9028 | + return; |
9017 | 9029 | } |
| 9030 | + changeStop(true); |
9018 | 9031 | pageBar.title = i18n(isPause ? "enable" : "disable"); |
9019 | 9032 | scrollH = Math.max(document.documentElement.scrollHeight, getBody(document).scrollHeight); |
9020 | 9033 | getBody(document).scrollTop = scrollH || 9999999; |
9021 | 9034 | document.documentElement.scrollTop = scrollH || 9999999; |
9022 | 9035 | e.preventDefault(); |
9023 | | - e.stopPropagation(); |
9024 | 9036 | }); |
9025 | 9037 | pageBar.addEventListener("click", e => { |
9026 | 9038 | changeStop(!isPause); |
|
0 commit comments