From 17b05738fbcdd7abc31706404651bfca59fbbfbc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 13 Oct 2020 18:13:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E9=99=84=E5=8A=A0=E5=90=8E=E7=AB=8B=E5=8D=B3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E3=80=82=E4=BC=98=E5=8C=96=20=E5=AE=9A=E4=BD=8D=E8=87=B3?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E9=9A=90=E8=97=8F=E5=86=85=E5=AE=B9=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=95=88=E6=9E=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index c88d5ec..2a8aef0 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.0.2 +// @version 1.0.3 // @author X.I.U -// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子 +// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子等 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @grant GM_xmlhttpRequest @@ -33,14 +33,23 @@ // 用于脚本内部判断当前 URL 类型 let SiteType = { - FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID + FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID // 各板块帖子列表 }; if (location.pathname === '/plugin.php'){ - if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){ // 如果被重定向到签到页面 - qiandao(); // 自动签到 + switch(getQueryVariable("id")) + { + case 'dsu_paulsign:sign': // 被重定向到签到页面 + qiandao(); // 自动签到 + break; + case 'piaobo_attachment': // 兑换附件后的提示页面 + attachmentBack(); // 立即返回帖子 + break; } + /*if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){ + qiandao(); // 自动签到 + }*/ } else if(location.pathname === '/forum.php'){ switch(getQueryVariable("mod")) @@ -88,9 +97,19 @@ function autoReply(){ if (document.getElementsByClassName("locked").length > 0){ document.querySelector('#saya_fastreply_div div').click(); - setTimeout("document.getElementById('fastpostsubmit').click()", 200); + setTimeout(`document.getElementById('fastpostsubmit').click()`, 200); + } + setTimeout(`window.scrollTo(0,99999999)`, 1000); + //setTimeout(`location.hash='#footer'`, 1000); + } + + + // 兑换附件后立即返回 + function attachmentBack() { + var attachmentback = document.querySelector('#messagetext p.alert_btnleft a'); + if (attachmentback){ + attachmentback.click(); } - setTimeout("location.hash='#footer'", 300); } @@ -160,7 +179,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + //console.log(`${url} ${curSite.pageUrl}`); if(url === '') return; if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 curSite.pageUrl = url;