From 81c02c9549f7d926059104f9014d636cc3ff025c Mon Sep 17 00:00:00 2001 From: idotj Date: Fri, 11 Jun 2021 19:55:39 +0200 Subject: [PATCH 1/5] Translated textarea read only --- app/templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/index.html b/app/templates/index.html index 404ea64..4f2832d 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -143,7 +143,7 @@
- + From 53bf91ead7e4e4d22e8ff477730d6876f9f1ee84 Mon Sep 17 00:00:00 2001 From: idotj Date: Fri, 11 Jun 2021 20:05:59 +0200 Subject: [PATCH 2/5] Add rel noopener/noreferrer to external links --- app/templates/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/templates/index.html b/app/templates/index.html index 4f2832d..45f08d1 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -42,7 +42,7 @@
-
+
@@ -184,13 +184,13 @@
{% if web_version %} -
+

Open Source Machine Translation

100% Self-Hosted. No Limits. No Ties to Proprietary Services.

-
cloud_download Download +
cloud_download Download


@@ -206,11 +206,11 @@
LibreTranslate

Free and Open Source Machine Translation API

-

License: AGPLv3

+

License: AGPLv3

JavaScript license information

{% if web_version %}

- The public API on libretranslate.com should be used for testing, personal or infrequent use. If you're going to run an application in production, please host your own server or get in touch to obtain an API key. + The public API on libretranslate.com should be used for testing, personal or infrequent use. If you're going to run an application in production, please host your own server or get in touch to obtain an API key.

