|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 智友邦论坛增强 |
3 | | -// @version 1.0.2 |
| 3 | +// @version 1.0.3 |
4 | 4 | // @author X.I.U |
5 | | -// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子 |
| 5 | +// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子等 |
6 | 6 | // @icon http://bbs.zhiyoo.net/favicon.ico |
7 | 7 | // @match *://bbs.zhiyoo.net/* |
8 | 8 | // @grant GM_xmlhttpRequest |
|
33 | 33 |
|
34 | 34 | // 用于脚本内部判断当前 URL 类型 |
35 | 35 | let SiteType = { |
36 | | - FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID |
| 36 | + FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID // 各板块帖子列表 |
37 | 37 | }; |
38 | 38 |
|
39 | 39 |
|
40 | 40 | 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; |
43 | 49 | } |
| 50 | + /*if (location.href === 'http://bbs.zhiyoo.net/plugin.php?id=dsu_paulsign:sign'){ |
| 51 | + qiandao(); // 自动签到 |
| 52 | + }*/ |
44 | 53 | } |
45 | 54 | else if(location.pathname === '/forum.php'){ |
46 | 55 | switch(getQueryVariable("mod")) |
|
88 | 97 | function autoReply(){ |
89 | 98 | if (document.getElementsByClassName("locked").length > 0){ |
90 | 99 | 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(); |
92 | 112 | } |
93 | | - setTimeout("location.hash='#footer'", 300); |
94 | 113 | } |
95 | 114 |
|
96 | 115 |
|
|
160 | 179 | if (curSite.pager) { |
161 | 180 | let curPageEle = getElementByXpath(curSite.pager.nextLink); |
162 | 181 | var url = this.getFullHref(curPageEle); |
163 | | - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); |
| 182 | + //console.log(`${url} ${curSite.pageUrl}`); |
164 | 183 | if(url === '') return; |
165 | 184 | if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 |
166 | 185 | curSite.pageUrl = url; |
|
0 commit comments