From 5475eed4526c099b0139a896963d5bf94a389a4a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Feb 2021 06:35:37 +0300 Subject: [PATCH] bring back hash functions --- js/tt-rss.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/js/tt-rss.js b/js/tt-rss.js index 28b598c25..a00838c43 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -70,20 +70,13 @@ require(["dojo/_base/kernel", /* exported hash_get */ function hash_get(key) { - console.warn("FIXME: hash_get", key); - - //const kv = window.location.hash.substring(1).toQueryParams(); - //return kv[key]; - console.warn("FIXME: hash_get", key); + const obj = dojo.queryToObject(window.location.hash.substring(1)); + return obj[key]; } /* exported hash_set */ function hash_set(key, value) { - console.warn("FIXME: hash_set", key, value); - - /*const kv = window.location.hash.substring(1).toQueryParams(); - kv[key] = value; - window.location.hash = $H(kv).toQueryString();*/ - - console.warn("FIXME: hash_set", key); + const obj = dojo.queryToObject(window.location.hash.substring(1)); + obj[key] = value; + window.location.hash = dojo.objectToQuery(obj); }