Skip to content

Commit 4429755

Browse files
committed
新增 吾爱破解论坛增强、美化 两个脚本
1 parent ea6046d commit 4429755

3 files changed

Lines changed: 155 additions & 0 deletions

File tree

52pojie-Beautification.user.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// ==UserScript==
2+
// @name 吾爱破解论坛美化 - 精简多余内容
3+
// @version 1.0.0
4+
// @author X.I.U
5+
// @description 精简多余内容
6+
// @match *://www.52pojie.cn/*
7+
// @icon https://www.52pojie.cn/favicon.ico
8+
// @license GPL-3.0 License
9+
// @run-at document-start
10+
// @namespace https://github.com/XIU2/UserScript/blob/master/52pojie-Beautification.user.js
11+
// ==/UserScript==
12+
13+
(function() {
14+
var style_Add = document.createElement('style');
15+
style_Add.innerHTML = `
16+
a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #online, #ft, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, .bml, ul.xl.xl2.o.cl, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .bm_h.cl, .md_ctrl, .pls.favatar .xg1 {
17+
display:none !important;
18+
}
19+
/*.wp {
20+
width:70%;
21+
}*/
22+
@media (max-width:650px) {
23+
#postlist .favatar.pls .avatar img {
24+
margin:0 0 2px;
25+
}
26+
.pls .avatar img {
27+
width:100px;
28+
height:100px;
29+
background:none;
30+
padding:0;
31+
border:4px solid #ffffff
32+
}
33+
.avtm img {
34+
width:60px;
35+
}
36+
}
37+
.pls .avatar {
38+
text-align:center;
39+
}
40+
.t_fsz {
41+
min-height:60px;
42+
}
43+
.pls .pi {
44+
text-align:center;
45+
padding:10px 0 0 0;
46+
border:none;
47+
overflow:visible;
48+
}
49+
.xw1 {
50+
font-size:15px;
51+
}
52+
textarea#fastpostmessage {
53+
background:none !important;
54+
}
55+
.pcb img {
56+
max-width:60%;
57+
margin:4px;
58+
}
59+
.rate {
60+
margin:0;
61+
}
62+
.ratl td {
63+
padding:0px;
64+
}
65+
.xw1 {
66+
font-size:12px;
67+
font-weight:500;
68+
}
69+
.xi2,.xi2 a,.xi3 a {
70+
color:red;
71+
}
72+
.toptitle_7ree td {
73+
border-top: 1px solid #CDCDCD;
74+
}
75+
.mtw {
76+
margin-top:0px !important;
77+
}
78+
79+
#p_btn {
80+
padding:0px;
81+
margin:0 0 0 1px;
82+
display:flex;
83+
justify-content:space-evenly;
84+
}
85+
#scbar {
86+
border-top:0;
87+
border-bottom:0;
88+
background:0;
89+
}`;
90+
document.head.appendChild(style_Add);
91+
})();

52pojie-Enhanced.user.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// ==UserScript==
2+
// @name 吾爱破解论坛增强 - 自动签到、翻页
3+
// @version 1.0.0
4+
// @author X.I.U
5+
// @description 吾爱破解论坛自动签到、自动翻页
6+
// @match *://www.52pojie.cn/*
7+
// @icon https://www.52pojie.cn/favicon.ico
8+
// @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
9+
// @license GPL-3.0 License
10+
// @run-at document-end
11+
// @namespace https://github.com/XIU2/UserScript/blob/master/52pojie-Enhanced.user.js
12+
// ==/UserScript==
13+
14+
(function() {
15+
qianDao();
16+
pageLoading();
17+
18+
// 自动签到
19+
function qianDao() {
20+
var qiandao = document.querySelector('#um p:last-child a:first-child');
21+
if (qiandao != null){
22+
if(qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2")
23+
{
24+
qiandao.click();
25+
}
26+
}
27+
}
28+
29+
// 自动翻页
30+
function pageLoading() {
31+
var patt = /forum-\d+-\d+\.html/
32+
if (patt.test(location.pathname)){
33+
windowScroll(function (direction, e) {
34+
if (direction === "down") { // 下滑才准备翻页
35+
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
36+
let scrollDelta = 666;
37+
if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) {
38+
if (document.querySelector('#autopbn').innerText == "下一页 »"){ // 如果已经在加载中了,就忽略
39+
document.querySelector('#autopbn').click();
40+
}
41+
}
42+
}
43+
});
44+
}
45+
}
46+
47+
// 滚动条事件
48+
function windowScroll(fn) {
49+
var beforeScrollTop = document.documentElement.scrollTop,
50+
fn = fn || function () {};
51+
setTimeout(function () { // 延时执行,避免刚载入到页面就触发翻页事件
52+
window.addEventListener("scroll", function (e) {
53+
var afterScrollTop = document.documentElement.scrollTop,
54+
delta = afterScrollTop - beforeScrollTop;
55+
if (delta == 0) return false;
56+
fn(delta > 0 ? "down" : "up", e);
57+
beforeScrollTop = afterScrollTop;
58+
}, false);
59+
}, 1000)
60+
}
61+
})();

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** [智友邦论坛美化 - 精简多余内容、宽屏显示](https://greasyfork.org/scripts/412361)
2121
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** [智友邦论坛增强 - 自动签到、回复、清理置顶帖子](https://greasyfork.org/scripts/412362)
2222
****
23+
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** [吾爱破解论坛美化 - 精简多余内容](https://greasyfork.org/scripts/412681)
24+
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** [吾爱破解论坛增强 - 自动签到、翻页](https://greasyfork.org/scripts/412680)
25+
****
2326
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** [Github 增强 - 高速下载 \[Clone、Release、Raw、Code(ZIP)\]](https://greasyfork.org/scripts/412245)
2427

2528
****

0 commit comments

Comments
 (0)