Split the Bedside clinical reference section out of calculators.js (~1220 lines) into 20 focused ES modules under public/js/bedside/. Each module owns one clinical topic (cardiac, seizure, sepsis, burns, etc.) and exports an init() wired up by bedside/index.js. Shared helpers live in shared.js and also set window._EM for back-compat with the 4 remaining call sites in calculators.js. Load order: classic defer calculators.js first, then module script bedside/index.js. Handlers bind at DOM-ready; runtime _EM lookups resolve after both are evaluated. Makes bedside content editable per-section, shrinks calculators.js from 4111 to 2891 lines, and keeps the existing Playwright smoke suite (e2e/tests/bedside-smoke.spec.js) as the behavioral contract.
46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
// ============================================================
|
|
// bedside/index.js
|
|
// Imports + registers all Bedside section modules on load.
|
|
// Loaded as <script type="module"> from index.html and e2e-harness.html.
|
|
// ============================================================
|
|
|
|
import './shared.js'; // side-effect: sets window._EM for back-compat
|
|
import * as ageWeight from './age-weight.js';
|
|
import * as subNav from './sub-nav.js';
|
|
import * as lightbox from './image-lightbox.js';
|
|
import * as neonatal from './neonatal.js';
|
|
import * as airway from './airway.js';
|
|
import * as cardiac from './cardiac.js';
|
|
import * as respiratory from './respiratory.js';
|
|
import * as ventilation from './ventilation.js';
|
|
import * as seizure from './seizure.js';
|
|
import * as sepsis from './sepsis.js';
|
|
import * as anaphylaxis from './anaphylaxis.js';
|
|
import * as sedation from './sedation.js';
|
|
import * as agitation from './agitation.js';
|
|
import * as antiemetics from './antiemetics.js';
|
|
import * as antimicrobials from './antimicrobials.js';
|
|
import * as burns from './burns.js';
|
|
import * as toxicology from './toxicology.js';
|
|
import * as trauma from './trauma.js';
|
|
|
|
[
|
|
ageWeight,
|
|
subNav,
|
|
lightbox,
|
|
neonatal,
|
|
airway,
|
|
cardiac,
|
|
respiratory,
|
|
ventilation,
|
|
seizure,
|
|
sepsis,
|
|
anaphylaxis,
|
|
sedation,
|
|
agitation,
|
|
antiemetics,
|
|
antimicrobials,
|
|
burns,
|
|
toxicology,
|
|
trauma,
|
|
].forEach(function(m) { if (m && typeof m.init === 'function') m.init(); });
|