From 3d1d21ed0ab9c2a15a964e3d86104279e0d2cc60 Mon Sep 17 00:00:00 2001 From: ivar Date: Tue, 7 Oct 2025 23:19:14 +0200 Subject: as --- VegaData/wwwroot/17.png | Bin 0 -> 5334 bytes VegaData/wwwroot/framework.js | 22 +++++++- VegaData/wwwroot/index.html | 30 ++++++++--- VegaData/wwwroot/index.js | 122 +++++++++++++++++++++++++----------------- 4 files changed, 117 insertions(+), 57 deletions(-) create mode 100644 VegaData/wwwroot/17.png (limited to 'VegaData/wwwroot') diff --git a/VegaData/wwwroot/17.png b/VegaData/wwwroot/17.png new file mode 100644 index 0000000..7895530 Binary files /dev/null and b/VegaData/wwwroot/17.png differ diff --git a/VegaData/wwwroot/framework.js b/VegaData/wwwroot/framework.js index e1652d0..de20d66 100644 --- a/VegaData/wwwroot/framework.js +++ b/VegaData/wwwroot/framework.js @@ -72,7 +72,7 @@ function trigger(target, key) { // To use this in element props you need to supply the .value read as a function. // */ export function r(target) { - target = {value: target}; + target = { value: target }; return new Proxy(target, { get(obj, key, receiver) { track(obj, key); @@ -109,6 +109,24 @@ export function e(fn) { return runner; } +export function gqp(key) { + return new URLSearchParams(location.search).get(key) +} + +export function sqp(query) { + console.log(query); + + if ('URLSearchParams' in window) { + const url = new URL(window.location) + for (const key of Object.keys(query)) { + const value = encodeURIComponent(query[key]) + if (!value || value === "") url.searchParams.delete(key) + else url.searchParams.set(key, value) + } + history.pushState(null, '', url); + } +} + //** // Combine elements // */ @@ -144,7 +162,7 @@ export function css(styleObject) { // */ export function t(name, props, ...children) { if (typeof name === "function") { - return name({...props, children}); + return name({ ...props, children }); } return createElement(name, props, children); } diff --git a/VegaData/wwwroot/index.html b/VegaData/wwwroot/index.html index 5ea2694..5beab75 100644 --- a/VegaData/wwwroot/index.html +++ b/VegaData/wwwroot/index.html @@ -7,14 +7,14 @@