From b508b4d4622632bc13b83d8d1a9bb905910c03ba Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Wed, 30 Oct 2024 16:58:58 -0400 Subject: [PATCH] Add echo of TM data to DOM --- ipwb/assets/reconstructive-banner.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ipwb/assets/reconstructive-banner.js b/ipwb/assets/reconstructive-banner.js index edc0efd..4f183da 100644 --- a/ipwb/assets/reconstructive-banner.js +++ b/ipwb/assets/reconstructive-banner.js @@ -293,6 +293,7 @@ class ReconstructiveBanner extends HTMLElement { test data here lorem On open, send Ajax request to ${this.timemapUrit} +
@@ -331,7 +332,8 @@ class ReconstructiveBanner extends HTMLElement { console.log(`TODO: perform AJAX request to ${this.timemapUrit}`) fetch(this.timemapUrit) .then(response => response.json()) // even though we can only get link-format or cdxj TMs for now - .then(data => console.log(data)).catch(()=>{ + .then(data => this.showtmindom(data)) + .catch(()=>{ // Exception occurred, do something }) }; @@ -347,6 +349,10 @@ class ReconstructiveBanner extends HTMLElement { } }; + this.showtmindom = ((tmdata) => { + document.getElementById('tmdata').innerHTML = tmdata + }) + const datetimeDisplay = this.shadow.getElementById('current'); datetimeDisplay.onclick = e => { if (datetimeDisplay.classList.toggle('precision')) {