From 5d718d308d73a829327b75acd89b7a825534ede8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 3 Oct 2020 12:01:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=99=BA=E5=8F=8B?= =?UTF-8?q?=E9=82=A6=E8=AE=BA=E5=9D=9B=20=E5=A2=9E=E5=BC=BA=E3=80=81?= =?UTF-8?q?=E7=BE=8E=E5=8C=96=20=E4=B8=A4=E4=B8=AA=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++ Zhiyoo-Enhanced.user.js | 54 +++++++++++++++++++++++++++++++++++ zhiyoo-Beautification.user.js | 41 ++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 Zhiyoo-Enhanced.user.js create mode 100644 zhiyoo-Beautification.user.js diff --git a/README.md b/README.md index 2650c65..b073d6a 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ * [知乎增强 - 置顶显示发布/编辑时间](https://greasyfork.org/scripts/412216) **** * [Github 增强 - 高速下载](https://greasyfork.org/scripts/412245) +**** +* [智友邦论坛 - 增强](https://greasyfork.org/scripts/412362) +* [智友邦论坛 - 美化](https://greasyfork.org/scripts/412361) **** diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js new file mode 100644 index 0000000..419f4c4 --- /dev/null +++ b/Zhiyoo-Enhanced.user.js @@ -0,0 +1,54 @@ +// ==UserScript== +// @name 智友邦论坛 - 增强 +// @version 1.0.0 +// @author X.I.U +// @description 智友邦论坛自动签到、自动回复、自动清理置顶帖子 +// @icon http://bbs.zhiyoo.net/favicon.ico +// @match *://bbs.zhiyoo.net/* +// @license GPL-3.0 License +// @run-at document-end +// @namespace https://greasyfork.org/scripts/412362 +// ==/UserScript== + +(function() { + var qiandao_Redirect_URL = `http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline`; // 签到后跳转的URL + if (location.pathname === '/plugin.php'){ + if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){ // 如果被重定向到签到页面 + if(document.getElementById("yl")) + { + document.querySelector('#yl').click(); + document.querySelector('.tr3.tac div a').click(); + } + setTimeout("location.href=qiandao_Redirect_URL", 2000); // 跳转到指定URL + } + } + else if(location.pathname === '/forum.php'){ + switch(getQueryVariable("mod")) + { + case 'viewthread': // 浏览帖子内容,自动回复,回复过就定位到底部(隐藏内容区域) + if (document.getElementsByClassName("locked").length > 0){ + document.querySelector('#saya_fastreply_div div').click(); + setTimeout("document.getElementById('fastpostsubmit').click()", 200); + } + setTimeout("location.hash='#footer'", 300); + break; + case 'forumdisplay': // 浏览帖子列表,清理置顶帖子 + var showhide = document.querySelectorAll("a.showhide.y"); + if (showhide.length > 0){ + showhide.forEach(el=>el.click()); + } + break; + } + } +})(); + +function getQueryVariable(variable) +{ + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i=0;i