##// END OF EJS Templates
Merge pull request #11267 from gnestor/display-javascript...
Kyle Kelley -
r24484:ee2798c2 merge
parent child Browse files
Show More
@@ -852,18 +852,25 b' class JSON(DisplayObject):'
852 def _repr_json_(self):
852 def _repr_json_(self):
853 return self._data_and_metadata()
853 return self._data_and_metadata()
854
854
855 _css_t = """$("head").append($("<link/>").attr({
855 _css_t = """var link = document.createElement("link");
856 rel: "stylesheet",
856 link.ref = "stylesheet";
857 type: "text/css",
857 link.type = "text/css";
858 href: "%s"
858 link.href = "%s";
859 }));
859 document.head.appendChild(link);
860 """
860 """
861
861
862 _lib_t1 = """$.getScript("%s", function () {
862 _lib_t1 = """new Promise(function(resolve, reject) {
863 """
863 var script = document.createElement("script");
864 _lib_t2 = """});
864 script.onload = resolve;
865 script.onerror = reject;
866 script.src = "%s";
867 document.head.appendChild(script);
868 }).then(() => {
865 """
869 """
866
870
871 _lib_t2 = """
872 });"""
873
867 class GeoJSON(JSON):
874 class GeoJSON(JSON):
868 """GeoJSON expects JSON-able dict
875 """GeoJSON expects JSON-able dict
869
876
General Comments 0
You need to be logged in to leave comments. Login now