mirror of https://github.com/dirtbags/moth.git
Use native JS URL objects instead of wrangling everything by hand
This commit is contained in:
parent
dc7d10b12b
commit
def3ca4f0e
|
@ -8,3 +8,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Added
|
### Added
|
||||||
- A changelog
|
- A changelog
|
||||||
- Support for embedding Python libraries at the category or puzzle level
|
- Support for embedding Python libraries at the category or puzzle level
|
||||||
|
### Changed
|
||||||
|
- Use native JS URL objects instead of wrangling everything by hand
|
||||||
|
|
|
@ -62,7 +62,11 @@ function renderPuzzles(obj) {
|
||||||
let a = document.createElement('a')
|
let a = document.createElement('a')
|
||||||
i.appendChild(a)
|
i.appendChild(a)
|
||||||
a.textContent = points
|
a.textContent = points
|
||||||
a.href = "puzzle.html?cat=" + cat + "&points=" + points + "&pid=" + id
|
let url = new URL("puzzle.html", window.location)
|
||||||
|
url.searchParams.set("cat", cat)
|
||||||
|
url.searchParams.set("points", points)
|
||||||
|
url.searchParams.set("pid", id)
|
||||||
|
a.href = url.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue