From 8f3127f08a2dc032d3f63f4139bc577f8214dbaf Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 22 Oct 2020 22:36:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=80=89=E9=A1=B9=EF=BC=8C=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E7=9A=84=E5=BC=80=E5=85=B3/=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 27 ++++++++++++++++++++++++--- 52pojie-Enhanced.user.js | 27 ++++++++++++++++++++++++--- Hostloc-Enhanced.user.js | 27 ++++++++++++++++++++++++--- Zhiyoo-Enhanced.user.js | 29 ++++++++++++++++++++++++++--- 4 files changed, 98 insertions(+), 12 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 9b21012..406e13a 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -1,19 +1,40 @@ // ==UserScript== // @name 3DM论坛增强 -// @version 1.0.2 +// @version 1.0.3 // @author X.I.U // @description 自动回复、自动无缝翻页、清理置顶帖子 // @match *://bbs.3dmgame.com/* // @icon https://bbs.3dmgame.com/favicon.ico // @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_notification // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412890 // ==/UserScript== (function() { - // 是否开启帖子内自动翻页功能,true 为开启,false 为关闭。 - var thread_pageLoading = false; + // 开关帖子内自动翻页功能,true 为开启,false 为关闭,默认关闭。 + var thread_pageLoading = GM_getValue('xiu2_thread_pageLoading'); + if (thread_pageLoading == null){ + thread_pageLoading = false; + GM_setValue('xiu2_thread_pageLoading', false); + } + // 注册脚本菜单 + GM_registerMenuCommand('开关 [帖子内自动翻页] 功能', function () { + if (thread_pageLoading){ + thread_pageLoading = false; + GM_notification(`已关闭 [帖子内自动翻页] 功能\n(刷新网页后生效)`); + }else{ + thread_pageLoading = true; + GM_notification(`已开启 [帖子内自动翻页] 功能\n(刷新网页后生效)`); + } + GM_setValue('xiu2_thread_pageLoading', thread_pageLoading); + }); + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); // 随机回复帖子的内容 var replyList = [ diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 2a919ef..5511ab2 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,19 +1,40 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U // @description 自动签到、自动无缝翻页 // @match *://www.52pojie.cn/* // @icon https://www.52pojie.cn/favicon.ico // @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_notification // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412680 // ==/UserScript== (function() { - // 是否开启帖子内自动翻页功能,true 为开启,false 为关闭。 - var thread_pageLoading = true; + // 开关帖子内自动翻页功能,true 为开启,false 为关闭,默认开启。 + var thread_pageLoading = GM_getValue('xiu2_thread_pageLoading'); + if (thread_pageLoading == null){ + thread_pageLoading = true; + GM_setValue('xiu2_thread_pageLoading', true); + } + // 注册脚本菜单 + GM_registerMenuCommand('开关 [帖子内自动翻页] 功能', function () { + if (thread_pageLoading){ + thread_pageLoading = false; + GM_notification(`已关闭 [帖子内自动翻页] 功能\n(刷新网页后生效)`); + }else{ + thread_pageLoading = true; + GM_notification(`已开启 [帖子内自动翻页] 功能\n(刷新网页后生效)`); + } + GM_setValue('xiu2_thread_pageLoading', thread_pageLoading); + }); + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 351a50e..d59bd91 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,19 +1,40 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.0 +// @version 1.0.1 // @author X.I.U // @description 自动无缝翻页 // @match *://www.hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_notification // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/414005 // ==/UserScript== (function() { - // 是否开启帖子内自动翻页功能,true 为开启,false 为关闭。 - var thread_pageLoading = true; + // 开关帖子内自动翻页功能,true 为开启,false 为关闭,默认开启。 + var thread_pageLoading = GM_getValue('xiu2_thread_pageLoading'); + if (thread_pageLoading == null){ + thread_pageLoading = true; + GM_setValue('xiu2_thread_pageLoading', true); + } + // 注册脚本菜单 + GM_registerMenuCommand('开关 [帖子内自动翻页] 功能', function () { + if (thread_pageLoading){ + thread_pageLoading = false; + GM_notification(`已关闭 [帖子内自动翻页] 功能\n(刷新网页后生效)`); + }else{ + thread_pageLoading = true; + GM_notification(`已开启 [帖子内自动翻页] 功能\n(刷新网页后生效)`); + } + GM_setValue('xiu2_thread_pageLoading', thread_pageLoading); + }); + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index e4f844b..54ec824 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,11 +1,16 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U // @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_notification // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412362 @@ -15,8 +20,25 @@ // 签到后跳转的URL var qiandao_Redirect_URL = `http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline`; - // 是否开启「清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字」功能,标题中的 APP 名称完全对齐,看起来更舒服!true 为开启,false 为关闭,默认开启。 - var cleanText = true; + // 开关「清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字」功能,标题中的 APP 名称完全对齐,看起来更舒服!true 为开启,false 为关闭,默认开启。 + var cleanText = GM_getValue('xiu2_cleanText'); + if (cleanText == null){ + cleanText = true; + GM_setValue('xiu2_cleanText', true); + } + // 注册脚本菜单 + GM_registerMenuCommand('开关 [清理帖子标题开头〖〗【】文字] 功能', function () { + if (cleanText){ + cleanText = false; + GM_notification(`已关闭 [清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)`); + }else{ + cleanText = true; + GM_notification(`已开启 [清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)`); + } + GM_setValue('xiu2_cleanText', cleanText); + }); + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + // 帖子数量,避免重复清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字,用于提高效率 var postNum = 0; @@ -140,6 +162,7 @@ if (document.getElementsByClassName("showhide").length > 0){ setTimeout(`window.scrollTo(0,99999999)`, 1000); //setTimeout(`location.hash='#footer'`, 1000); + console.log(`${$(".showhide").scrollTop()}`); } } }