mirror of https://github.com/dirtbags/moth.git
Better structured theme config
This commit is contained in:
parent
2f7fba2dff
commit
a7c2ee0022
|
@ -1,6 +1,9 @@
|
||||||
{
|
{
|
||||||
"TrackSolved": true,
|
"PuzzleList": {
|
||||||
"Titles": false,
|
"TrackSolved": true,
|
||||||
|
"Titles": false,
|
||||||
|
"": 0
|
||||||
|
},
|
||||||
"Puzzle": {
|
"Puzzle": {
|
||||||
"SyntaxHighlighting": true,
|
"SyntaxHighlighting": true,
|
||||||
"": 0
|
"": 0
|
||||||
|
|
|
@ -88,7 +88,7 @@ class App {
|
||||||
// Update elements with data-track-solved
|
// Update elements with data-track-solved
|
||||||
for (let e of document.querySelectorAll("[data-track-solved]")) {
|
for (let e of document.querySelectorAll("[data-track-solved]")) {
|
||||||
// Only display if data-track-solved is the same as config.trackSolved
|
// Only display if data-track-solved is the same as config.trackSolved
|
||||||
e.classList.toggle("hidden", common.Truthy(e.dataset.trackSolved) != this.config.TrackSolved)
|
e.classList.toggle("hidden", common.Truthy(e.dataset.trackSolved) != this.config.PuzzleList?.TrackSolved)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let e of document.querySelectorAll(".login")) {
|
for (let e of document.querySelectorAll(".login")) {
|
||||||
|
@ -152,10 +152,10 @@ class App {
|
||||||
a.href = url
|
a.href = url
|
||||||
a.target = "_blank"
|
a.target = "_blank"
|
||||||
|
|
||||||
if (this.config.TrackSolved) {
|
if (this.config.PuzzleList?.TrackSolved) {
|
||||||
a.classList.toggle("solved", this.state.IsSolved(puzzle))
|
a.classList.toggle("solved", this.state.IsSolved(puzzle))
|
||||||
}
|
}
|
||||||
if (this.config.Titles) {
|
if (this.config.PuzzleList?.Titles) {
|
||||||
this.loadTitle(puzzle, i)
|
this.loadTitle(puzzle, i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue