forked from Mirrors/keyoxide-web
Enable search form
This commit is contained in:
parent
637a0a5f5c
commit
87c9acfde1
2 changed files with 10 additions and 1 deletions
|
@ -115,6 +115,15 @@ const elFormSearch = document.body.querySelector("#search");
|
|||
if (elFormSearch) {
|
||||
elFormSearch.onsubmit = function (evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
const protocol = elFormSearch.querySelector("input[type='radio']:checked").value;
|
||||
const identifier = elFormSearch.querySelector("input[type='search']").value;
|
||||
|
||||
if (protocol == 'sig') {
|
||||
window.location.href = `/${protocol}`;
|
||||
} else {
|
||||
window.location.href = `/${protocol}/${encodeURIComponent(identifier)}`;
|
||||
}
|
||||
}
|
||||
|
||||
const elSearchRadio = elFormSearch.querySelectorAll("input[type='radio']");
|
||||
|
|
|
@ -14,7 +14,7 @@ block content
|
|||
#search.form-wrapper.card
|
||||
h2 Generate a profile
|
||||
form(action="post")
|
||||
input(type="search" name="query" placeholder="3637202523e7c1309ab79e99ef2dc5827b445f4b, test@doip.rocks")
|
||||
input(type="search" name="query" required placeholder="3637202523e7c1309ab79e99ef2dc5827b445f4b, test@doip.rocks")
|
||||
div.radio-wrapper
|
||||
input#protocol-hkp(type="radio" name="protocol" value="hkp" checked="true")
|
||||
label(for="protocol-hkp") HKP
|
||||
|
|
Loading…
Reference in a new issue