Refactor hardcoded JS CDN links to _protected variables#1312
Refactor hardcoded JS CDN links to _protected variables#1312Conengmo merged 6 commits intopython-visualization:masterfrom and-viceversa:offline
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.pyexposes_default_jsand_default_cssat 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
flake8results. Sorry about that but I went by the contributing guideline.