From c8bcac5f98095fbc8387f820bd19756e54e91382 Mon Sep 17 00:00:00 2001 From: "lzyme.dev@gmail.com" Date: Sun, 30 Aug 2026 11:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djavbus=E5=8F=8D=E5=A4=8D?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E6=A0=87=E9=A2=98=E7=BF=BB=E8=AF=91=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/jhs-enhance.user.js | 4 +++- src/plugins/list-page.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/jhs-enhance.user.js b/dist/jhs-enhance.user.js index 7eb325c..dad5e4f 100644 --- a/dist/jhs-enhance.user.js +++ b/dist/jhs-enhance.user.js @@ -14300,11 +14300,13 @@ ${err.stack}` : ""); } if (this.cache[carNum2]) { let _this = this; + $title.attr("data-original-title", content); $title.contents().each((function() { 3 === this.nodeType && "" !== this.textContent.trim() && (this.textContent = " " + _this.cache[carNum2] + " "); })); $title.attr("title", _this.cache[carNum2]); } else translateText(content).then(((result) => { + $title.attr("data-original-title", content); if (isJavDb$1) { $title.contents().each((function() { 3 !== this.nodeType || "" === this.textContent.trim() || this.textContent.includes(carNum2) || (this.textContent = " " + result + " "); @@ -14322,7 +14324,7 @@ ${err.stack}` : ""); async revertTranslation() { $(this.getSelector().itemSelector).toArray().forEach(((ele) => { let $box2 = $(ele); - const originalContent = $box2.find(".box").attr("title") || $box2.find(".video-title").attr("title") || $box2.find("img").attr("data-title"); + const originalContent = $box2.find(".video-title").attr("data-original-title") || $box2.find(".box").attr("title") || $box2.find(".video-title").attr("title") || $box2.find("img").attr("data-title"); let carNum2; isJavDb$1 && (carNum2 = $box2.find(".video-title strong").text().trim()); const $title = $box2.find(".video-title"); diff --git a/src/plugins/list-page.js b/src/plugins/list-page.js index cc3cc25..944ed42 100644 --- a/src/plugins/list-page.js +++ b/src/plugins/list-page.js @@ -402,11 +402,13 @@ class ListPagePlugin extends BasePlugin { } if (this.cache[carNum2]) { let _this = this; + $title.attr("data-original-title", content); $title.contents().each((function() { 3 === this.nodeType && "" !== this.textContent.trim() && (this.textContent = " " + _this.cache[carNum2] + " "); })); $title.attr("title", _this.cache[carNum2]); } else translateText(content).then((result => { + $title.attr("data-original-title", content); if (isJavDb) { $title.contents().each((function() { 3 !== this.nodeType || "" === this.textContent.trim() || this.textContent.includes(carNum2) || (this.textContent = " " + result + " "); @@ -424,7 +426,7 @@ class ListPagePlugin extends BasePlugin { async revertTranslation() { $(this.getSelector().itemSelector).toArray().forEach((ele => { let $box2 = $(ele); - const originalContent = $box2.find(".box").attr("title") || $box2.find(".video-title").attr("title") || $box2.find("img").attr("data-title"); + const originalContent = $box2.find(".video-title").attr("data-original-title") || $box2.find(".box").attr("title") || $box2.find(".video-title").attr("title") || $box2.find("img").attr("data-title"); let carNum2; isJavDb && (carNum2 = $box2.find(".video-title strong").text().trim()); const $title = $box2.find(".video-title");