mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Escape template variables
This commit is contained in:
parent
8ff15acd42
commit
43dc53d794
3 changed files with 30 additions and 19 deletions
|
@ -1,19 +1,14 @@
|
|||
window.addEventListener("load", function() {
|
||||
let select = document.querySelector("header .documentBranch select");
|
||||
while (select.firstChild) {
|
||||
select.removeChild(select.firstChild);
|
||||
while (select.length > 0) {
|
||||
select.remove(0);
|
||||
}
|
||||
for (let branch of documentBranches) {
|
||||
let option = document.createElement("option");
|
||||
option.textContent = branch;
|
||||
if (branch === documentBranch) {
|
||||
option.setAttribute("selected", "");
|
||||
}
|
||||
select.prepend(option);
|
||||
select.add(new Option(branch, branch, branch === documentBranch, branch === documentBranch), 0);
|
||||
}
|
||||
select.addEventListener("change", function() {
|
||||
if (select.value !== documentBranch) {
|
||||
location.assign(select.value + ".html");
|
||||
location.assign(encodeURIComponent(select.value + ".html"));
|
||||
select.value = documentBranch;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue