-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Refactor hardcoded JS CDN links to _protected variables #1312
Conversation
Hi @and-viceversa, thanks for your PR, I think this is a good idea! For anyone reading along, this was discussed in #351 and more recently in #1312. Two things: I'd prefer if each module had the same variable name for the JS and css links. Since we already have Can you remove the style changes in code you otherwise wouldn't touch? It makes reviewing a lot more work, and since I'm doing this in my free time that's something to look out for. I'll update the contributing guide to reflect this as well. |
# Conflicts: # folium/plugins/polyline_offset.py
Please see updated PR. The plugins that use them now follow the The Most plugins only use 1 JS or CSS file, so this is a bit overkill. But now it's uniform. Thanks for your quick feedback. Let me know what else I can do on this. Edit: Also, if the PR looks like Git spaghetti - first time doing this not on my own repos. Please advise if that part needs to be cleaner. |
Looks good @and-viceversa ! I'll check in more detail before merging, but at this time there's nothing else for you to do. Don't worry about the commits, we squash and merge. |
Thanks for your work on this @and-viceversa ! |
folium.py
exposes_default_js
and_default_css
at a high level. This is good, because you can override the CDN URL to point elsewhere. In my case, to point to a static assets folder.The plugins do not do this. This PR moves the URLs out of their respective
render()
methods to expose them in a similar way. This shouldn't change any existing behavior.Also, 98% of the changes are fixing
flake8
results. Sorry about that but I went by the contributing guideline.