diff --git a/dist/linuxdo-scripts.user.js b/dist/linuxdo-scripts.user.js index 339e093d..8eeff86c 100644 --- a/dist/linuxdo-scripts.user.js +++ b/dist/linuxdo-scripts.user.js @@ -200,12 +200,19 @@ emits: ["update:modelValue"], methods: { init() { - $(".topic-body .reply-to-tab[aria-expanded='false']").each(function() { - if (!$(this).data("clicked")) { - $(this).click(); - $(this).data("clicked", true); + const tabs = $(".reply-to-tab"); + let index = 0; + const clickNext = () => { + if (index >= tabs.length) return; + const tab = $(tabs[index]); + if (!tab.data("clicked")) { + tab.click(); + tab.data("clicked", true); } - }); + index++; + setTimeout(clickNext, 1e3); + }; + clickNext(); } }, created() { @@ -4199,7 +4206,7 @@ ${topic_contentdata}`; webdavUsername: "", webdavPassword: "" }, - themes: 0 + themes: 6 }, showautoread: false, showlookop: false, diff --git a/linuxdo-scripts.user.js b/linuxdo-scripts.user.js index 339e093d..8eeff86c 100644 --- a/linuxdo-scripts.user.js +++ b/linuxdo-scripts.user.js @@ -200,12 +200,19 @@ emits: ["update:modelValue"], methods: { init() { - $(".topic-body .reply-to-tab[aria-expanded='false']").each(function() { - if (!$(this).data("clicked")) { - $(this).click(); - $(this).data("clicked", true); + const tabs = $(".reply-to-tab"); + let index = 0; + const clickNext = () => { + if (index >= tabs.length) return; + const tab = $(tabs[index]); + if (!tab.data("clicked")) { + tab.click(); + tab.data("clicked", true); } - }); + index++; + setTimeout(clickNext, 1e3); + }; + clickNext(); } }, created() { @@ -4199,7 +4206,7 @@ ${topic_contentdata}`; webdavUsername: "", webdavPassword: "" }, - themes: 0 + themes: 6 }, showautoread: false, showlookop: false, diff --git a/src/app.vue b/src/app.vue index 913a9be5..5759016a 100644 --- a/src/app.vue +++ b/src/app.vue @@ -368,7 +368,7 @@ export default { webdavUsername: "", webdavPassword: "", }, - themes: 0, + themes: 6, }, showautoread: false, diff --git a/src/components/BasicSettings/MenuAutoexpandreply1.vue b/src/components/BasicSettings/MenuAutoexpandreply1.vue index ce3b4e1f..f4ab2614 100644 --- a/src/components/BasicSettings/MenuAutoexpandreply1.vue +++ b/src/components/BasicSettings/MenuAutoexpandreply1.vue @@ -15,24 +15,26 @@ export default { emits: ["update:modelValue"], methods: { init() { - // 遍历所有 aria-expanded 为 false 的按钮 - $(".topic-body .reply-to-tab[aria-expanded='false']").each(function () { - // 检查按钮是否已经被点击过 - if (!$(this).data("clicked")) { - // 点击按钮 - $(this).click(); + const tabs = $(".reply-to-tab"); + let index = 0; - // 设置标识为已点击 - $(this).data("clicked", true); + const clickNext = () => { + if (index >= tabs.length) return; + + const tab = $(tabs[index]); + if (!tab.data("clicked")) { + tab.click(); + tab.data("clicked", true); } - }); + index++; + setTimeout(clickNext, 1000); + }; + clickNext(); }, }, - created() { if (this.modelValue) { setInterval(() => { - // 检查是否存在按钮 if ($(".topic-body .reply-to-tab").length > 0) { this.init(); }