document.addEventListener('DOMContentLoaded', function() { // PDF Uploader functionality // Initialize charts if on dashboard page if (window.location.pathname.includes('dashboard.html')) { initDashboardCharts(); } const fileUpload = document.getElementById('file-upload'); const uploadedFilesContainer = document.getElementById('uploaded-files'); const shareBtn = document.getElementById('share-btn'); fileUpload.addEventListener('change', function(e) { const files = Array.from(e.target.files); if (files.length > 0) { uploadedFilesContainer.classList.remove('hidden'); shareBtn.classList.remove('hidden'); uploadedFilesContainer.innerHTML = '

Your Uploads

'; files.forEach((file, index) => { if (file.type === 'application/pdf') { const fileCard = document.createElement('div'); fileCard.className = 'file-card bg-gray-50 rounded-lg p-4 flex items-center justify-between'; fileCard.innerHTML = `

${file.name}

${(file.size / (1024 * 1024)).toFixed(2)} MB

`; uploadedFilesContainer.appendChild(fileCard); } }); feather.replace(); } }); shareBtn.addEventListener('click', function() { alert('Sharing functionality would be implemented here!'); }); function initDashboardCharts() { // Additional chart initialization can be done here if needed } }); // Export functionality for dashboard function exportTo(format) { console.log(`Exporting to ${format}...`); // In a real implementation, this would call the backend API alert(`Exporting data to ${format} format. This would be implemented via backend in a real application.`); }