Download script.js from gmossy/docling-rag-pipeline-wizard: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/spaces/gmossy/docling-rag-pipeline-wizard/resolve/main/script.js
- Command line
-
hf download hf://spaces/gmossy/docling-rag-pipeline-wizard/script.js
-
curl -L -o script.js https://huggingface.co/spaces/gmossy/docling-rag-pipeline-wizard/resolve/main/script.js
1.99 kB
| // Shared JavaScript across all pages | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Initialize tooltips for feather icons | |
| document.querySelectorAll('[data-feather]').forEach(icon => { | |
| const tooltipText = icon.parentElement.getAttribute('data-tooltip'); | |
| if (tooltipText) { | |
| icon.setAttribute('title', tooltipText); | |
| } | |
| }); | |
| }); | |
| // File upload handling | |
| function handleFileUpload(event) { | |
| const files = event.target.files; | |
| if (files.length > 0) { | |
| console.log('Files selected:', files); | |
| // TODO: Implement file processing logic | |
| } | |
| } | |
| // Drag and drop functionality | |
| function setupDragAndDrop() { | |
| const dropArea = document.getElementById('drop-area'); | |
| if (dropArea) { | |
| ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => { | |
| dropArea.addEventListener(eventName, preventDefaults, false); | |
| }); | |
| function preventDefaults(e) { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| } | |
| ['dragenter', 'dragover'].forEach(eventName => { | |
| dropArea.addEventListener(eventName, highlight, false); | |
| }); | |
| ['dragleave', 'drop'].forEach(eventName => { | |
| dropArea.addEventListener(eventName, unhighlight, false); | |
| }); | |
| function highlight() { | |
| dropArea.classList.add('border-indigo-400', 'bg-indigo-900', 'bg-opacity-20'); | |
| } | |
| function unhighlight() { | |
| dropArea.classList.remove('border-indigo-400', 'bg-indigo-900', 'bg-opacity-20'); | |
| } | |
| dropArea.addEventListener('drop', handleDrop, false); | |
| function handleDrop(e) { | |
| const dt = e.dataTransfer; | |
| const files = dt.files; | |
| console.log('Files dropped:', files); | |
| // TODO: Implement file processing logic | |
| } | |
| } | |
| } | |
| // Initialize drag and drop when DOM is loaded | |
| document.addEventListener('DOMContentLoaded', setupDragAndDrop); |