feat: add text additional styles to rule
This commit is contained in:
@@ -56,6 +56,7 @@ export const matchRule = async (href, { injectRules, subrulesList }) => {
|
||||
"aiTerms",
|
||||
"termsStyle",
|
||||
"highlightStyle",
|
||||
"textExtStyle",
|
||||
"selectStyle",
|
||||
"parentStyle",
|
||||
"grandStyle",
|
||||
@@ -150,6 +151,7 @@ export const checkRules = (rules) => {
|
||||
aiTerms,
|
||||
termsStyle,
|
||||
highlightStyle,
|
||||
textExtStyle,
|
||||
selectStyle,
|
||||
parentStyle,
|
||||
grandStyle,
|
||||
@@ -189,6 +191,7 @@ export const checkRules = (rules) => {
|
||||
aiTerms: type(aiTerms) === "string" ? aiTerms : "",
|
||||
termsStyle: type(termsStyle) === "string" ? termsStyle : "",
|
||||
highlightStyle: type(highlightStyle) === "string" ? highlightStyle : "",
|
||||
textExtStyle: type(textExtStyle) === "string" ? textExtStyle : "",
|
||||
selectStyle: type(selectStyle) === "string" ? selectStyle : "",
|
||||
parentStyle: type(parentStyle) === "string" ? parentStyle : "",
|
||||
grandStyle: type(grandStyle) === "string" ? grandStyle : "",
|
||||
|
||||
@@ -1153,6 +1153,7 @@ export class Translator {
|
||||
transEndHook,
|
||||
transOnly,
|
||||
termsStyle,
|
||||
textExtStyle,
|
||||
selectStyle,
|
||||
parentStyle,
|
||||
grandStyle,
|
||||
@@ -1187,6 +1188,9 @@ export class Translator {
|
||||
|
||||
const inner = document.createElement(transTag);
|
||||
inner.className = `${Translator.KISS_CLASS.inner} ${this.#textClass[textStyle]}`;
|
||||
if (textExtStyle?.trim()) {
|
||||
inner.style.cssText = textExtStyle; // 附加内联样式
|
||||
}
|
||||
inner.appendChild(createLoadingSVG());
|
||||
wrapper.appendChild(inner);
|
||||
nodes[nodes.length - 1].after(wrapper);
|
||||
|
||||
Reference in New Issue
Block a user