Changeset 4b5db37 in Klonkt for src/views/shell.ejs
- Timestamp:
- 08/07/2026 06:33:54 PM (5 weeks ago)
- Branches:
- main
- Children:
- da84110
- Parents:
- c1df3e9
- git-author:
- Robin <roboburr@…> (08/07/2026 06:33:41 PM)
- git-committer:
- Robin <roboburr@…> (08/07/2026 06:33:54 PM)
- File:
-
- 1 edited
-
src/views/shell.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/shell.ejs
rc1df3e9 r4b5db37 490 490 window.__modBoot = true; 491 491 492 // name -> 1 (aan het laden) of de module-namespace (geladen). Een module 493 // die `init` exporteert draait die bij ELKE paginawissel waarop hij actief 494 // is -- dat is het gedrag van de oude inline scripts, die per render 495 // draaiden. Een module zonder init draait alleen zijn top-level, een keer. 492 496 var loaded = {}; 497 function start(name, m) { 498 if (!m || typeof m.init !== 'function') return; 499 try { m.init(); } catch (e) { console.warn('[mod] ' + name + ' init:', e && e.message); } 500 } 493 501 function load() { 494 502 var names = (document.body.getAttribute('data-js') || '').trim().split(/\s+/); … … 497 505 // kleine letters, cijfers en streepjes; nooit een punt of een schuine 498 506 // streep. 499 if (!name || loaded[name] || !/^[a-z0-9-]+$/.test(name)) return; 507 if (!name || !/^[a-z0-9-]+$/.test(name)) return; 508 if (loaded[name]) { start(name, loaded[name]); return; } 500 509 loaded[name] = 1; 501 import('/assets/js/mod/' + name + '.js').catch(function (e) { 510 import('/assets/js/mod/' + name + '.js').then(function (m) { 511 loaded[name] = m; 512 start(name, m); 513 }).catch(function (e) { 502 514 console.warn('[mod] ' + name + ' laadde niet:', e && e.message); 503 515 });
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)