Skip to content

HTML: legacy display JS not ported (collapsibles, full-screen image modal, script placeholders) #369

Backlog

Description

@irfanuddinahmad

The built-in HTML block's display JS (xmodule/js/src/html/display.js, bundled as HtmlBlockDisplay with collapsible.js, javascript_loader.js and imageModal.js) did four things when a block rendered. The extracted HtmlBlock (xblock_html/block.py, student_view) only does one of them, MathJax typesetting. The other three legacy content features no longer work:

  1. Collapsible sections: Collapsible.setCollapsibles() hid .longform content and added "See full output" / "Hide output" links to .shortform.
  2. Full-screen image modal: setupFullScreenModal() turned .image-modal markup into a zoomable, draggable full-screen image.
  3. Script placeholders: JavascriptLoader.executeModuleScripts() loaded .script_placeholder elements (data-src) as scripts, in order.

openedx/openedx-platform#38748 removed the built-in HTML block, and these features have been off since the extracted block became the default. Content that relies on this markup now shows the long form expanded, a plain image, or nothing for the placeholder scripts.

This is mostly old (2012–2014 era) content, so it's worth deciding whether to:

  • port these behaviors into xblock_html (the JS is small; imageModal.js needs draggabilly), or
  • document them as removed, with how course teams can do the same with their own <script>.

I found this by diffing the built-in block's JS against the extracted one. I haven't checked how common this markup is in real courses.

Part of the Slash-n-Burn Built-In XBlocks epic.

Generated using Claude Code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions