JSNB is a single page app (SPA), or rather for security reasons two-pade app. Bulk of the HTML is in sandbox.html with a wrapper of index.html (containing mainly menu and footer). In future there could be more pages for html, integration with other tools, and accessing stored files/data.
JavaScript code of JSNB is organized into the following files (in the js/ folder):
- controller.js: This controls the UI aspects (adding cells, deleting cells, loading noteboks etc.)
- libs.js: This contains reusable functions in other modules.
- worker.js: This is code where the user generated code is excecuted.
- github.js: Functions for interacting with GitHub API.
- modal.js: Functions for operating modal (UI) - this is from PICOCSS
Codemirror is an opesource UI framework for showing code editor in HTML. Three files (in the file codemirror/) are used in JSNB. License for the same is copied in the folder. This is downloaded and kept along with the repo so that there is no version clash and the app works without network. Same with PICO CSS.
- codemirror.css: Styling for the editor.
- codemirror.js: Core codemirror functions.
- javascript.js: JavaScript specific functionality of codemirror.
The CSS is kept minimal with the following files (in css/ folder):
- pico.min.css: PICO CSS (This is downloaded and kept so that the app can work without network)
- style.css: Custom CSS