Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Reimplement the Zooming Image Tool [Sumac backport] #36027

Conversation

arbrandes
Copy link
Contributor

@arbrandes arbrandes commented Dec 13, 2024

This is a backport of #36012 to Sumac.

Description

This recreates the Zooming Image Tool template for the HTML block. It does it in such a way that doesn't depend on any external resources: both the loupe code and sample image are inlined.

Some benefits to this version are:

  • We can now maintain the loupe javascript code properly

  • Because the javascript is included in the contents of the block itself, the course author can customize it as needed

  • As opposed to the previous iteration, the magnified image URL is now optional: if it's not present, the regular image will be used for magnification

  • There can now be two or more instances of the tool in the same unit.

Adolfo R. Brandes and others added 2 commits December 13, 2024 11:36
The Zooming Image Tool does not load properly, currently, and even if it
did, relying on an external Javascript to function across releases is
not something we can support.  Thus, we remove it from the list of HTML
block templates until such time as a more robust solution is found.
This recreates the Zooming Image Tool template for the HTML block.  It
does it in such a way that doesn't depend on any external resources:
both the loupe code and sample image are inlined.

Some benefits to this version are:

* We can now maintain the loupe javascript code properly

* Because the javascript is included in the contents of the block
  itself, the course author can customize it as needed

* As opposed to the previous iteration, the magnified image URL is now
  optional: if it's not present, the regular image will be used for
  magnification

* There can now be two or more instances of the tool in the same unit.

This also removes some CSS left over from the previous iteration.
@arbrandes arbrandes changed the title reimplement zooming image tool sumac feat: Reimplement the Zooming Image Tool [Sumac backport] Dec 13, 2024
Copy link
Contributor

@pdpinch pdpinch left a comment

Choose a reason for hiding this comment

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

you rock @arbrandes

I was just surprised by the changes to test_block.py. That wasn't part of master PR #36012 was it?

)
self.assertEqual(resp.status_code, 200)
html, __ = self._get_container_preview(split_test_usage_key)
self.assertIn("Announcement", html)
self.assertIn("Zooming", html)
self.assertIn("LaTeX", html)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this come from?

Copy link
Member

Choose a reason for hiding this comment

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

It comes from this PR that was merged before #36012

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test suite for these templates just randomly included some of them (and not others). When removing the tool originally, I just added another random one. 🤷🏼

@arbrandes arbrandes merged commit bc17b35 into openedx:open-release/sumac.master Dec 13, 2024
48 checks passed
@arbrandes
Copy link
Contributor Author

@pdpinch, the changes were part of the original removal PR, which got included here as well.

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