From eb722e5e1777cd82b8065b68941f189f81e27d88 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 18 Oct 2020 20:51:38 +0200 Subject: [PATCH] re-enable loading full form, i removed it by accident --- Uri/UriFactory.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Uri/UriFactory.js b/Uri/UriFactory.js index 2585cf2..428249f 100644 --- a/Uri/UriFactory.js +++ b/Uri/UriFactory.js @@ -218,8 +218,26 @@ export class UriFactory return value; } else if (match.indexOf('?') === 0) { return HttpUri.getUriQueryParameter(current.query, match.substr(1)); - } else if (match.indexOf('#') === 0) { + } else if (match === '#') { return current.fragment; + } else if (match.indexOf('#') === 0) { + const e = document.getElementById(match.substr(1)); + if (e) { + if (e.tagName.toLowerCase() !== 'form') { + return e.value; + } + + let value = ''; + const form = (new FormView(e.id)).getData(); + + for (let pair of form.entries()) { + value += '&' + pair[0] + '=' + pair[1]; + } + + return value; + } + + return ''; } else if (match.indexOf('?') === 0) { return current.query(); } else if (match.indexOf('/') === 0) {