新增 智友邦论坛 增强、美化 两个脚本

This commit is contained in:
xiu2
2020-10-03 12:01:24 +08:00
parent 063626d297
commit 5d718d308d
3 changed files with 98 additions and 0 deletions
+3
View File
@@ -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)
****
+54
View File
@@ -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<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
+41
View File
@@ -0,0 +1,41 @@
// ==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-start
// @namespace https://greasyfork.org/scripts/412361
// ==/UserScript==
(function() {
var style_Add = document.createElement('style');
style_Add.innerHTML = `
.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"] {
display: none;
}
.ct2 .mn,#wp .forum-left,#thread_types1 {
width: auto;
}
#footer {
height: 0 !important;
margin: 0 !important;
}
#thread_subject {
font-size: 19px !important;
}
.locked a {
color: #ffffff;
border: 1px dashed #ffffff;
padding: 0 5px 3px;
margin: 0 5px;
font-size: 20px;
background-color: #e24e72;
}
#postlist .pcb img {
max-width: 30%;
}`;
document.head.appendChild(style_Add);
})();