Files
onlyoffice.github.io/sdkjs-plugins/content/ai/annotationPopup.html
2026-01-26 16:46:36 +03:00

107 lines
4.0 KiB
HTML

<!--
(c) Copyright Ascensio System SIA 2010-2025
This program is a free software product. You can redistribute it and/or
modify it under the terms of the GNU Affero General Public License (AGPL)
version 3 as published by the Free Software Foundation. In accordance with
Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
that Ascensio System SIA expressly excludes the warranty of non-infringement
of any third-party rights.
This program is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
street, Riga, Latvia, EU, LV-1050.
The interactive user interfaces in modified source and object code versions
of the Program must display Appropriate Legal Notices, as required under
Section 5 of the GNU AGPL version 3.
Pursuant to Section 7(b) of the License you must retain the original Product
logo when distributing the program. Pursuant to Section 7(e) we decline to
grant you any rights under trademark law for use of our trademarks.
All the Product's GUI elements, including illustrations and icon sets, as
well as technical writing content are licensed under the terms of the
Creative Commons Attribution-ShareAlike 4.0 International. See the License
terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js"></script>
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js"></script>
<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">
<style id="pluginStyles"></style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Annotation popup</title>
</head>
<body>
<body style="margin:0; padding:0;">
<script>
window.Asc.plugin.init = function() {
window.Asc.plugin.sendToPlugin("onWindowReady", {});
window.Asc.plugin.attachEvent("onUpdateContent", function(obj) {
document.body.innerHTML = obj.content;
if (obj.theme) {
onThemeChanged(obj.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"];
let ballonColor = theme["canvas-background"];
let backColorElements = document.getElementsByClassName("back-color");
for (let i = 0; i < backColorElements.length; i++) {
backColorElements[i].style.background = backColor;
}
let textColorElements = document.getElementsByClassName("text-color");
for (let i = 0; i < textColorElements.length; i++) {
textColorElements[i].style.color = textColor;
}
let borderColorElements = document.getElementsByClassName("border-color");
for (let i = 0; i < borderColorElements.length; i++) {
borderColorElements[i].style.borderColor = borderColor;
}
let ballonColorElements = document.getElementsByClassName("ballon-color");
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;
}
}
</script>
</body>
</html>