From 480d90d9ff9628996758e387d39e66a58eec18c5 Mon Sep 17 00:00:00 2001 From: modelearth Date: Mon, 6 May 2024 16:40:29 -0400 Subject: [PATCH] Use hash.path from url --- view/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/view/index.html b/view/index.html index 6441c95..f0a19df 100644 --- a/view/index.html +++ b/view/index.html @@ -145,6 +145,7 @@ document.addEventListener('hashChangeEvent', function (elem) { let hash = getHash(); if (hash.feed != priorHash.feed) { + updateHash({'path':''}); displayFeed(); } }, false); @@ -161,7 +162,9 @@ function displayFeed() { let hash = getHash(); if (!hash.feed || hash.feed == "none") { - hash.feed = "usda" + if (!hash.path) { + hash.feed = "usda" + } } $("#resultFull").css("opacity","0"); $("#resultLoading").show(); // .text("Loading..."); @@ -186,6 +189,9 @@ //var url = "https://kg.diffbot.com/kg/dql_endpoint?type=query&token=31c80e03058e4f5b86585fb9e97640a6&size=3&from=0&query=type%3AOrganization%20name%3A%22General%20Mills%22"; let url = ""; + if (hash.path) { + url = hash.path; + } selected_array = []; // https://github.com/ModelEarth/data-commons/blob/main/docs/air/emissions/data/API_EN.ATM.CO2E.PC_DS2_zh_csv_v2_45186.csv