Skip to content

Commit 17b0573

Browse files
committed
新增 兑换附加后立即返回。优化 定位至底部隐藏内容区域效果。
1 parent 624c3ae commit 17b0573

1 file changed

Lines changed: 27 additions & 8 deletions

File tree

Zhiyoo-Enhanced.user.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 智友邦论坛增强
3-
// @version 1.0.2
3+
// @version 1.0.3
44
// @author X.I.U
5-
// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子
5+
// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子等
66
// @icon http://bbs.zhiyoo.net/favicon.ico
77
// @match *://bbs.zhiyoo.net/*
88
// @grant GM_xmlhttpRequest
@@ -33,14 +33,23 @@
3333

3434
// 用于脚本内部判断当前 URL 类型
3535
let SiteType = {
36-
FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID
36+
FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID // 各板块帖子列表
3737
};
3838

3939

4040
if (location.pathname === '/plugin.php'){
41-
if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){ // 如果被重定向到签到页面
42-
qiandao(); // 自动签到
41+
switch(getQueryVariable("id"))
42+
{
43+
case 'dsu_paulsign:sign': // 被重定向到签到页面
44+
qiandao(); // 自动签到
45+
break;
46+
case 'piaobo_attachment': // 兑换附件后的提示页面
47+
attachmentBack(); // 立即返回帖子
48+
break;
4349
}
50+
/*if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){
51+
qiandao(); // 自动签到
52+
}*/
4453
}
4554
else if(location.pathname === '/forum.php'){
4655
switch(getQueryVariable("mod"))
@@ -88,9 +97,19 @@
8897
function autoReply(){
8998
if (document.getElementsByClassName("locked").length > 0){
9099
document.querySelector('#saya_fastreply_div div').click();
91-
setTimeout("document.getElementById('fastpostsubmit').click()", 200);
100+
setTimeout(`document.getElementById('fastpostsubmit').click()`, 200);
101+
}
102+
setTimeout(`window.scrollTo(0,99999999)`, 1000);
103+
//setTimeout(`location.hash='#footer'`, 1000);
104+
}
105+
106+
107+
// 兑换附件后立即返回
108+
function attachmentBack() {
109+
var attachmentback = document.querySelector('#messagetext p.alert_btnleft a');
110+
if (attachmentback){
111+
attachmentback.click();
92112
}
93-
setTimeout("location.hash='#footer'", 300);
94113
}
95114

96115

@@ -160,7 +179,7 @@
160179
if (curSite.pager) {
161180
let curPageEle = getElementByXpath(curSite.pager.nextLink);
162181
var url = this.getFullHref(curPageEle);
163-
//console.log(`${url} ${curPageEle} ${curSite.pageUrl}`);
182+
//console.log(`${url} ${curSite.pageUrl}`);
164183
if(url === '') return;
165184
if(curSite.pageUrl === url) return;// 不会重复加载相同的页面
166185
curSite.pageUrl = url;

0 commit comments

Comments
 (0)