From f4c97572def3ce2cb3e8223c08e2aceadd8ffd65 Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Wed, 30 Oct 2024 16:54:45 -0400 Subject: [PATCH] Add Ajax request to TM for #839 --- ipwb/assets/reconstructive-banner.js | 8 ++++++++ ipwb/assets/reconstructive.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ipwb/assets/reconstructive-banner.js b/ipwb/assets/reconstructive-banner.js index a67f6cf5..edc0efd2 100644 --- a/ipwb/assets/reconstructive-banner.js +++ b/ipwb/assets/reconstructive-banner.js @@ -291,6 +291,8 @@ class ReconstructiveBanner extends HTMLElement {
+ test data here lorem + On open, send Ajax request to ${this.timemapUrit}
@@ -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(); diff --git a/ipwb/assets/reconstructive.js b/ipwb/assets/reconstructive.js index 4f5565f3..f29729de 100644 --- a/ipwb/assets/reconstructive.js +++ b/ipwb/assets/reconstructive.js @@ -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 || ''}"> `; }