diff --git a/assets/css/translation.css b/assets/css/translation.css index 5610dfa3b..d3e470bdf 100644 --- a/assets/css/translation.css +++ b/assets/css/translation.css @@ -117,6 +117,12 @@ html[dir='rtl'] textarea { top: 3px; } +.copyButton { + background-color: rgba(0, 0, 0, 0); + padding: 0 3px; + top: 3px; +} + .clearButton:hover, .clearButton:focus { background-color: #eee; @@ -131,6 +137,14 @@ html[dir='rtl'] .clearButton { left: 18px; } +html[dir='ltr'] .copyButton { + right: 18px; +} + +html[dir='rtl'] .copyButton { + left: 18px; +} + html[dir='ltr'] .otherTranslationOptions > *:not(*:last-child), html[dir='rtl'] .otherTranslationOptions > *:not(*:first-child) { margin-right: 5px; diff --git a/assets/js/translator.js b/assets/js/translator.js index 34a2a1087..36686a884 100644 --- a/assets/js/translator.js +++ b/assets/js/translator.js @@ -52,6 +52,11 @@ if(modeEnabled('translation')) { synchronizeTextareaHeights(); }); + $('#copyText').click(function () { + $('#translatedText').select(); + document.execCommand('copy'); + }); + $(window).resize(synchronizeTextareaHeights); $('#originalText').blur(function () { diff --git a/html/index.html.in b/html/index.html.in index 7c376eda4..0bc95c388 100644 --- a/html/index.html.in +++ b/html/index.html.in @@ -199,6 +199,9 @@