From b6ebca0e6f2aff838ea4f61eafc9da38c59d5c6f Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 8 May 2026 07:50:26 +0200 Subject: [PATCH] convert admin docs and drug loader to modules --- public/index.html | 4 ++-- public/js/admin-docs.js | 4 ---- public/js/drugs-loader.js | 2 -- test/module-entrypoints.test.js | 2 ++ 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/public/index.html b/public/index.html index 0e1ff99..0e506af 100644 --- a/public/index.html +++ b/public/index.html @@ -502,10 +502,10 @@ - + - + diff --git a/public/js/admin-docs.js b/public/js/admin-docs.js index fcae797..2062fda 100644 --- a/public/js/admin-docs.js +++ b/public/js/admin-docs.js @@ -11,9 +11,6 @@ // auth.js after login when user.role === 'admin'. // ============================================================ -(function () { - 'use strict'; - var _inited = false; var _treeLoaded = false; var _tree = []; @@ -230,4 +227,3 @@ }); console.log('Admin docs viewer loaded'); -})(); diff --git a/public/js/drugs-loader.js b/public/js/drugs-loader.js index f517d0a..df9d128 100644 --- a/public/js/drugs-loader.js +++ b/public/js/drugs-loader.js @@ -10,7 +10,6 @@ // the fetch fails — the JSON is an authoritative data source but // not a hard dependency at runtime. // ============================================================ -(function() { // Default to empty shape so lookups don't throw before fetch resolves. window._DRUGS = window._DRUGS || { version: null, sections: {} }; @@ -28,4 +27,3 @@ console.warn('[drugs-loader] could not load /data/drugs.json:', err); return window._DRUGS; }); -})(); diff --git a/test/module-entrypoints.test.js b/test/module-entrypoints.test.js index 9d9d428..538074f 100644 --- a/test/module-entrypoints.test.js +++ b/test/module-entrypoints.test.js @@ -8,7 +8,9 @@ const moduleEntrypoints = [ 'public/js/chartReview.js', 'public/js/clinicalAssistant.js', 'public/js/admin.js', + 'public/js/admin-docs.js', 'public/js/diagrams.js', + 'public/js/drugs-loader.js', 'public/js/ed-encounters.js', 'public/js/extensions.js', 'public/js/hospitalCourse.js',