mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-21 23:41:01 +00:00
fix: stop double encoding query params
This commit is contained in:
parent
abc77002e2
commit
97dcb1decc
1 changed files with 5 additions and 5 deletions
|
@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||||
translatedText: "",
|
translatedText: "",
|
||||||
output: "",
|
output: "",
|
||||||
charactersLimit: -1,
|
charactersLimit: -1,
|
||||||
|
|
||||||
detectedLangText: "",
|
detectedLangText: "",
|
||||||
|
|
||||||
copyTextLabel: {{ _e("Copy text") }},
|
copyTextLabel: {{ _e("Copy text") }},
|
||||||
|
@ -206,13 +206,13 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||||
|
|
||||||
this.updateQueryParam('source', this.sourceLang)
|
this.updateQueryParam('source', this.sourceLang)
|
||||||
this.updateQueryParam('target', this.targetLang)
|
this.updateQueryParam('target', this.targetLang)
|
||||||
this.updateQueryParam('q', encodeURI(this.inputText))
|
this.updateQueryParam('q', this.inputText)
|
||||||
|
|
||||||
if (this.timeout) clearTimeout(this.timeout);
|
if (this.timeout) clearTimeout(this.timeout);
|
||||||
this.timeout = null;
|
this.timeout = null;
|
||||||
|
|
||||||
this.detectedLangText = "";
|
this.detectedLangText = "";
|
||||||
|
|
||||||
if (this.inputText === ""){
|
if (this.inputText === ""){
|
||||||
this.translatedText = "";
|
this.translatedText = "";
|
||||||
this.output = "";
|
this.output = "";
|
||||||
|
@ -247,7 +247,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||||
if (self.refreshOnce()) return;
|
if (self.refreshOnce()) return;
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
var res = JSON.parse(this.response);
|
var res = JSON.parse(this.response);
|
||||||
// Success!
|
// Success!
|
||||||
if (res.translatedText !== undefined){
|
if (res.translatedText !== undefined){
|
||||||
|
@ -464,7 +464,7 @@ function handleLangsResponse(self, response) {
|
||||||
const defaultText = self.getQueryParam("q")
|
const defaultText = self.getQueryParam("q")
|
||||||
|
|
||||||
if (defaultText) {
|
if (defaultText) {
|
||||||
self.inputText = decodeURI(defaultText)
|
self.inputText = defaultText
|
||||||
self.handleInput(new Event('none'))
|
self.handleInput(new Event('none'))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue