From 034fe3e9d7b514d26b45fb9fe37f7cc6d57ea034 Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 6 Apr 2020 22:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=B8=96=E5=AD=90=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E7=9C=8B=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tieba page.js b/tieba page.js index 8ba3dc4..89fcfeb 100644 --- a/tieba page.js +++ b/tieba page.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tieba page // @namespace https://github.com/fthvgb1/tampermonkey-script -// @version 0.993 +// @version 0.994 // @author fthvgb1 // @match https://tieba.baidu.com/* // @match https://tiebac.baidu.com/* @@ -20,7 +20,7 @@ let imgs = v.querySelectorAll('img.BDE_Image'); if (imgs.length > 0) { imgs.forEach(img => { - let src = img.src; + let src = img.src.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc'); let s = /&src=(.*)/.exec(src); if (s != null) { let x = s.length > 0 ? s[1] : src; @@ -38,6 +38,7 @@ let imgs = v.querySelectorAll('div[data-class="BDE_Image"]'); if (imgs.length > 0) { imgs.forEach(value => { + let o = value.getAttribute('data-url').replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc'); let src = decodeURIComponent(value.getAttribute('data-url')); let s = /&src=(.*)/.exec(src); if (s != null) { @@ -45,7 +46,7 @@ let img = document.createElement('img'); img.src = (ss); img.className = 'BDE_Image'; - img.setAttribute('data-src', src); + img.setAttribute('data-src', o); img.setAttribute('data-ss', ss); value.outerHTML = `
${img.outerHTML}
`; } @@ -424,8 +425,12 @@ if (!tar) { return; } + let ki = li.querySelector('span[class="tb_icon_author_rely j_replyer"]'); + if (!ki) { + return; + } - ttt.innerHTML = li.querySelector('span[class="tb_icon_author_rely j_replyer"]').title.split(':')[1] + '  ' + ttt.innerHTML; + ttt.innerHTML = ki.title.split(':')[1] + '  ' + ttt.innerHTML; let d = document.createElement('span'); d.style.marginLeft = '1rem'; @@ -458,11 +463,11 @@ li.addEventListener('touchend', evt => { if ((endX - startX) > 100 && Math.abs(endY - startY) <= 100) { - let url = li.querySelector('li.tl_shadow>a[data-thread-type="0"]').dataset.url; + let url = li.querySelector('li.tl_shadow>a.ti_item').dataset.url; window.open(url, '_blank'); } if ((startX - endX) > 100 && Math.abs(endY - startY) <= 100) { - location.href = li.querySelector('li.tl_shadow>a[data-thread-type="0"]').dataset.url; + location.href = li.querySelector('li.tl_shadow>a.ti_item').dataset.url; } }) }) @@ -506,7 +511,7 @@ }); function op() { - let lis = document.querySelectorAll('li.tl_shadow>a[data-thread-type="0"]'); + let lis = document.querySelectorAll('li.tl_shadow>a.ti_item'); if (lis.length > 0) { lis.forEach(value => { let url = value.href; @@ -539,6 +544,10 @@ m.target.style.display = 'block'; m.target.style.visibility = 'hidden'; window.hhxx = 1; + let ui = document.querySelector('.ui_slider_hybrid'); + if (ui.style.display === 'block') { + ui.style.top = '-44px'; + } }, 300); } });