diff --git a/assets/scripts.js b/assets/scripts.js index b70bda5..2b40b75 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -1004,14 +1004,30 @@ if (elUtilWKD) { const elInput = document.body.querySelector("#input"); const elOutput = document.body.querySelector("#output"); + const elOutputDirect = document.body.querySelector("#output_url_direct"); + const elOutputAdvanced = document.body.querySelector("#output_url_advanced"); + let match; elInput.addEventListener("input", async function(evt) { if (evt.target.value) { - elOutput.value = await computeWKDLocalPart(evt.target.value); + if (/(.*)@(.{1,}\..{1,})/.test(evt.target.value)) { + match = evt.target.value.match(/(.*)@(.*)/); + elOutput.innerText = await computeWKDLocalPart(match[1]); + elOutputDirect.innerText = `https://${match[2]}/.well-known/openpgpkey/hu/${elOutput.innerText}?l=${match[1]}`; + elOutputAdvanced.innerText = `https://openpgpkey.${match[2]}/.well-known/openpgpkey/${match[2]}/hu/${elOutput.innerText}?l=${match[1]}`; + } else { + elOutput.innerText = await computeWKDLocalPart(evt.target.value); + elOutputDirect.innerText = "Waiting for input"; + elOutputAdvanced.innerText = "Waiting for input"; + } } else { - elOutput.value = ""; + elOutput.innerText = "Waiting for input"; + elOutputDirect.innerText = "Waiting for input"; + elOutputAdvanced.innerText = "Waiting for input"; } }); + + elInput.dispatchEvent(new Event("input")); } if (elUtilQRFP) { diff --git a/assets/styles.css b/assets/styles.css index 082a825..f640e05 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -84,7 +84,7 @@ footer a { background: linear-gradient(0deg, #4da4d2 0%, #82c5ea 100%); } .full-width { - width: 100%; + width: 100% !important; } h1 { diff --git a/views/index.php b/views/index.php index 3ab2390..16e5b53 100644 --- a/views/index.php +++ b/views/index.php @@ -18,8 +18,8 @@
Profile URL generator
- Web Key Directory
- Fingerprint QR
+ Web Key Directory URL generator
+ Fingerprint QR generator