added url hash

This commit is contained in:
Moritz Schmidt 2024-10-01 15:43:26 +02:00
parent 75ad746578
commit 650a476106

View file

@ -24,11 +24,11 @@ let portal = ref(PortalABase);
function ItoN() {
try {
const in_url = new URL(ItoN_in.value);
const re = RegExp("(?=DanaInfo=).*(?=,SSL\+)")
const re = RegExp("(?=DanaInfo=).*(?=,SSL\\+)")
const hostname = in_url.pathname.match(re)[0].replace("DanaInfo=", "")
const re2 = RegExp("(,DanaInfo=)(.*,SSL\\+)")
const pathname = in_url.pathname.replace(re2, "")
let out_url = "https://" + hostname + pathname + in_url.search;
let out_url = "https://" + hostname + pathname + in_url.search + in_url.hash;
ItoN_out.value = out_url;
ItoN_error.value = false;
} catch (e) {
@ -62,7 +62,7 @@ function NtoI() {
}
let out_url = in_url.pathname.split('/').slice(1,-1).join("/") + "/,DanaInfo=" + in_url.hostname + ",SSL+" + in_url.pathname.split('/').slice(-1)[0] + in_url.search;
let out_url = in_url.pathname.split('/').slice(1,-1).join("/") + "/,DanaInfo=" + in_url.hostname + ",SSL+" + in_url.pathname.split('/').slice(-1)[0] + in_url.search + in_url.hash;
out_url = out_url.replace(/^(\/)/g, '');
NtoI_out_a.value = PortalABase + out_url;
NtoI_out_b.value = PortalBBase + out_url;