Skip to content

Commit 8f3127f

Browse files
committed
新增 扩展菜单选项,可以方便的开关/切换功能。
1 parent df0fa69 commit 8f3127f

4 files changed

Lines changed: 98 additions & 12 deletions

File tree

3dm-Enhanced.user.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
// ==UserScript==
22
// @name 3DM论坛增强
3-
// @version 1.0.2
3+
// @version 1.0.3
44
// @author X.I.U
55
// @description 自动回复、自动无缝翻页、清理置顶帖子
66
// @match *://bbs.3dmgame.com/*
77
// @icon https://bbs.3dmgame.com/favicon.ico
88
// @grant GM_xmlhttpRequest
9+
// @grant GM_registerMenuCommand
10+
// @grant GM_openInTab
11+
// @grant GM_getValue
12+
// @grant GM_setValue
13+
// @grant GM_notification
914
// @license GPL-3.0 License
1015
// @run-at document-end
1116
// @namespace https://greasyfork.org/scripts/412890
1217
// ==/UserScript==
1318

1419
(function() {
15-
// 是否开启帖子内自动翻页功能,true 为开启,false 为关闭。
16-
var thread_pageLoading = false;
20+
// 开关帖子内自动翻页功能,true 为开启,false 为关闭,默认关闭。
21+
var thread_pageLoading = GM_getValue('xiu2_thread_pageLoading');
22+
if (thread_pageLoading == null){
23+
thread_pageLoading = false;
24+
GM_setValue('xiu2_thread_pageLoading', false);
25+
}
26+
// 注册脚本菜单
27+
GM_registerMenuCommand('开关 [帖子内自动翻页] 功能', function () {
28+
if (thread_pageLoading){
29+
thread_pageLoading = false;
30+
GM_notification(`已关闭 [帖子内自动翻页] 功能\n(刷新网页后生效)`);
31+
}else{
32+
thread_pageLoading = true;
33+
GM_notification(`已开启 [帖子内自动翻页] 功能\n(刷新网页后生效)`);
34+
}
35+
GM_setValue('xiu2_thread_pageLoading', thread_pageLoading);
36+
});
37+
GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});});
1738

1839
// 随机回复帖子的内容
1940
var replyList = [

52pojie-Enhanced.user.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
// ==UserScript==
22
// @name 吾爱破解论坛增强 - 自动签到、翻页
3-
// @version 1.0.7
3+
// @version 1.0.8
44
// @author X.I.U
55
// @description 自动签到、自动无缝翻页
66
// @match *://www.52pojie.cn/*
77
// @icon https://www.52pojie.cn/favicon.ico
88
// @grant GM_xmlhttpRequest
9+
// @grant GM_registerMenuCommand
10+
// @grant GM_openInTab
11+
// @grant GM_getValue
12+
// @grant GM_setValue
13+
// @grant GM_notification
914
// @license GPL-3.0 License
1015
// @run-at document-end
1116
// @namespace https://greasyfork.org/scripts/412680
1217
// ==/UserScript==
1318

1419
(function() {
15-
// 是否开启帖子内自动翻页功能,true 为开启,false 为关闭。
16-
var thread_pageLoading = true;
20+
// 开关帖子内自动翻页功能,true 为开启,false 为关闭,默认开启。
21+
var thread_pageLoading = GM_getValue('xiu2_thread_pageLoading');
22+
if (thread_pageLoading == null){
23+
thread_pageLoading = true;
24+
GM_setValue('xiu2_thread_pageLoading', true);
25+
}
26+
// 注册脚本菜单
27+
GM_registerMenuCommand('开关 [帖子内自动翻页] 功能', function () {
28+
if (thread_pageLoading){
29+
thread_pageLoading = false;
30+
GM_notification(`已关闭 [帖子内自动翻页] 功能\n(刷新网页后生效)`);
31+
}else{
32+
thread_pageLoading = true;
33+
GM_notification(`已开启 [帖子内自动翻页] 功能\n(刷新网页后生效)`);
34+
}
35+
GM_setValue('xiu2_thread_pageLoading', thread_pageLoading);
36+
});
37+
GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});});
1738

1839
// 默认 ID 为 0
1940
var curSite = {SiteTypeID: 0};

