Skip to content

Commit

Permalink
Add Ajax request to TM for #839
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Oct 30, 2024
1 parent e859277 commit f4c9757
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ipwb/assets/reconstructive-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ class ReconstructiveBanner extends HTMLElement {
</a>
<div id="meta">
<!-- TODO: Add provenance infomration, metadata, and interactive visualizations here... -->
test data here lorem
On open, send Ajax request to ${this.timemapUrit}
</div>
</div>
</div>
Expand Down Expand Up @@ -326,6 +328,12 @@ class ReconstructiveBanner extends HTMLElement {
wrapper.classList.replace('fab', 'expanded');
wrapper.style.removeProperty('top');
wrapper.style.removeProperty('left');
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(()=>{
// Exception occurred, do something
})
};
this.shadow.getElementById('collapse').onclick = e => {
e.preventDefault();
Expand Down
3 changes: 2 additions & 1 deletion ipwb/assets/reconstructive.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ class Reconstructive {
prev-urim="${rels.prev && rels.prev.href || ''}"
prev-datetime="${rels.prev && rels.prev.datetime || ''}"
next-urim="${rels.next && rels.next.href || ''}"
next-datetime="${rels.next && rels.next.datetime || ''}">
next-datetime="${rels.next && rels.next.datetime || ''}"
timemap-urit="${rels.timemap && rels.timemap.href || ''}">
</reconstructive-banner>
`;
}
Expand Down

0 comments on commit f4c9757

Please sign in to comment.