Plantilla de proyecto·Pro
Lista de tareas en JavaScript puro
Una lista de tareas con módulos de JavaScript puro: añade, edita en el sitio, marca, filtra y borra lo hecho; se guarda en localStorage. La lógica tiene tests para el ejecutor de tests de Node. Funciona en el DevBrowser y con el Node.js de la app, sin Linux.
Para instalarlo necesitas PocketCode Pro.
Si tienes PocketCode instalado en tu Android, esto abre la página en la app.
Vista previa
Ficheros
README.md
index.html
package.json
src/app.js
src/storage.js
src/todos.js
styles.css
test/todos.test.jsREADME.md
# To-do list in plain JavaScript A to-do list that runs in the browser with no framework and no build step: add, edit in place, tick off, filter and clear done items. The list is saved in the browser (localStorage). The logic lives in its own module with tests that run on Node's built-in test runner. ## Run it in PocketCode 1. Open `index.html` in the editor. 2. Tap the globe icon (DevBrowser) at the top of the editor. The app opens from the local preview server. 3. Add a few items and reload: they are still there. You don't need the Linux environment for this project. ## Run the tests - Open `test/todos.test.js` and tap Run. The app's own Node.js runs the file and prints each test with ok or not ok. - Or, in the terminal with the Linux environment and Node.js: `npm test`. ## Where things are | Path | What it does | |---|---| | `index.html` | The page and its form | | `styles.css` | Styles, with light and dark colours | | `src/todos.js` | The logic: plain functions, no DOM, easy to test | | `src/storage.js` | Saving and loading from localStorage | | `src/app.js` | Connects the page to the logic and draws the list | | `test/todos.test.js` | Tests for `src/todos.js` | ## Ideas to extend it - Add a due date: a new field in `addTodo`, a date input in the form and a test for it. - Drag to reorder: keep an `order` number on each item and sort by it in `visibleTodos`.Cambios en la 1.0.0
Primera versión.