Hostloc-Enhanced.user.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
// ==UserScript==
22
// @name 全球主机交流论坛增强
3-
// @version 1.0.0
3+
// @version 1.0.1
44
// @author X.I.U
55
// @description 自动无缝翻页
66
// @match *://www.hostloc.com/*
77
// @icon https://www.hostloc.com/favicon.ico
88
// @grant GM_xmlhttpRequest
9+
// @grant GM_registerMenuCommand
10+
// @grant GM_openInTab
11+
// @grant GM_getValue
12+
// @grant GM_setValue
13+
// @grant GM_notification
914
// @license GPL-3.0 License
1015
// @run-at document-end
1116
// @namespace https://greasyfork.org/scripts/414005
1217
// ==/UserScript==
1318

1419
(function() {
15-
// 是否开启帖子内自动翻页功能,true 为开启,false 为关闭。
16-
var thread_pageLoading = true;
20+
// 开关帖子内自动翻页功能,true 为开启,false 为关闭,默认开启。
21+
var thread_pageLoading = GM_getValue('xiu2_thread_pageLoading');
22+
if (thread_pageLoading == null){
23+
thread_pageLoading = true;
24+
GM_setValue('xiu2_thread_pageLoading', true);
25+
}
26+
// 注册脚本菜单
27+
GM_registerMenuCommand('开关 [帖子内自动翻页] 功能', function () {
28+
if (thread_pageLoading){
29+
thread_pageLoading = false;
30+
GM_notification(`已关闭 [帖子内自动翻页] 功能\n(刷新网页后生效)`);
31+
}else{
32+
thread_pageLoading = true;
33+
GM_notification(`已开启 [帖子内自动翻页] 功能\n(刷新网页后生效)`);
34+
}
35+
GM_setValue('xiu2_thread_pageLoading', thread_pageLoading);
36+
});
37+
GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});});
1738

1839
// 默认 ID 为 0
1940
var curSite = {SiteTypeID: 0};

Zhiyoo-Enhanced.user.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
// ==UserScript==
22
// @name 智友邦论坛增强
3-
// @version 1.0.7
3+
// @version 1.0.8
44
// @author X.I.U
55
// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、清理帖子标题〖XXX〗【XXX】文字
66
// @icon http://bbs.zhiyoo.net/favicon.ico
77
// @match *://bbs.zhiyoo.net/*
88
// @grant GM_xmlhttpRequest
9+
// @grant GM_registerMenuCommand
10+
// @grant GM_openInTab
11+
// @grant GM_getValue
12+
// @grant GM_setValue
13+
// @grant GM_notification
914
// @license GPL-3.0 License
1015
// @run-at document-end
1116
// @namespace https://greasyfork.org/scripts/412362
@@ -15,8 +20,25 @@
1520
// 签到后跳转的URL
1621
var qiandao_Redirect_URL = `http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline`;
1722

18-
// 是否开启「清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字」功能,标题中的 APP 名称完全对齐,看起来更舒服!true 为开启,false 为关闭,默认开启。
19-
var cleanText = true;
23+
// 开关「清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字」功能,标题中的 APP 名称完全对齐,看起来更舒服!true 为开启,false 为关闭,默认开启。
24+
var cleanText = GM_getValue('xiu2_cleanText');
25+
if (cleanText == null){
26+
cleanText = true;
27+
GM_setValue('xiu2_cleanText', true);
28+
}
29+
// 注册脚本菜单
30+
GM_registerMenuCommand('开关 [清理帖子标题开头〖〗【】文字] 功能', function () {
31+
if (cleanText){
32+
cleanText = false;
33+
GM_notification(`已关闭 [清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)`);
34+
}else{
35+
cleanText = true;
36+
GM_notification(`已开启 [清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)`);
37+
}
38+
GM_setValue('xiu2_cleanText', cleanText);
39+
});
40+
GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});});
41+
2042
// 帖子数量,避免重复清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字,用于提高效率
2143
var postNum = 0;
2244

@@ -140,6 +162,7 @@
140162
if (document.getElementsByClassName("showhide").length > 0){
141163
setTimeout(`window.scrollTo(0,99999999)`, 1000);
142164
//setTimeout(`location.hash='#footer'`, 1000);
165+
console.log(`${$(".showhide").scrollTop()}`);
143166
}
144167
}
145168
}

0 commit comments

Comments
 (0)