Skip to content

0.6.12: extract inline JavaScript from index.html#335

Open
maboa wants to merge 1 commit into
mainfrom
0.6.12-extract-inline-js
Open

0.6.12: extract inline JavaScript from index.html#335
maboa wants to merge 1 commit into
mainfrom
0.6.12-extract-inline-js

Conversation

@maboa

@maboa maboa commented Jun 21, 2026

Copy link
Copy Markdown
Member

Closes #334.

Faithful, verbatim extraction of the inline <script> blocks in index.html into six external files. No behaviour changes — pure restructure.

index.html drops from ~2,430 to ~820 lines (now mostly markup). The diff is +1,614/−1,614 (a straight move).

New files (loaded in the exact original document order and script type)

  • js/editor-core.js (classic)
  • js/editor-file-menu.js (classic)
  • js/editor-main.js (classic)
  • js/editor-service-worker.js (classic)
  • js/editor-audio-cut.js (module — the one ES import repathed ./js/audio-cut.js./audio-cut.js)
  • js/editor-svg.js (classic)

Notes

  • Kept as plain <script src> (not ES modules) so the ~14 inline onclick/oninput handlers and the globals shared across blocks keep resolving — per the constraint in Refactor: Extract inline JavaScript from index.html into separate files #334.
  • Order preserved exactly: editor-core → storage → editor-file-menu → export(module) → editor-maineditor-service-workereditor-audio-cut(module) → editor-svg.
  • Cache-busts new files at ?v=0.6.12; bumps index.html to 0.6.12.

Verification

Headless: page loads with no console/page errors, all global handler functions resolve, the SVG globals resolve, and play → autoscroll still works. Worth a manual click-through of transcribe / caption mode / save-load too, since those weren't exercised headlessly.

Faithful, verbatim extraction of the inline <script> blocks into six external
files, loaded in the exact same document order and script type. No behaviour
changes. index.html drops from ~2,430 to ~820 lines (now mostly markup).

- js/editor-core.js          (classic)
- js/editor-file-menu.js     (classic)
- js/editor-main.js          (classic)
- js/editor-service-worker.js(classic)
- js/editor-audio-cut.js     (module; import repathed ./js/audio-cut.js -> ./audio-cut.js)
- js/editor-svg.js           (classic)

Kept as plain <script src> (not ES modules) so the ~14 inline onclick/oninput
handlers and cross-block globals keep resolving. Cache-bust new files at v0.6.12;
bump index.html to 0.6.12.

Verified headless: page loads with no console/page errors, all global handler
functions resolve, SVG globals resolve, and play -> autoscroll still works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Extract inline JavaScript from index.html into separate files

1 participant