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.
24 lines
907 B
HTML
24 lines
907 B
HTML
<!DOCTYPE html>
|
|
<!-- E2E test harness — loads the calculators component + JS in isolation
|
|
(no auth wall). Playwright points here instead of the full SPA.
|
|
All scripts are external because the app's CSP blocks inline scripts. -->
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>E2E harness — calculators</title>
|
|
<link rel="stylesheet" href="/css/styles.css">
|
|
<style>
|
|
body { margin: 0; padding: 16px; background: #f9fafb; }
|
|
#calculators-tab { max-width: 1100px; margin: 0 auto; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<section id="calculators-tab" class="tab-content active" data-component="calculators"></section>
|
|
|
|
<script defer src="/js/calc-math.js"></script>
|
|
<script defer src="/js/drugs-loader.js"></script>
|
|
<script defer src="/js/calculators.js"></script>
|
|
<script type="module" src="/js/bedside/index.js"></script>
|
|
<script defer src="/js/e2e-bootstrap.js"></script>
|
|
</body>
|
|
</html>
|