Skip to content

Add embedded static eXeLearning editor support#26

Open
erseco wants to merge 1 commit intomainfrom
feature/embedded-static-editor
Open

Add embedded static eXeLearning editor support#26
erseco wants to merge 1 commit intomainfrom
feature/embedded-static-editor

Conversation

@erseco
Copy link
Copy Markdown
Collaborator

@erseco erseco commented Apr 2, 2026

Summary

This PR adds a fully integrated embedded eXeLearning editor that runs inside Moodle, allowing teachers to create and edit web content without leaving the platform.

Note: This PR replaces #25 with a cleaner single-commit history.

Features

  • Editor bootstrap (editor/index.php, editor/static.php, editor/save.php) — loads the static editor build inside an iframe with a postMessage bridge for save/load communication
  • Admin settings widget — install/update/uninstall the editor from GitHub releases with spinner UX and multilingual status messages
  • External API (manage_embedded_editor) — AJAX endpoints for install and status actions
  • Source resolver — moodledata > bundled precedence policy for editor assets
  • PostMessage bridge (moodle_exe_bridge.js) — handles OPEN_FILE, REQUEST_EXPORT, and document change tracking via yjs
  • Admin-aware error messages — admins see "install from plugin settings", non-admins see "contact your administrator"
  • Blueprint — Playground configuration with all default settings and sample activities
  • Translations — en, es, ca, eu, gl
  • Capabilitymod/exeweb:manageembeddededitor
  • CI — Playground PR preview support, editor release checker

Technical notes

  • Trusted origins for postMessage use scheme+host only (not full wwwroot path) to work on subpath deployments
  • Editor errors render as inline HTML pages (not moodle_exception) to display cleanly inside iframes
  • Includes manage_embedded_editor_upload.php endpoint for Playground environments where PHP WASM cannot directly fetch GitHub

Test plan

  • Go to Site administration > Plugins > eXeLearning (website) settings
  • Set editor mode to "Integrated editor (embedded)"
  • Click "Install latest version" — verify spinner + "Downloading and installing..." message
  • Create a new eXeLearning web activity
  • Click "Edit with eXeLearning" — verify editor opens
  • Make changes, save — verify content updates
  • Test as non-admin: verify "contact your administrator" message when editor not installed
  • Verify translations display correctly (switch language)

Moodle Playground Preview

The changes in this pull request can be previewed and tested using a Moodle Playground instance.

Preview in Moodle Playground

⚠️ The embedded eXeLearning editor is not included in this preview. You can install it from Modules > eXeLearning Web > Configure using the "Download & Install Editor" button. All other module features (ELPX upload, viewer, preview) work normally.

Add a fully integrated embedded eXeLearning editor that runs inside
Moodle, allowing teachers to create and edit web content without
leaving the platform.

Key changes:
- Editor bootstrap (editor/index.php, editor/static.php, editor/save.php)
  that loads the static editor build inside an iframe with postMessage
  bridge for save/load communication
- Admin settings widget to install/update/uninstall the editor from
  GitHub releases, with spinner UX and multilingual status messages
- External API (manage_embedded_editor) for install/status AJAX actions
- Source resolver with moodledata > bundled precedence policy
- PostMessage bridge (moodle_exe_bridge.js) handling OPEN_FILE,
  REQUEST_EXPORT, and document change tracking via yjs
- Admin-aware error messages: admins see "install from plugin settings",
  non-admins see "contact your administrator"
- Fix trusted origins for postMessage (use scheme+host only)
- Blueprint with all default settings and sample activities
- Translations for en, es, ca, eu, gl
- Capability mod/exeweb:manageembeddededitor
- CI: Playground PR preview support
@erseco erseco self-assigned this Apr 2, 2026
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.

1 participant