mirror of
https://github.com/fireinrain/JHS-enhance.git
synced 2026-09-28 07:36:38 +08:00
修复javbus反复开启标题翻译失效
This commit is contained in:
Vendored
+3
-1
@@ -14300,11 +14300,13 @@ ${err.stack}` : "");
|
|||||||
}
|
}
|
||||||
if (this.cache[carNum2]) {
|
if (this.cache[carNum2]) {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
|
$title.attr("data-original-title", content);
|
||||||
$title.contents().each((function() {
|
$title.contents().each((function() {
|
||||||
3 === this.nodeType && "" !== this.textContent.trim() && (this.textContent = " " + _this.cache[carNum2] + " ");
|
3 === this.nodeType && "" !== this.textContent.trim() && (this.textContent = " " + _this.cache[carNum2] + " ");
|
||||||
}));
|
}));
|
||||||
$title.attr("title", _this.cache[carNum2]);
|
$title.attr("title", _this.cache[carNum2]);
|
||||||
} else translateText(content).then(((result) => {
|
} else translateText(content).then(((result) => {
|
||||||
|
$title.attr("data-original-title", content);
|
||||||
if (isJavDb$1) {
|
if (isJavDb$1) {
|
||||||
$title.contents().each((function() {
|
$title.contents().each((function() {
|
||||||
3 !== this.nodeType || "" === this.textContent.trim() || this.textContent.includes(carNum2) || (this.textContent = " " + result + " ");
|
3 !== this.nodeType || "" === this.textContent.trim() || this.textContent.includes(carNum2) || (this.textContent = " " + result + " ");
|
||||||
@@ -14322,7 +14324,7 @@ ${err.stack}` : "");
|
|||||||
async revertTranslation() {
|
async revertTranslation() {
|
||||||
$(this.getSelector().itemSelector).toArray().forEach(((ele) => {
|
$(this.getSelector().itemSelector).toArray().forEach(((ele) => {
|
||||||
let $box2 = $(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;
|
let carNum2;
|
||||||
isJavDb$1 && (carNum2 = $box2.find(".video-title strong").text().trim());
|
isJavDb$1 && (carNum2 = $box2.find(".video-title strong").text().trim());
|
||||||
const $title = $box2.find(".video-title");
|
const $title = $box2.find(".video-title");
|
||||||
|
|||||||
@@ -402,11 +402,13 @@ class ListPagePlugin extends BasePlugin {
|
|||||||
}
|
}
|
||||||
if (this.cache[carNum2]) {
|
if (this.cache[carNum2]) {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
|
$title.attr("data-original-title", content);
|
||||||
$title.contents().each((function() {
|
$title.contents().each((function() {
|
||||||
3 === this.nodeType && "" !== this.textContent.trim() && (this.textContent = " " + _this.cache[carNum2] + " ");
|
3 === this.nodeType && "" !== this.textContent.trim() && (this.textContent = " " + _this.cache[carNum2] + " ");
|
||||||
}));
|
}));
|
||||||
$title.attr("title", _this.cache[carNum2]);
|
$title.attr("title", _this.cache[carNum2]);
|
||||||
} else translateText(content).then((result => {
|
} else translateText(content).then((result => {
|
||||||
|
$title.attr("data-original-title", content);
|
||||||
if (isJavDb) {
|
if (isJavDb) {
|
||||||
$title.contents().each((function() {
|
$title.contents().each((function() {
|
||||||
3 !== this.nodeType || "" === this.textContent.trim() || this.textContent.includes(carNum2) || (this.textContent = " " + result + " ");
|
3 !== this.nodeType || "" === this.textContent.trim() || this.textContent.includes(carNum2) || (this.textContent = " " + result + " ");
|
||||||
@@ -424,7 +426,7 @@ class ListPagePlugin extends BasePlugin {
|
|||||||
async revertTranslation() {
|
async revertTranslation() {
|
||||||
$(this.getSelector().itemSelector).toArray().forEach((ele => {
|
$(this.getSelector().itemSelector).toArray().forEach((ele => {
|
||||||
let $box2 = $(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;
|
let carNum2;
|
||||||
isJavDb && (carNum2 = $box2.find(".video-title strong").text().trim());
|
isJavDb && (carNum2 = $box2.find(".video-title strong").text().trim());
|
||||||
const $title = $box2.find(".video-title");
|
const $title = $box2.find(".video-title");
|
||||||
|
|||||||
Reference in New Issue
Block a user