优化 功能开关通知 3 秒后自动关闭(隐藏)

This commit is contained in:
xiu2
2021-03-05 09:31:35 +08:00
parent 738078050d
commit 9f42f2838b
9 changed files with 35 additions and 35 deletions
+10 -10
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 3DM论坛增强
// @version 1.0.6
// @version 1.0.7
// @author X.I.U
// @description 自动回复、自动无缝翻页、清理置顶帖子
// @match *://bbs.3dmgame.com/*
@@ -60,10 +60,10 @@
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
@@ -124,9 +124,9 @@
// 用于脚本内部判断当前 URL 类型
let SiteType = {
FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表
FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表
THREAD: DBSite.thread.SiteTypeID, // 帖子内
GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表
GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表
};
// 下一页URL
@@ -145,18 +145,18 @@
if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){
// 帖子内
if(menu_thread_pageLoading)curSite = DBSite.thread;
if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复
pageLoading(); // 自动翻页
if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复
pageLoading(); // 自动翻页
if(menu_scrollToShowhide)setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); // 滚动至隐藏内容
}else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){
// 各板块帖子列表
curSite = DBSite.forum;
if(menu_cleanTopPost)cleanTopPost(); // 清理置顶帖子
pageLoading(); // 自动翻页
if(menu_cleanTopPost)cleanTopPost(); // 清理置顶帖子
pageLoading(); // 自动翻页
}else if (patt_guide.test(location.search)){
// 导读帖子列表
curSite = DBSite.guide;
pageLoading(); // 自动翻页
pageLoading(); // 自动翻页
}
+3 -3
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 吾爱破解论坛美化
// @version 1.0.4
// @version 1.0.5
// @author X.I.U
// @description 精简多余内容
// @match *://www.52pojie.cn/*
@@ -42,10 +42,10 @@
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
+3 -3
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 吾爱破解论坛增强 - 自动签到、翻页
// @version 1.2.1
// @version 1.2.2
// @author X.I.U
// @description 自动签到、自动无缝翻页(全站)
// @match *://www.52pojie.cn/*
@@ -48,10 +48,10 @@
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`, '吾爱破解论坛增强');
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`, '吾爱破解论坛增强');
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
+2 -2
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Github 增强 - 高速下载
// @version 1.3.8
// @version 1.3.9
// @author X.I.U
// @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁)
// @match *://github.com/*
@@ -80,7 +80,7 @@
GM_setValue('xiu2_menu_raw_fast', menu_raw_fast);
delRawDownLink(); // 删除旧加速源
addRawDownLink(); // 添加新加速源
GM_notification(`已切换加速源为:${raw_url[menu_raw_fast][1]}`); // 提示消息
GM_notification({text: "已切换加速源为:" + raw_url[menu_raw_fast][1], timeout: 3000}); // 提示消息
registerMenuCommand(); // 重新注册脚本菜单
};
+3 -3
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 全球主机交流论坛增强
// @version 1.0.4
// @version 1.0.5
// @author X.I.U
// @description 自动无缝翻页、自动显示帖子内被隐藏的回复
// @match *://www.hostloc.com/*
@@ -48,10 +48,10 @@
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
+3 -3
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 蓝奏云网盘增强
// @version 1.2.1
// @version 1.2.2
// @author X.I.U
// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小
// @match *://*.lanzous.com/*
@@ -82,10 +82,10 @@
}
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能${RefreshTips}`);
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能${RefreshTips}`);
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
+4 -4
View File
@@ -1,8 +1,8 @@
// ==UserScript==
// @name 知乎美化
// @version 1.0.5
// @version 1.0.6
// @author X.I.U
// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致
// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致
// @match *://www.zhihu.com/*
// @match *://zhuanlan.zhihu.com/p/*
// @icon https://static.zhihu.com/heifetz/favicon.ico
@@ -43,10 +43,10 @@
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
+3 -3
View File
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 知乎增强
// @version 1.2.2
// @version 1.2.3
// @author X.I.U
// @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链
// @match *://www.zhihu.com/*
@@ -59,10 +59,10 @@ function registerMenuCommand() {
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`);
GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};
+4 -4
View File
@@ -39,8 +39,8 @@
if (menu_cleanPostTitle){menu_cleanPostTitle_ = "√";}else{menu_cleanPostTitle_ = "×";}
menu_cleanPostTitle_ID = GM_registerMenuCommand(`[ ${menu_cleanPostTitle_} ] 清理帖子标题开头〖〗【】文字`, function(){menu_switch(menu_cleanPostTitle,'xiu2_menu_cleanPostTitle','[清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)')});
menu_qianDaoRedirectURL_ID = GM_registerMenuCommand(`当前页面设为签到后重定向地址`, function(){GM_setValue('xiu2_menu_qianDaoRedirectURL', location.href);GM_notification(`已设置当前页面为签到后重定向地址`);})
menu_cleanPostTitle_ID = GM_registerMenuCommand(`[ ${menu_cleanPostTitle_} ] 清理帖子标题开头〖〗【】文字`, function(){menu_switch(menu_cleanPostTitle,'xiu2_menu_cleanPostTitle','清理帖子标题开头〖〗【】文字')});
menu_qianDaoRedirectURL_ID = GM_registerMenuCommand(`当前页面设为签到后重定向地址`, function(){GM_setValue('xiu2_menu_qianDaoRedirectURL', location.href);GM_notification({text: `已设置当前页面为签到后重定向地址`, timeout: 3000});;})
menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});});
}
@@ -48,10 +48,10 @@
function menu_switch(menu_status, Name, Tips) {
if (menu_status){
GM_setValue(`${Name}`, false);
GM_notification(`已关闭 ${Tips}`);
GM_notification({text: `已关闭 [${Tips}] 功能(刷新网页后生效)`, timeout: 3500});
}else{
GM_setValue(`${Name}`, true);
GM_notification(`已开启 ${Tips}`);
GM_notification({text: `已开启 [${Tips}] 功能(刷新网页后生效)`, timeout: 3500});
}
registerMenuCommand(); // 重新注册脚本菜单
};