{% endif %}
@@ -218,7 +218,7 @@
From a5d3981c7c0816ab8a6bf1b25f77f4c60602b802 Mon Sep 17 00:00:00 2001 From: idotj Date: Fri, 11 Jun 2021 20:13:27 +0200 Subject: [PATCH 3/5] bug: remove Response text when delete text is clicked --- app/templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/index.html b/app/templates/index.html index 45f08d1..bf4003a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -446,7 +446,7 @@ deleteText: function(e){ e.preventDefault(); - this.inputText = this.translatedText = ""; + this.inputText = this.translatedText = this.output = ""; } } }); From 31452f01cc5e37a5617e4b02a758517f334c91a5 Mon Sep 17 00:00:00 2001 From: idotj Date: Fri, 11 Jun 2021 20:30:09 +0200 Subject: [PATCH 4/5] Add right label tag for textarea + unify styles css --- app/static/css/main.css | 16 +++++++++++++--- app/static/css/main.min.css | 2 +- app/templates/index.html | 24 ++++++++++++++---------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/app/static/css/main.css b/app/static/css/main.css index 367dbbb..3d86738 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -75,7 +75,7 @@ h3.header { .btn-copy-translated { position: absolute; - right: 2rem; + right: 2.75rem; bottom: 1rem; display: flex; align-items: center; @@ -116,11 +116,21 @@ h3.header { overflow-y: hidden; } +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0,0,0,0); + border: 0; +} + .code { font-size: 90%; - border-radius: 4px; padding: 1rem 1.5rem; - border: 1px solid #9e9e9e; + border: 1px solid #ccc; background: #fbfbfb; overflow: auto; font-family: monospace; diff --git a/app/static/css/main.min.css b/app/static/css/main.min.css index 9deec9a..d5a3443 100644 --- a/app/static/css/main.min.css +++ b/app/static/css/main.min.css @@ -1 +1 @@ -h3.header{margin-bottom:2.5rem}.mb-0{margin-bottom:0!important}.mt-0{margin-top:0!important}.position-relative{position:relative}.language-select{display:inline-flex;align-items:center;justify-content:flex-start}.language-select select{border:none;width:auto;cursor:pointer;font-weight:600;text-decoration:underline;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:1px;text-overflow:"";padding:0;height:2rem}.btn-switch-language{color:#000;margin-left:-1.5rem;margin-right:1rem}.textarea-container{margin-top:0;position:relative}.btn-delete-text{position:absolute;right:1.5rem;top:.75rem;border:0;background:0 0;padding:0;cursor:pointer;color:#888}.btn-copy-translated:focus,.btn-delete-text:focus{background:0 0!important}.characters-limit-container{position:absolute;right:2rem;bottom:1rem;color:#888;pointer-events:none}.btn-copy-translated{position:absolute;right:2rem;bottom:1rem;display:flex;align-items:center;color:#888;font-size:.85rem;background:0 0;border:none;cursor:pointer;margin-right:-1.5rem}.btn-copy-translated span{padding-right:.5rem}.btn-copy-translated .material-icons{font-size:1.35rem}.progress{background-color:#efefef}.progress.translate{position:absolute}.progress .indeterminate{background-color:#4682b4}.textarea-container textarea{font-size:1.25rem;resize:none;border:1px solid #ccc;background:#efefef;padding:1rem 2rem 1rem 1.5rem;overflow-y:hidden}.code{font-size:90%;border-radius:4px;padding:1rem 1.5rem;border:1px solid #9e9e9e;background:#fbfbfb;overflow:auto;font-family:monospace;min-height:280px;width:100%;overflow:auto}.page-footer .footer-copyright{justify-content:center}@media (max-width:760px){.language-select select{text-align:center;margin:auto}.language-select span{display:none}} \ No newline at end of file +h3.header{margin-bottom:2.5rem}.mb-0{margin-bottom:0!important}.mt-0{margin-top:0!important}.position-relative{position:relative}.language-select{display:inline-flex;align-items:center;justify-content:flex-start}.language-select select{border:none;width:auto;cursor:pointer;font-weight:600;text-decoration:underline;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:1px;text-overflow:"";padding:0;height:2rem}.btn-switch-language{color:#000;margin-left:-1.5rem;margin-right:1rem}.textarea-container{margin-top:0;position:relative}.btn-delete-text{position:absolute;right:1.5rem;top:.75rem;border:0;background:0 0;padding:0;cursor:pointer;color:#888}.btn-copy-translated:focus,.btn-delete-text:focus{background:0 0!important}.characters-limit-container{position:absolute;right:2rem;bottom:1rem;color:#888;pointer-events:none}.btn-copy-translated{position:absolute;right:2.75rem;bottom:1rem;display:flex;align-items:center;color:#888;font-size:.85rem;background:0 0;border:none;cursor:pointer;margin-right:-1.5rem}.btn-copy-translated span{padding-right:.5rem}.btn-copy-translated .material-icons{font-size:1.35rem}.progress{background-color:#efefef}.progress.translate{position:absolute}.progress .indeterminate{background-color:#4682b4}.textarea-container textarea{font-size:1.25rem;resize:none;border:1px solid #ccc;background:#efefef;padding:1rem 2rem 1rem 1.5rem;overflow-y:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.code{font-size:90%;padding:1rem 1.5rem;border:1px solid #ccc;background:#fbfbfb;overflow:auto;font-family:monospace;min-height:280px;width:100%;overflow:auto}.page-footer .footer-copyright{justify-content:center}@media (max-width:760px){.language-select select{text-align:center;margin:auto}.language-select span{display:none}} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index bf4003a..de0cd88 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -132,6 +132,9 @@
+
-
- - - + + + +
+
+
+
From 2a48133e63549a78550f78b086017f899a711a0c Mon Sep 17 00:00:00 2001 From: idotj Date: Fri, 11 Jun 2021 21:03:38 +0200 Subject: [PATCH 5/5] fix vueJS misstype external var + change contrast color for textarea background and buttons --- app/static/css/main.css | 10 +++++----- app/static/css/main.min.css | 2 +- app/templates/index.html | 4 +--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/static/css/main.css b/app/static/css/main.css index 3d86738..a3c6c76 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -57,7 +57,7 @@ h3.header { background: none; padding: 0; cursor: pointer; - color: #888; + color: #777; } .btn-delete-text:focus, @@ -69,7 +69,7 @@ h3.header { position: absolute; right: 2rem; bottom: 1rem; - color: #888; + color: #777; pointer-events: none; } @@ -79,7 +79,7 @@ h3.header { bottom: 1rem; display: flex; align-items: center; - color: #888; + color: #777; font-size: 0.85rem; background: none; border: none; @@ -96,7 +96,7 @@ h3.header { } .progress { - background-color: #efefef; + background-color: #f3f3f3; } .progress.translate { @@ -111,7 +111,7 @@ h3.header { font-size: 1.25rem; resize: none; border: 1px solid #ccc; - background: #efefef; + background: #f3f3f3; padding: 1rem 2rem 1rem 1.5rem; overflow-y: hidden; } diff --git a/app/static/css/main.min.css b/app/static/css/main.min.css index d5a3443..945a374 100644 --- a/app/static/css/main.min.css +++ b/app/static/css/main.min.css @@ -1 +1 @@ -h3.header{margin-bottom:2.5rem}.mb-0{margin-bottom:0!important}.mt-0{margin-top:0!important}.position-relative{position:relative}.language-select{display:inline-flex;align-items:center;justify-content:flex-start}.language-select select{border:none;width:auto;cursor:pointer;font-weight:600;text-decoration:underline;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:1px;text-overflow:"";padding:0;height:2rem}.btn-switch-language{color:#000;margin-left:-1.5rem;margin-right:1rem}.textarea-container{margin-top:0;position:relative}.btn-delete-text{position:absolute;right:1.5rem;top:.75rem;border:0;background:0 0;padding:0;cursor:pointer;color:#888}.btn-copy-translated:focus,.btn-delete-text:focus{background:0 0!important}.characters-limit-container{position:absolute;right:2rem;bottom:1rem;color:#888;pointer-events:none}.btn-copy-translated{position:absolute;right:2.75rem;bottom:1rem;display:flex;align-items:center;color:#888;font-size:.85rem;background:0 0;border:none;cursor:pointer;margin-right:-1.5rem}.btn-copy-translated span{padding-right:.5rem}.btn-copy-translated .material-icons{font-size:1.35rem}.progress{background-color:#efefef}.progress.translate{position:absolute}.progress .indeterminate{background-color:#4682b4}.textarea-container textarea{font-size:1.25rem;resize:none;border:1px solid #ccc;background:#efefef;padding:1rem 2rem 1rem 1.5rem;overflow-y:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.code{font-size:90%;padding:1rem 1.5rem;border:1px solid #ccc;background:#fbfbfb;overflow:auto;font-family:monospace;min-height:280px;width:100%;overflow:auto}.page-footer .footer-copyright{justify-content:center}@media (max-width:760px){.language-select select{text-align:center;margin:auto}.language-select span{display:none}} \ No newline at end of file +h3.header{margin-bottom:2.5rem}.mb-0{margin-bottom:0!important}.mt-0{margin-top:0!important}.position-relative{position:relative}.language-select{display:inline-flex;align-items:center;justify-content:flex-start}.language-select select{border:none;width:auto;cursor:pointer;font-weight:600;text-decoration:underline;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:1px;text-overflow:"";padding:0;height:2rem}.btn-switch-language{color:#000;margin-left:-1.5rem;margin-right:1rem}.textarea-container{margin-top:0;position:relative}.btn-delete-text{position:absolute;right:1.5rem;top:.75rem;border:0;background:0 0;padding:0;cursor:pointer;color:#777}.btn-copy-translated:focus,.btn-delete-text:focus{background:0 0!important}.characters-limit-container{position:absolute;right:2rem;bottom:1rem;color:#777;pointer-events:none}.btn-copy-translated{position:absolute;right:2.75rem;bottom:1rem;display:flex;align-items:center;color:#777;font-size:.85rem;background:0 0;border:none;cursor:pointer;margin-right:-1.5rem}.btn-copy-translated span{padding-right:.5rem}.btn-copy-translated .material-icons{font-size:1.35rem}.progress{background-color:#f3f3f3}.progress.translate{position:absolute}.progress .indeterminate{background-color:#4682b4}.textarea-container textarea{font-size:1.25rem;resize:none;border:1px solid #ccc;background:#f3f3f3;padding:1rem 2rem 1rem 1.5rem;overflow-y:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.code{font-size:90%;padding:1rem 1.5rem;border:1px solid #ccc;background:#fbfbfb;overflow:auto;font-family:monospace;min-height:280px;width:100%;overflow:auto}.page-footer .footer-copyright{justify-content:center}@media (max-width:760px){.language-select select{text-align:center;margin:auto}.language-select span{display:none}} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index de0cd88..480640a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -430,9 +430,8 @@ }; request.send(data); - }, {{ frontendTimeout }}); + }, '{{ frontendTimeout }}'); }, - copyText: function(e){ e.preventDefault(); this.$refs.translatedTextarea.select(); @@ -447,7 +446,6 @@ }, 1500); } }, - deleteText: function(e){ e.preventDefault(); this.inputText = this.translatedText = this.output = "";