Skip to content

Commit

Permalink
proper changes (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
7malikk authored Oct 16, 2022
1 parent 3ba3935 commit f516663
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ <h3 id="offcanvasRightLabel">Images</h3>
form.addEventListener('submit', (event) => {
event.preventDefault();
const url = input.value.replace('details', 'metadata');
let fetchedFrom
axios.get(url)
.then((response) => {
if (response.data.files && response.data.files.length != 0) {
Expand All @@ -104,6 +105,12 @@ <h3 id="offcanvasRightLabel">Images</h3>
let imageRow = document.createElement('div');
let image = new Image(150, 150);
let placeButton = document.createElement('a');
fetchedFrom = document.createElement('p');
fetchedFromUrl = document.createElement('a');
fetchedFromUrl.setAttribute('href', input.value);
fetchedFromUrl.setAttribute('target', '_blank');
fetchedFromUrl.innerHTML = 'this Internet Archive Collection';
fetchedFrom.appendChild(fetchedFromUrl)

placeButton.classList.add('btn', 'btn-sm', 'btn-outline-secondary', 'place-button');
placeButton.innerHTML = 'Place on map';
Expand All @@ -117,7 +124,7 @@ <h3 id="offcanvasRightLabel">Images</h3>
imageCount++;
}
});
responseText.innerHTML = imageCount ? `${imageCount} image(s) fetched successfully.` : 'No images found in the link provided...'
responseText.innerHTML = imageCount ? `${imageCount} image(s) fetched successfully from ${fetchedFrom.innerHTML}.` : 'No images found in the link provided...'
} else {
responseText.innerHTML = 'No images found in the link provided...'
}
Expand Down

0 comments on commit f516663

Please sign in to comment.