| 36 | document.querySelector('script[data-cryptii-config]') !== null) { |
| 37 | // Define app initialization in the browser |
| 38 | const init = () => { |
| 39 | // Read optional pipe content |
| 40 | const $pipeData = document.querySelector('script[data-cryptii-pipe]') |
| 41 | const pipeData = $pipeData !== null ? JSON.parse($pipeData.innerHTML) : null |
| 42 | |
| 43 | // Read optional app config |
| 44 | const $config = document.querySelector('script[data-cryptii-config]') |
| 45 | const config = $config !== null ? JSON.parse($config.innerHTML) : {} |
| 46 | |
| 47 | // Configure app and bootstrap it |
| 48 | const app = new App(config) |
| 49 | app.run(pipeData) |
| 50 | } |
| 51 | |
| 52 | // Trigger initialization when the DOM is ready |
| 53 | if (document.readyState !== 'loading') { |