site/node_modules/speech-rule-engine/js/highlighter/css_highlighter.js

27 lines
866 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CssHighlighter = void 0;
const abstract_highlighter_1 = require("./abstract_highlighter");
class CssHighlighter extends abstract_highlighter_1.AbstractHighlighter {
constructor() {
super();
this.mactionName = 'mjx-maction';
}
highlightNode(node) {
const info = {
node: node,
background: node.style.backgroundColor,
foreground: node.style.color
};
const color = this.colorString();
node.style.backgroundColor = color.background;
node.style.color = color.foreground;
return info;
}
unhighlightNode(info) {
info.node.style.backgroundColor = info.background;
info.node.style.color = info.foreground;
}
}
exports.CssHighlighter = CssHighlighter;