mirror of
https://github.com/XIU2/UserScript.git
synced 2026-07-09 10:55:22 +00:00
优化 自动无缝翻页
This commit is contained in:
+45
-11
@@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 3DM论坛增强
|
||||
// @version 1.0.9
|
||||
// @version 1.1.0
|
||||
// @author X.I.U
|
||||
// @description 自动回复、自动无缝翻页、清理置顶帖子、自动滚动至隐藏内容
|
||||
// @match *://bbs.3dmgame.com/*
|
||||
@@ -105,19 +105,37 @@
|
||||
thread: {
|
||||
SiteTypeID: 2,
|
||||
pager: {
|
||||
nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]',
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#postlist > div[id^="post_"]',
|
||||
HT_insert: ['css;div#postlist', 2],
|
||||
replaceE: '//div[@class="pg"] | //div[@class="pgbtn"]',
|
||||
replaceE: 'css;div.pg'
|
||||
}
|
||||
},
|
||||
search: {
|
||||
SiteTypeID: 3,
|
||||
pager: {
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#threadlist > ul',
|
||||
HT_insert: ['css;div#threadlist', 2],
|
||||
replaceE: 'css;div.pg'
|
||||
}
|
||||
},
|
||||
guide: {
|
||||
SiteTypeID: 3,
|
||||
SiteTypeID: 4,
|
||||
pager: {
|
||||
nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]',
|
||||
pageElement: 'css;div#threadlist div.bm_c table > tbody[id^="normalthread_"]',
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#threadlist div.bm_c table > tbody',
|
||||
HT_insert: ['css;div#threadlist div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
replaceE: 'css;div.pg'
|
||||
}
|
||||
},
|
||||
youspace: {
|
||||
SiteTypeID: 5,
|
||||
pager: {
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;tbody > tr:not(.th)',
|
||||
HT_insert: ['css;tbody', 2],
|
||||
replaceE: 'css;div.pg'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -134,22 +152,30 @@
|
||||
|
||||
// URL 匹配正则表达式
|
||||
let patt_thread = /\/thread-\d+-\d+\-\d+.html/,
|
||||
patt_forum = /\/forum-\d+-\d+\.html/,
|
||||
patt_guide = /mod\=guide\&view\=(hot|digest)/
|
||||
patt_forum = /\/forum-\d+-\d+\.html/
|
||||
|
||||
// URL 判断
|
||||
if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1){
|
||||
// 帖子内
|
||||
hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
|
||||
if(menu_value('menu_thread_pageLoading'))curSite = DBSite.thread;
|
||||
if(menu_value('menu_autoReply'))autoReply(); // 如果有隐藏内容,则自动回复
|
||||
if(menu_value('menu_scrollToShowhide'))setTimeout(function(){window.scrollTo(0,document.querySelector('.showhide').offsetTop)}, 500); // 滚动至隐藏内容
|
||||
}else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){
|
||||
} else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){
|
||||
// 各板块帖子列表
|
||||
curSite = DBSite.forum;
|
||||
if(menu_value('menu_cleanTopPost'))cleanTopPost(); // 清理置顶帖子
|
||||
}else if (patt_guide.test(location.search)){
|
||||
} else if (location.search.indexOf('mod=guide') > -1){
|
||||
// 导读帖子列表
|
||||
curSite = DBSite.guide;
|
||||
} else if (location.pathname === '/search.php') {
|
||||
// 搜索结果列表
|
||||
curSite = DBSite.search;
|
||||
} else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) {
|
||||
// 别人的主题/回复
|
||||
curSite = DBSite.youspace;
|
||||
} else {
|
||||
curSite = DBSite.forum;
|
||||
}
|
||||
|
||||
pageLoading(); // 自动翻页
|
||||
@@ -237,6 +263,14 @@
|
||||
}
|
||||
|
||||
|
||||
// 隐藏帖子内的 [下一页] 按钮
|
||||
function hidePgbtn() {
|
||||
let style_hidePgbtn = document.createElement('style');
|
||||
style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`;
|
||||
document.head.appendChild(style_hidePgbtn);
|
||||
}
|
||||
|
||||
|
||||
// 滚动条事件
|
||||
function windowScroll(fn1) {
|
||||
var beforeScrollTop = document.documentElement.scrollTop,
|
||||
|
||||
+51
-39
@@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 吾爱破解论坛增强 - 自动签到、翻页
|
||||
// @version 1.3.0
|
||||
// @version 1.3.1
|
||||
// @author X.I.U
|
||||
// @description 自动签到、自动无缝翻页、屏蔽导读悬赏贴(最新发表页)
|
||||
// @match *://www.52pojie.cn/*
|
||||
@@ -90,48 +90,15 @@
|
||||
SiteTypeID: 2,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]',
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#postlist > div[id^="post_"]',
|
||||
HT_insert: ['css;div#postlist', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 766
|
||||
}
|
||||
},
|
||||
guide: {
|
||||
SiteTypeID: 3,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]',
|
||||
pageElement: 'css;div#threadlist div.bm_c table > tbody[id^="normalthread_"]',
|
||||
HT_insert: ['css;div#threadlist div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 766
|
||||
}
|
||||
},
|
||||
collection: {
|
||||
SiteTypeID: 4,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//div[@class="pg"]//a[contains(text(),"下一页")][@href]',
|
||||
pageElement: 'css;div#ct div.bm_c table > tbody',
|
||||
HT_insert: ['css;div#ct div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 899
|
||||
}
|
||||
},
|
||||
favorite: {
|
||||
SiteTypeID: 5,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;ul#favorite_ul > li',
|
||||
HT_insert: ['css;ul#favorite_ul', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 899
|
||||
}
|
||||
},
|
||||
search: {
|
||||
SiteTypeID: 6,
|
||||
SiteTypeID: 3,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
@@ -140,13 +107,56 @@
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 766
|
||||
}
|
||||
},
|
||||
guide: {
|
||||
SiteTypeID: 4,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#threadlist div.bm_c table > tbody',
|
||||
HT_insert: ['css;div#threadlist div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 766
|
||||
}
|
||||
},
|
||||
youspace: {
|
||||
SiteTypeID: 5,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;tbody > tr:not(.th)',
|
||||
HT_insert: ['css;tbody', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 1000
|
||||
}
|
||||
},
|
||||
collection: {
|
||||
SiteTypeID: 6,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#ct div.bm_c table > tbody',
|
||||
HT_insert: ['css;div#ct div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 899
|
||||
}
|
||||
},
|
||||
favorite: {
|
||||
SiteTypeID: 7,
|
||||
pager: {
|
||||
type: 1,
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;ul#favorite_ul > li',
|
||||
HT_insert: ['css;ul#favorite_ul', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
scrollDelta: 899
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// URL 匹配正则表达式
|
||||
let patt_thread = /\/thread-\d+-\d+\-\d+.html/,
|
||||
patt_forum = /\/forum-\d+-\d+\.html/,
|
||||
patt_guide = /mod\=guide\&view\=(hot|digest|new|newthread|my|tech|help)/
|
||||
patt_forum = /\/forum-\d+-\d+\.html/
|
||||
|
||||
// URL 判断
|
||||
if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) {
|
||||
@@ -156,7 +166,7 @@
|
||||
}
|
||||
} else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1) {
|
||||
curSite = DBSite.forum; // 各板块帖子列表
|
||||
} else if (patt_guide.test(location.search)) {
|
||||
} else if (location.search.indexOf('mod=guide') > -1) {
|
||||
curSite = DBSite.guide; // 导读帖子列表
|
||||
delateReward(); // 屏蔽导读悬赏贴(最新发表)
|
||||
} else if (location.search.indexOf('mod=collection') > -1) {
|
||||
@@ -165,6 +175,8 @@
|
||||
curSite = DBSite.favorite; // 收藏列表
|
||||
} else if (location.pathname === '/search.php') {
|
||||
curSite = DBSite.search; // 搜索结果列表
|
||||
} else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
|
||||
curSite = DBSite.youspace;
|
||||
}
|
||||
curSite.pageUrl = ""; // 下一页URL
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 全球主机交流论坛增强
|
||||
// @version 1.3.2
|
||||
// @version 1.3.3
|
||||
// @author X.I.U
|
||||
// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、回帖小尾巴、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子
|
||||
// @match *://hostloc.com/*
|
||||
@@ -113,17 +113,8 @@
|
||||
replaceE: 'css;div.pg',
|
||||
}
|
||||
},
|
||||
guide: {
|
||||
SiteTypeID: 3,
|
||||
pager: {
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#threadlist div.bm_c table > tbody[id^="normalthread_"]',
|
||||
HT_insert: ['css;div#threadlist div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
}
|
||||
},
|
||||
search: {
|
||||
SiteTypeID: 4,
|
||||
SiteTypeID: 3,
|
||||
pager: {
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#threadlist > ul',
|
||||
@@ -131,10 +122,10 @@
|
||||
replaceE: 'css;div.pg'
|
||||
}
|
||||
},
|
||||
myreply: {
|
||||
guide: {
|
||||
SiteTypeID: 4,
|
||||
pager: {
|
||||
nextLink: '(//a[@class="nxt"])[1][@href]',
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;div#threadlist div.bm_c table > tbody',
|
||||
HT_insert: ['css;div#threadlist div.bm_c table', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
@@ -144,7 +135,7 @@
|
||||
SiteTypeID: 5,
|
||||
pager: {
|
||||
nextLink: '//a[@class="nxt"][@href]',
|
||||
pageElement: 'css;tbody > tr',
|
||||
pageElement: 'css;tbody > tr:not(.th)',
|
||||
HT_insert: ['css;tbody', 2],
|
||||
replaceE: 'css;div.pg',
|
||||
}
|
||||
@@ -161,8 +152,7 @@
|
||||
|
||||
// URL 匹配正则表达式
|
||||
let patt_thread = /\/thread-\d+-\d+\-\d+.html/,
|
||||
patt_forum = /\/forum-\d+-\d+\.html/,
|
||||
patt_guide = /mod\=guide\&view\=(hot|digest)/
|
||||
patt_forum = /\/forum-\d+-\d+\.html/
|
||||
|
||||
// URL 判断
|
||||
if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) { // 帖子内
|
||||
@@ -183,7 +173,7 @@
|
||||
vfastpostDOMNodeInserted(); // 监听插入事件(预览快速回复带签名)
|
||||
littleTail('forum'); // 小尾巴
|
||||
if (patt_forum.test(location.pathname)) blockDOMNodeInserted(); //监听插入事件(有新的回复主题,点击查看)
|
||||
}else if (patt_guide.test(location.search)) { // 导读帖子列表
|
||||
}else if (location.search.indexOf('mod=guide') > -1) { // 导读帖子列表
|
||||
curSite = DBSite.guide;
|
||||
} else if(location.pathname === '/search.php') { // 搜索结果列表
|
||||
curSite = DBSite.search;
|
||||
@@ -192,9 +182,7 @@
|
||||
blockUsers('notice'); // 屏蔽用户(黑名单)
|
||||
} else if(location.pathname === '/home.php' && location.search.indexOf('mod=space&do=pm') > -1) { // 消息(私人聊天)
|
||||
blockUsers('pm'); // 屏蔽用户(黑名单)
|
||||
} else if(location.pathname === '/forum.php' && location.search.indexOf('mod=guide&view=my&type=reply') > -1) { // 我的帖子:回复
|
||||
curSite = DBSite.myreply;
|
||||
} else if(location.pathname === '/home.php' && location.search.indexOf('&do=thread&view=me') > -1) { // 别人的帖子:回复
|
||||
} else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
|
||||
curSite = DBSite.youreply;
|
||||
} else if(location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=reply') > -1 || location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=newthread') > -1) { // 回复:高级回复
|
||||
littleTail('reply'); // 小尾巴
|
||||
|
||||
Reference in New Issue
Block a user