Skip to content

Add embedded static eXeLearning editor support#26

Merged
eXeLearningProject merged 6 commits intomainfrom
feature/embedded-static-editor
Apr 23, 2026
Merged

Add embedded static eXeLearning editor support#26
eXeLearningProject merged 6 commits 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
Copy link
Copy Markdown
Collaborator

@ignaciogros ignaciogros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing job, @erseco.

I only changed a few things:

  • Fix make package failing on Windows where rsync and zip are unavailable.
  • Update activity icons to match the latest eXeLearning design system.
  • New changelog file.

Please review the changelog and the make package.

Thank you!

@eXeLearningProject eXeLearningProject merged commit 4bab3cf into main Apr 23, 2026
1 check passed
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.

3 participants