Skip to content

Commit 9f42f28

Browse files
committed
优化 功能开关通知 3 秒后自动关闭(隐藏)
1 parent 7380780 commit 9f42f28

9 files changed

Lines changed: 35 additions & 35 deletions

3dm-Enhanced.user.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 3DM论坛增强
3-
// @version 1.0.6
3+
// @version 1.0.7
44
// @author X.I.U
55
// @description 自动回复、自动无缝翻页、清理置顶帖子
66
// @match *://bbs.3dmgame.com/*
@@ -60,10 +60,10 @@
6060
function menu_switch(menu_status, Name, Tips) {
6161
if (menu_status){
6262
GM_setValue(`${Name}`, false);
63-
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
63+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
6464
}else{
6565
GM_setValue(`${Name}`, true);
66-
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
66+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
6767
}
6868
registerMenuCommand(); // 重新注册脚本菜单
6969
};
@@ -124,9 +124,9 @@
124124

125125
// 用于脚本内部判断当前 URL 类型
126126
let SiteType = {
127-
FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表
127+
FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表
128128
THREAD: DBSite.thread.SiteTypeID, // 帖子内
129-
GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表
129+
GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表
130130
};
131131

132132
// 下一页URL
@@ -145,18 +145,18 @@
145145
if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){
146146
// 帖子内
147147
if(menu_thread_pageLoading)curSite = DBSite.thread;
148-
if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复
149-
pageLoading(); // 自动翻页
148+
if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复
149+
pageLoading(); // 自动翻页
150150
if(menu_scrollToShowhide)setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); // 滚动至隐藏内容
151151
}else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){
152152
// 各板块帖子列表
153153
curSite = DBSite.forum;
154-
if(menu_cleanTopPost)cleanTopPost(); // 清理置顶帖子
155-
pageLoading(); // 自动翻页
154+
if(menu_cleanTopPost)cleanTopPost(); // 清理置顶帖子
155+
pageLoading(); // 自动翻页
156156
}else if (patt_guide.test(location.search)){
157157
// 导读帖子列表
158158
curSite = DBSite.guide;
159-
pageLoading(); // 自动翻页
159+
pageLoading(); // 自动翻页
160160
}
161161

162162

52pojie-Beautification.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 吾爱破解论坛美化
3-
// @version 1.0.4
3+
// @version 1.0.5
44
// @author X.I.U
55
// @description 精简多余内容
66
// @match *://www.52pojie.cn/*
@@ -42,10 +42,10 @@
4242
function menu_switch(menu_status, Name, Tips) {
4343
if (menu_status){
4444
GM_setValue(`${Name}`, false);
45-
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
45+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
4646
}else{
4747
GM_setValue(`${Name}`, true);
48-
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
48+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
4949
}
5050
registerMenuCommand(); // 重新注册脚本菜单
5151
};

52pojie-Enhanced.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 吾爱破解论坛增强 - 自动签到、翻页
3-
// @version 1.2.1
3+
// @version 1.2.2
44
// @author X.I.U
55
// @description 自动签到、自动无缝翻页(全站)
66
// @match *://www.52pojie.cn/*
@@ -48,10 +48,10 @@
4848
function menu_switch(menu_status, Name, Tips) {
4949
if (menu_status){
5050
GM_setValue(`${Name}`, false);
51-
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`, '吾爱破解论坛增强');
51+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500});
5252
}else{
5353
GM_setValue(`${Name}`, true);
54-
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`, '吾爱破解论坛增强');
54+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500});
5555
}
5656
registerMenuCommand(); // 重新注册脚本菜单
5757
};

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Github 增强 - 高速下载
3-
// @version 1.3.8
3+
// @version 1.3.9
44
// @author X.I.U
55
// @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁)
66
// @match *://github.com/*
@@ -80,7 +80,7 @@
8080
GM_setValue('xiu2_menu_raw_fast', menu_raw_fast);
8181
delRawDownLink(); // 删除旧加速源
8282
addRawDownLink(); // 添加新加速源
83-
GM_notification(`已切换加速源为:${raw_url[menu_raw_fast][1]}`); // 提示消息
83+
GM_notification({text: "已切换加速源为:" + raw_url[menu_raw_fast][1], timeout: 3000}); // 提示消息
8484
registerMenuCommand(); // 重新注册脚本菜单
8585
};
8686

