diff --git a/sdkjs-plugins/content/ai/annotationPopup.html b/sdkjs-plugins/content/ai/annotationPopup.html
index 2a08b744..e4c32124 100644
--- a/sdkjs-plugins/content/ai/annotationPopup.html
+++ b/sdkjs-plugins/content/ai/annotationPopup.html
@@ -34,6 +34,7 @@
+
Annotation popup
@@ -45,13 +46,15 @@
window.Asc.plugin.sendToPlugin("onWindowReady", {});
window.Asc.plugin.attachEvent("onUpdateContent", function(obj) {
document.body.innerHTML = obj.content;
- document.querySelectorAll('strong').forEach(function(el){
- el.style.color = obj.color;
- });
+ if (obj.theme) {
+ onThemeChanged(obj.theme);
+ }
});
};
- window.Asc.plugin.attachEvent("onThemeChanged", function(theme) {
+ window.Asc.plugin.attachEvent("onThemeChanged", onThemeChanged);
+
+ function onThemeChanged(theme) {
let backColor = theme["background-normal"];
let textColor = theme["text-normal"];
let borderColor = theme["border-divider"];
@@ -76,7 +79,29 @@
for (let i = 0; i < ballonColorElements.length; i++) {
ballonColorElements[i].style.background = ballonColor;
}
- });
+
+ let textRules =
+ ".original { color: " +
+ theme["border-error"] +
+ "; }\n";
+ if (theme.name !== "theme-white" && theme.name !== "theme-night") {
+ textRules +=
+ ".corrected strong { color: " +
+ "#009900" +
+ "; }\n";
+ }
+ textRules += ".corrected strong { font-weight:normal; }\n";
+
+ let styleTheme = document.getElementById("pluginStyles");
+ if (!styleTheme) {
+ styleTheme = document.createElement("style");
+ styleTheme.id = "pluginStyles";
+ styleTheme.innerHTML = textRules;
+ document.getElementsByTagName("head")[0].appendChild(styleTheme);
+ } else {
+ styleTheme.innerHTML = textRules;
+ }
+ }