Skip to content

Replace most jQuery with vanilla JavaScript #17053

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

Merged
merged 4 commits into from
Apr 25, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Apr 7, 2020

PR Summary

This is a mix of the change in ipympl, plus the same thing for our original version of other stuff, using stuff like http://youmightnotneedjquery.com/ and this cheat sheet. Unfortunately, we can't just remove jQuery, because we have jquery-ui for the CSS and resizable handles. CSS is easy, and we can replace the handles without too much code (since we don't need its full flexibility), but this was large enough already.

Fixes #14596. Waiting on the JS style fix PR.

PR Checklist

  • Has Pytest style unit tests
  • [N/A] Code is Flake 8 compliant
  • [N/A] New features are documented, with examples if plot related
  • [N/A] Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@QuLogic QuLogic added this to the v3.3.0 milestone Apr 23, 2020
@tacaswell
Copy link
Member

I went over this with @dorafc who signed off on the JS. Did local testing, something is broken with nabagg as closing the figure on the python side does not close the js side, but that is also broken on master.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

something is broken with using webagg from the terminal, investigating.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

Pushed a fix for the issue I found.

@QuLogic can merge if happy with this.

@tacaswell
Copy link
Member

The circle failure is due to the dateutil inventory not downloading and travis is due to a weird wx import error.

@QuLogic
Copy link
Member Author

QuLogic commented Apr 25, 2020

Circle might be helped a bit by caching in #17183.

QuLogic and others added 4 commits April 25, 2020 00:05
This was done in ipympl, so is easier to compare if the same here.
This can be done with CSS selectors, so there's no need to add a class
via JS. The hover effect seems to work without it anyway.
This is a mix of the change in ipympl, plus the same thing for our
original version of other stuff.

Fixes matplotlib#14596.
Otherwise the quotes get escaped during the templating process which
results in invalid html/js being served.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forward port jquery removal from ipympl
3 participants