Download script.js from drmoustafaamin/iphone-notey-digital-scribbler: direct link, hf CLI and curl.
- Browser
- Download file 980 Bytes
-
https://huggingface.co/spaces/drmoustafaamin/iphone-notey-digital-scribbler/resolve/main/script.js
- Command line
-
hf download hf://spaces/drmoustafaamin/iphone-notey-digital-scribbler/script.js
-
curl -L -o script.js https://huggingface.co/spaces/drmoustafaamin/iphone-notey-digital-scribbler/resolve/main/script.js
980 Bytes
| document.addEventListener('DOMContentLoaded', () => { | |
| // Initialize note functionality | |
| const textarea = document.querySelector('textarea'); | |
| const titleInput = document.querySelector('input[type="text"]'); | |
| // Auto-focus the title field on page load | |
| titleInput.focus(); | |
| // Save note functionality | |
| const saveNote = () => { | |
| const note = { | |
| title: titleInput.value, | |
| content: textarea.value, | |
| createdAt: new Date().toISOString() | |
| }; | |
| // In a real app, you would save to localStorage or a database | |
| console.log('Note saved:', note); | |
| }; | |
| // Add event listeners for saving | |
| document.querySelector('button:text("Done")').addEventListener('click', saveNote); | |
| // Handle keyboard shortcuts | |
| document.addEventListener('keydown', (e) => { | |
| if (e.metaKey && e.key === 's') { | |
| e.preventDefault(); | |
| saveNote(); | |
| } | |
| }); | |
| }); |