Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion web/developerhelp/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ themesDir = "../hugothemes/themes"
source = "../hugothemes/static/fonts"
target = "static/fonts"

[[module.mounts]]
source = "../hugothemes/static/fonts"
target = "static/js"

[[module.mounts]]
source = "static"
target = "static"
Expand All @@ -40,4 +44,9 @@ themesDir = "../hugothemes/themes"
# Update security policy to allow asciidoctor
[security]
[security.exec]
allow = ['asciidoctor']
allow = ['asciidoctor']

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
9 changes: 8 additions & 1 deletion web/hugothemes/static/js/searchFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ let currentIndex = -1

document.addEventListener("keydown", (ev) => {
if (ev.ctrlKey && ev.key === "f") {
document.body.appendChild(createSearchFeld())
if (document.getElementById("searchFeld") !== null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (document.getElementById("searchFeld") !== null) {
if (document.getElementById("searchInput") !== null) {

close()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TruongQuangSB Shall we really close the search field? The common handling e.g. in the browser is to just focus the search field again

} else {
document.body.appendChild(createSearchFeld())
document.getElementById("searchInput").focus()
}

}

if (ev.key.toLowerCase() === "enter" && document.activeElement.parentElement === searchFeld) {
Expand All @@ -19,6 +25,7 @@ function createSearchFeld() {
searchFeld.id = "searchFeld"
searchFeld.textContent = "\u{1F50D}"
const input = document.createElement("input")
input.setAttribute("id", "searchInput")
input.type = "text"
input.oninput = (ev) => {
onSearch(input.value)
Expand Down
Loading