diff --git a/views/index.html b/views/index.html index 6808cd9..ada58d4 100644 --- a/views/index.html +++ b/views/index.html @@ -70,7 +70,7 @@ {{range $key, $value := .TranslateAll}}
Engine: {{.Engine}} - {{if .AutoDetect}} Detected Language: {{.AutoDetect}}{{end}} {{if $.TtsTo}} @@ -82,7 +82,7 @@ {{end}} {{ else }} {{if .TranslationExists}}
- {{if .Translation.AutoDetect}} Detected Language: {{.Translation.AutoDetect}}{{end}} {{if .TtsTo}} @@ -94,6 +94,9 @@ {{end}} + {{ if and .Engine .From .To .OriginalText }}

Copy translation link

{{end}} @@ -111,6 +114,13 @@ var options = { searchable: true }; NiceSelect.bind(document.getElementById("targetLanguage"), options); NiceSelect.bind(document.getElementById("sourceLanguage"), options); + // This function allows to copy the translated text to the clipboard + function copyToClipboard() { + var copyText = document.getElementById("output"); + copyText.select(); + copyText.setSelectionRange(0, 99999); // This is for mobile devices. + document.execCommand("copy"); + } {{ template "footer" .}}