Hostloc-Enhanced.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 全球主机交流论坛增强
3-
// @version 1.0.4
3+
// @version 1.0.5
44
// @author X.I.U
55
// @description 自动无缝翻页、自动显示帖子内被隐藏的回复
66
// @match *://www.hostloc.com/*
@@ -48,10 +48,10 @@
4848
function menu_switch(menu_status, Name, Tips) {
4949
if (menu_status){
5050
GM_setValue(`${Name}`, false);
51-
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
51+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
5252
}else{
5353
GM_setValue(`${Name}`, true);
54-
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
54+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
5555
}
5656
registerMenuCommand(); // 重新注册脚本菜单
5757
};

Lanzou-Enhanced.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 蓝奏云网盘增强
3-
// @version 1.2.1
3+
// @version 1.2.2
44
// @author X.I.U
55
// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小
66
// @match *://*.lanzous.com/*
@@ -82,10 +82,10 @@
8282
}
8383
if (menu_status){
8484
GM_setValue(`${Name}`, false);
85-
GM_notification(`已关闭 [${Tips}] 功能${RefreshTips}`);
85+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
8686
}else{
8787
GM_setValue(`${Name}`, true);
88-
GM_notification(`已开启 [${Tips}] 功能${RefreshTips}`);
88+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
8989
}
9090
registerMenuCommand(); // 重新注册脚本菜单
9191
};

Zhihu-Beautification.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 知乎美化
3-
// @version 1.0.5
3+
// @version 1.0.6
44
// @author X.I.U
5-
// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致
5+
// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致
66
// @match *://www.zhihu.com/*
77
// @match *://zhuanlan.zhihu.com/p/*
88
// @icon https://static.zhihu.com/heifetz/favicon.ico
@@ -43,10 +43,10 @@
4343
function menu_switch(menu_status, Name, Tips) {
4444
if (menu_status){
4545
GM_setValue(`${Name}`, false);
46-
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
46+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
4747
}else{
4848
GM_setValue(`${Name}`, true);
49-
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
49+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
5050
}
5151
registerMenuCommand(); // 重新注册脚本菜单
5252
};

Zhihu-Enhanced.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 知乎增强
3-
// @version 1.2.2
3+
// @version 1.2.3
44
// @author X.I.U
55
// @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链
66
// @match *://www.zhihu.com/*
@@ -59,10 +59,10 @@ function registerMenuCommand() {
5959
function menu_switch(menu_status, Name, Tips) {
6060
if (menu_status){
6161
GM_setValue(`${Name}`, false);
62-
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
62+
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
6363
}else{
6464
GM_setValue(`${Name}`, true);
65-
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
65+
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
6666
}
6767
registerMenuCommand(); // 重新注册脚本菜单
6868
};

Zhiyoo-Enhanced.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@
3939

4040
if (menu_cleanPostTitle){menu_cleanPostTitle_ = "√";}else{menu_cleanPostTitle_ = "×";}
4141

42-
menu_cleanPostTitle_ID = GM_registerMenuCommand(`[ ${menu_cleanPostTitle_} ] 清理帖子标题开头〖〗【】文字`, function(){menu_switch(menu_cleanPostTitle,'xiu2_menu_cleanPostTitle','[清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)')});
43-
menu_qianDaoRedirectURL_ID = GM_registerMenuCommand(`当前页面设为签到后重定向地址`, function(){GM_setValue('xiu2_menu_qianDaoRedirectURL', location.href);GM_notification(`已设置当前页面为签到后重定向地址`);})
42+
menu_cleanPostTitle_ID = GM_registerMenuCommand(`[ ${menu_cleanPostTitle_} ] 清理帖子标题开头〖〗【】文字`, function(){menu_switch(menu_cleanPostTitle,'xiu2_menu_cleanPostTitle','清理帖子标题开头〖〗【】文字')});
43+
menu_qianDaoRedirectURL_ID = GM_registerMenuCommand(`当前页面设为签到后重定向地址`, function(){GM_setValue('xiu2_menu_qianDaoRedirectURL', location.href);GM_notification({text: `已设置当前页面为签到后重定向地址`, timeout: 3000});;})
4444
menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});});
4545
}
4646

4747
// 菜单开关
4848
function menu_switch(menu_status, Name, Tips) {
4949
if (menu_status){
5050
GM_setValue(`${Name}`, false);
51-
GM_notification(`已关闭 ${Tips}`);
51+
GM_notification({text: `已关闭 [${Tips}] 功能(刷新网页后生效)`, timeout: 3500});
5252
}else{
5353
GM_setValue(`${Name}`, true);
54-
GM_notification(`已开启 ${Tips}`);
54+
GM_notification({text: `已开启 [${Tips}] 功能(刷新网页后生效)`, timeout: 3500});
5555
}
5656
registerMenuCommand(); // 重新注册脚本菜单
5757
};

0 commit comments

Comments
 (0)