-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor hardcoded JS CDN links to module variables (#1312)
- Loading branch information
1 parent
2c8e2a5
commit 3c48be0
Showing
22 changed files
with
315 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ | |
|
||
from jinja2 import Template | ||
|
||
_default_js = [ | ||
('antpath', | ||
'https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet-ant-path.min.js') | ||
] | ||
|
||
|
||
class AntPath(BaseMultiLocation): | ||
""" | ||
|
@@ -66,7 +71,6 @@ def render(self, **kwargs): | |
assert isinstance(figure, Figure), ('You cannot render this Element ' | ||
'if it is not in a Figure.') | ||
|
||
figure.header.add_child( | ||
JavascriptLink('https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet-ant-path.min.js'), # noqa | ||
name='antpath', | ||
) | ||
# Import Javascripts | ||
for name, url in _default_js: | ||
figure.header.add_child(JavascriptLink(url), name=name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ | |
|
||
from jinja2 import Template | ||
|
||
_default_js = [ | ||
('featuregroupsubgroupjs', | ||
'https://unpkg.com/[email protected]/dist/leaflet.featuregroup.subgroup.js'), | ||
] | ||
|
||
|
||
class FeatureGroupSubGroup(Layer): | ||
""" | ||
|
@@ -78,6 +83,6 @@ def render(self, **kwargs): | |
assert isinstance(figure, Figure), ('You cannot render this Element ' | ||
'if it is not in a Figure.') | ||
|
||
figure.header.add_child( | ||
JavascriptLink('https://unpkg.com/[email protected]/dist/leaflet.featuregroup.subgroup.js'), # noqa | ||
name='featuregroupsubgroupjs') | ||
# Import Javascripts | ||
for name, url in _default_js: | ||
figure.header.add_child(JavascriptLink(url), name=name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.