Fix Insert button and manual text entry in Bergamot translator

This commit is contained in:
Alexander Trofimov
2026-02-02 10:20:02 +03:00
parent b833582c11
commit 7d43daf30c

View File

@ -487,6 +487,14 @@
window.Asc.plugin.init = function(text) {
txt = text || "";
// Populate manual entry field with selected text
if (txt.trim() !== "") {
const enterContainer = document.getElementById("enter_container");
if (enterContainer) {
enterContainer.value = txt;
}
}
if (!isInitialized && !isInitializing) {
initializeTranslator().then(() => {
if (txt) {
@ -569,10 +577,15 @@
// DOM Ready handler
$(document).ready(function() {
// Initialize manual text entry field
const enterContainer = document.getElementById("enter_container");
if (enterContainer) {
enterContainer.value = "";
}
// Manual text entry toggle
const showManually = document.getElementById("show_manually");
const hideManually = document.getElementById("hide_manually");
const enterContainer = document.getElementById("enter_container");
if (showManually) {
showManually.addEventListener("click", function() {