Skip to content

Commit

Permalink
does this fix the transcript
Browse files Browse the repository at this point in the history
  • Loading branch information
paolacalle committed Dec 7, 2024
1 parent 4c4a859 commit 4c73086
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions assets/js/transcript.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', function () {
const pdfPath = '/assets/pdfs/smith.pdf';
const pdfPath = '/assets/pdfs/smith.pdf'; // Use absolute path to ensure correctness
console.log('PDF Path:', pdfPath); // Log to verify the path
const pdfContainer = document.getElementById('pdf-container');

Expand All @@ -23,15 +23,16 @@ document.addEventListener('DOMContentLoaded', function () {
fallbackMessage.className = 'text-muted';
fallbackMessage.innerHTML = `
Your browser does not support PDFs. Please
<a href="${pdfPath}" class="text-primary">download the PDF</a> to view it.
<a href="${pdfPath}" class="text-primary" download>download the PDF</a> to view it.
`;
pdfObject.appendChild(fallbackMessage);
pdfContainer.appendChild(pdfObject);
} else {
const downloadButton = document.createElement('a');
downloadButton.href = pdfPath;
downloadButton.className = 'btn btn-primary';
downloadButton.textContent = 'View PDF';
downloadButton.textContent = 'Download PDF';
downloadButton.setAttribute('download', 'smith.pdf'); // Add download attribute to force download
pdfContainer.appendChild(downloadButton);
}
});

0 comments on commit 4c73086

Please sign in to comment.