mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-02-10 18:05:06 +08:00
Fix Insert button and manual text entry in Bergamot translator
This commit is contained in:
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user