adjust frontend selector/fragment loading

This commit is contained in:
Dennis Eichhorn 2020-07-29 20:58:39 +02:00
parent 27470758e7
commit 6498a82a1e
2 changed files with 5 additions and 3 deletions

View File

@ -197,8 +197,8 @@ export class UriFactory
return toMatch[match]; return toMatch[match];
} else if (typeof UriFactory.uri[match] !== 'undefined') { } else if (typeof UriFactory.uri[match] !== 'undefined') {
return UriFactory.uri[match]; return UriFactory.uri[match];
} else if (match.indexOf('#') === 0) { } else if (match.indexOf('!') === 0) {
const e = document.getElementById(match.substr(1)); const e = document.querySelector(match.substr(1));
if (!e) { if (!e) {
return ''; return '';
@ -218,6 +218,8 @@ export class UriFactory
return value; return value;
} else if (match.indexOf('?') === 0) { } else if (match.indexOf('?') === 0) {
return HttpUri.getUriQueryParameter(current.query, match.substr(1)); return HttpUri.getUriQueryParameter(current.query, match.substr(1));
} else if (match.indexOf('#') === 0) {
return HttpUri.getFragment();
} else if (match.indexOf('/') === 0) { } else if (match.indexOf('/') === 0) {
return 'ERROR PATH'; return 'ERROR PATH';
} else if (match === '%') { } else if (match === '%') {

View File

@ -62,7 +62,7 @@ describe('UriFactoryTest', function ()
{ {
it('Testing global queries', function () it('Testing global queries', function ()
{ {
let uri = 'www.test-uri.com?id={@ID}&test={.mTest}&two={/path}&hash={#hash}&none=#none&found={/not}?v={/valid2}', let uri = 'www.test-uri.com?id={@ID}&test={.mTest}&two={/path}&hash={!#hash}&none=#none&found={/not}?v={/valid2}',
vars = { vars = {
'@ID' : 1, '@ID' : 1,
'.mTest': 'someString', '.mTest': 'someString',