Fixed encoding issue on autocomplete and input send

This commit is contained in:
Kasper Rynning-Tønnesen
2018-12-04 12:50:27 +01:00
parent cad2292269
commit 9a1a341bfa
2 changed files with 3 additions and 3 deletions

View File

@@ -151,7 +151,7 @@ var Frontpage = {
data: data, data: data,
limit: 5, // The max amount of results that can be shown at once. Default: Infinity. limit: 5, // The max amount of results that can be shown at once. Default: Infinity.
onAutocomplete: function(val) { onAutocomplete: function(val) {
Frontpage.to_channel(val, false); Frontpage.to_channel(Helper.encodeChannelName(val), false);
}, },
}); });

View File

@@ -894,13 +894,13 @@ function addDynamicListeners() {
addListener("click", ".listen-button", function(event){ addListener("click", ".listen-button", function(event){
if(document.querySelector(".room-namer").value === ""){ if(document.querySelector(".room-namer").value === ""){
this.preventDefault(); this.preventDefault();
Frontpage.to_channel(document.querySelector(".room-namer").getAttribute("placeholder")); Frontpage.to_channel(Helper.encodeChannelName(document.querySelector(".room-namer").getAttribute("placeholder")));
} }
}); });
addListener("submit", ".channel-finder", function(event){ addListener("submit", ".channel-finder", function(event){
this.preventDefault(); this.preventDefault();
Frontpage.to_channel(document.querySelector(".room-namer").value); Frontpage.to_channel(Helper.encodeChannelName(document.querySelector(".room-namer").value));
return false; return false;
}); });