Skip to content

Commit 5d718d3

Browse files
committed
新增 智友邦论坛 增强、美化 两个脚本
1 parent 063626d commit 5d718d3

3 files changed

Lines changed: 98 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* [知乎增强 - 置顶显示发布/编辑时间](https://greasyfork.org/scripts/412216)
1515
****
1616
* [Github 增强 - 高速下载](https://greasyfork.org/scripts/412245)
17+
****
18+
* [智友邦论坛 - 增强](https://greasyfork.org/scripts/412362)
19+
* [智友邦论坛 - 美化](https://greasyfork.org/scripts/412361)
1720

1821
****
1922

Zhiyoo-Enhanced.user.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// ==UserScript==
2+
// @name 智友邦论坛 - 增强
3+
// @version 1.0.0
4+
// @author X.I.U
5+
// @description 智友邦论坛自动签到、自动回复、自动清理置顶帖子
6+
// @icon http://bbs.zhiyoo.net/favicon.ico
7+
// @match *://bbs.zhiyoo.net/*
8+
// @license GPL-3.0 License
9+
// @run-at document-end
10+
// @namespace https://greasyfork.org/scripts/412362
11+
// ==/UserScript==
12+
13+
(function() {
14+
var qiandao_Redirect_URL = `http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline`; // 签到后跳转的URL
15+
if (location.pathname === '/plugin.php'){
16+
if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){ // 如果被重定向到签到页面
17+
if(document.getElementById("yl"))
18+
{
19+
document.querySelector('#yl').click();
20+
document.querySelector('.tr3.tac div a').click();
21+
}
22+
setTimeout("location.href=qiandao_Redirect_URL", 2000); // 跳转到指定URL
23+
}
24+
}
25+
else if(location.pathname === '/forum.php'){
26+
switch(getQueryVariable("mod"))
27+
{
28+
case 'viewthread': // 浏览帖子内容,自动回复,回复过就定位到底部(隐藏内容区域)
29+
if (document.getElementsByClassName("locked").length > 0){
30+
document.querySelector('#saya_fastreply_div div').click();
31+
setTimeout("document.getElementById('fastpostsubmit').click()", 200);
32+
}
33+
setTimeout("location.hash='#footer'", 300);
34+
break;
35+
case 'forumdisplay': // 浏览帖子列表,清理置顶帖子
36+
var showhide = document.querySelectorAll("a.showhide.y");
37+
if (showhide.length > 0){
38+
showhide.forEach(el=>el.click());
39+
}
40+
break;
41+
}
42+
}
43+
})();
44+
45+
function getQueryVariable(variable)
46+
{
47+
var query = window.location.search.substring(1);
48+
var vars = query.split("&");
49+
for (var i=0;i<vars.length;i++) {
50+
var pair = vars[i].split("=");
51+
if(pair[0] == variable){return pair[1];}
52+
}
53+
return(false);
54+
}

zhiyoo-Beautification.user.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// ==UserScript==
2+
// @name 智友邦论坛 - 美化
3+
// @version 1.0.0
4+
// @author X.I.U
5+
// @description 精简多余内容、宽屏显示
6+
// @icon http://bbs.zhiyoo.net/favicon.ico
7+
// @match *://bbs.zhiyoo.net/*
8+
// @license GPL-3.0 License
9+
// @run-at document-start
10+
// @namespace https://greasyfork.org/scripts/412361
11+
// ==/UserScript==
12+
13+
(function() {
14+
var style_Add = document.createElement('style');
15+
style_Add.innerHTML = `
16+
.forum_top,#main_sidebar,.drag,.nav,.tps,.bm.bml,.ct2 .sd,.mn div.box.cl:nth-of-type(3),#f_pst,.plc.plm,#diy_like1,#hm_qrcode_main,#ft,.po.bbd.reply_p,.ft_top.cl,div a[href="https://weibo.com/372458419"] {
17+
display: none;
18+
}
19+
.ct2 .mn,#wp .forum-left,#thread_types1 {
20+
width: auto;
21+
}
22+
#footer {
23+
height: 0 !important;
24+
margin: 0 !important;
25+
}
26+
#thread_subject {
27+
font-size: 19px !important;
28+
}
29+
.locked a {
30+
color: #ffffff;
31+
border: 1px dashed #ffffff;
32+
padding: 0 5px 3px;
33+
margin: 0 5px;
34+
font-size: 20px;
35+
background-color: #e24e72;
36+
}
37+
#postlist .pcb img {
38+
max-width: 30%;
39+
}`;
40+
document.head.appendChild(style_Add);
41+
})();

0 commit comments

Comments
 (0)