From db36aeac632333d732019ebbf5d5603fdf604922 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sun, 26 Feb 2023 15:05:48 +0100 Subject: [PATCH] Remove protocol selector --- static-src/styles.css | 3 +++ static-src/ui.js | 8 +------- views/index.pug | 11 +++-------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/static-src/styles.css b/static-src/styles.css index 8b61063..679bf21 100644 --- a/static-src/styles.css +++ b/static-src/styles.css @@ -397,6 +397,9 @@ pre code { padding-bottom: 1.6rem; margin-bottom: 48px; } +.form-wrapper *:last-child { + margin-bottom: 0; +} .form-wrapper form { display: flex; flex-direction: column; diff --git a/static-src/ui.js b/static-src/ui.js index 6158063..a003ce9 100644 --- a/static-src/ui.js +++ b/static-src/ui.js @@ -183,14 +183,8 @@ const runSearchForm = () => { 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)}`; - } + window.location.href = `/${encodeURIComponent(identifier)}`; } elFormSearch.querySelectorAll("input[type='radio']").forEach(function (el) { diff --git a/views/index.pug b/views/index.pug index e4d43ce..87ff886 100644 --- a/views/index.pug +++ b/views/index.pug @@ -32,15 +32,10 @@ block content label#searchQuery(for="query") Query for fingerprint or email identifier input#query(type="search" name="query" required placeholder="3637202523e7c1309ab79e99ef2dc5827b445f4b, test@doip.rocks" aria-labelledby="searchTitle searchQuery") - fieldset(role="radiogroup").radio-wrapper - legend Protocol - input#protocol-hkp(type="radio" name="protocol" value="hkp" checked="true") - label(for="protocol-hkp") HKP - input#protocol-wkd(type="radio" name="protocol" value="wkd") - label(for="protocol-wkd") WKD - input#protocol-sig(type="radio" name="protocol" value="sig") - label(for="protocol-sig") Signature input(type="submit" value="View profile") + p Or view a + a(href="/sig") plaintext signature + | profile. if highlights.length > 0 h2 Highlights