Skip to content

Commit

Permalink
Add echo of TM data to DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Oct 30, 2024
1 parent f4c9757 commit b508b4d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ipwb/assets/reconstructive-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class ReconstructiveBanner extends HTMLElement {
<!-- TODO: Add provenance infomration, metadata, and interactive visualizations here... -->
test data here lorem
On open, send Ajax request to ${this.timemapUrit}
<div id="timemapdata"></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -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
})
};
Expand All @@ -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')) {
Expand Down

0 comments on commit b508b4d

Please sign in to comment.