0.6.12: extract inline JavaScript from index.html#335
Open
maboa wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #334.
Faithful, verbatim extraction of the inline
<script>blocks inindex.htmlinto six external files. No behaviour changes — pure restructure.index.htmldrops 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
<script src>(not ES modules) so the ~14 inlineonclick/oninputhandlers and the globals shared across blocks keep resolving — per the constraint in Refactor: Extract inline JavaScript from index.html into separate files #334.editor-core→ storage →editor-file-menu→ export(module) →editor-main→editor-service-worker→editor-audio-cut(module) →editor-svg.?v=0.6.12; bumpsindex.htmlto 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.