forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] Explicit JS initialization everywhere (hedyorg#4052)
Remove `APP_STATE` and `passFromHtml` features. All JavaScript initialization is now done by calling `initialize()` (in `initialize.ts`), and optionally by passing page-specific options (from Python to JavaScript in `javascript_page_options`, which get dispatched in `initialize.ts`). Each module now has their own copy of some globals they might need... this is still not the ideal end state, but at least each individual module can now be refactored independently. Also making an attempt to reduce the size of `app.ts`, which is starting to grow quite large, by moving functionality out into their own files where it makes sense. In this PR: - Remove `APP_STATE` - Introduce page-specific initialization options - Move the app-specific logic (around loading programs, hiding and showing various page elements based on the current tab) from `tabs.ts` to `app.ts`, by using an event mechanism (`tabs.on('afterSwitch', () => { ... })`). - Move the functionality that has to do with debugging from `app.ts` into `debugging.ts`. - Move the `onElementBecomesVisible` functionality out of `app.ts` into its own file - Move some `<script>` tags out from HTML into JavaScript
- Loading branch information
Showing
30 changed files
with
1,234 additions
and
944 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
gettext('level_title') | ||
gettext('unsaved_class_changes') | ||
gettext('teacher_welcome') |
Oops, something went wrong.