Download script.js from minispace/links: direct link, hf CLI and curl.
- Browser
- Download file 2.23 kB
-
https://huggingface.co/spaces/minispace/links/resolve/main/script.js
- Command line
-
hf download hf://spaces/minispace/links/script.js
-
curl -L -o script.js https://huggingface.co/spaces/minispace/links/resolve/main/script.js
2.23 kB
| ; | |
| document.addEventListener('DOMContentLoaded', () => { | |
| setupCopyShortUrl(); | |
| setupSecurityLocks(); | |
| }); | |
| let toastTimeout = null; | |
| function setupCopyShortUrl() { | |
| const shortUrlCard = document.getElementById('shortUrlCard'); | |
| if (!shortUrlCard) return; | |
| shortUrlCard.addEventListener('click', () => { | |
| const urlToCopy = 'https://minispace-links.static.hf.space'; | |
| navigator.clipboard.writeText(urlToCopy).then(() => { | |
| showToast('¡Enlace copiado al portapapeles!'); | |
| }).catch(() => { | |
| showToast('minispace-links.static.hf.space'); | |
| }); | |
| }); | |
| } | |
| function handleLinkClick(event, brandName) { | |
| const routes = { | |
| 'BEAT': 'beat.html', | |
| 'Pi Juguetes': 'pi.html', | |
| 'Pi': 'pi.html', | |
| 'Mundo Stand': 'stand.html', | |
| 'Stand': 'stand.html', | |
| 'Interactive': 'interactive.html' | |
| }; | |
| if (routes[brandName]) { | |
| event.preventDefault(); | |
| window.location.href = routes[brandName]; | |
| } | |
| } | |
| function handleAppClick(event, appName) { | |
| event.preventDefault(); | |
| showToast(`¡Aplicación "${appName}" en desarrollo!`); | |
| } | |
| function showToast(message) { | |
| const toast = document.getElementById('toast'); | |
| const toastMessage = document.getElementById('toastMessage'); | |
| if (!toast || !toastMessage) return; | |
| toastMessage.textContent = message; | |
| toast.classList.remove('hidden'); | |
| if (toastTimeout) { | |
| clearTimeout(toastTimeout); | |
| } | |
| toastTimeout = setTimeout(() => { | |
| toast.classList.add('hidden'); | |
| }, 3000); | |
| } | |
| function setupSecurityLocks() { | |
| document.addEventListener('contextmenu', (e) => e.preventDefault()); | |
| document.addEventListener('keydown', (e) => { | |
| if (e.keyCode === 123 || | |
| (e.ctrlKey && e.shiftKey && (e.keyCode === 73 || e.keyCode === 74 || e.keyCode === 67)) || | |
| (e.ctrlKey && (e.keyCode === 85 || e.keyCode === 83)) || | |
| (e.metaKey && e.altKey && (e.keyCode === 73 || e.keyCode === 74)) || | |
| (e.metaKey && (e.keyCode === 85 || e.keyCode === 83))) { | |
| e.preventDefault(); | |
| return false; | |
| } | |
| }); | |
| document.addEventListener('dragstart', (e) => e.preventDefault()); | |
| } | |