superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Add support for IE 11 for markup slices (#3702)
Date Mon, 23 Oct 2017 22:35:22 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new b4bdc45  Add support for IE 11 for markup slices (#3702)
b4bdc45 is described below

commit b4bdc45a6b9d3c50c8b621ee1b168f3e94a74e2a
Author: Jay Lindquist <jay@bitwiseor.com>
AuthorDate: Mon Oct 23 17:35:15 2017 -0500

    Add support for IE 11 for markup slices (#3702)
    
    * Add srcdoc-polyfill tosupport Internet Explorer iframes in markup slices. Add allow-top-navigation
and allow-popups to support links within iframes
    
    * Remove jquery from markup.js
---
 superset/assets/package.json             |  3 ++-
 superset/assets/visualizations/markup.js | 11 +++++++----
 superset/data/__init__.py                |  2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/superset/assets/package.json b/superset/assets/package.json
index 83c87fd..634ba70 100644
--- a/superset/assets/package.json
+++ b/superset/assets/package.json
@@ -49,10 +49,10 @@
     "classnames": "^2.2.5",
     "d3": "^3.5.17",
     "d3-cloud": "^1.2.1",
+    "d3-hierarchy": "^1.1.5",
     "d3-sankey": "^0.4.2",
     "d3-svg-legend": "^1.x",
     "d3-tip": "^0.6.7",
-    "d3-hierarchy": "^1.1.5",
     "datamaps": "^0.5.8",
     "datatables.net-bs": "^1.10.15",
     "distributions": "^1.0.0",
@@ -93,6 +93,7 @@
     "redux-thunk": "^2.1.0",
     "shortid": "^2.2.6",
     "sprintf-js": "^1.1.1",
+    "srcdoc-polyfill": "^1.0.0",
     "supercluster": "https://github.com/georgeke/supercluster/tarball/ac3492737e7ce98e07af679623aad452373bbc40",
     "urijs": "^1.18.10",
     "viewport-mercator-project": "^2.1.0"
diff --git a/superset/assets/visualizations/markup.js b/superset/assets/visualizations/markup.js
index 27647da..739e451 100644
--- a/superset/assets/visualizations/markup.js
+++ b/superset/assets/visualizations/markup.js
@@ -1,4 +1,4 @@
-const $ = require('jquery');
+const srcdoc = require('srcdoc-polyfill');
 
 require('./markup.css');
 
@@ -23,9 +23,12 @@ function markupWidget(slice, payload) {
     <iframe id="${iframeId}"
       frameborder="0"
       height="${slice.height()}"
-      sandbox="allow-scripts">
-    </iframe>`);
-  $('#' + iframeId)[0].srcdoc = html;
+      sandbox="allow-same-origin allow-scripts allow-top-navigation allow-popups">
+    </iframe>
+  `);
+
+  const iframe = document.getElementById(iframeId);
+  srcdoc.set(iframe, html);
 }
 
 module.exports = markupWidget;
diff --git a/superset/data/__init__.py b/superset/data/__init__.py
index 2671a3f..3915106 100644
--- a/superset/data/__init__.py
+++ b/superset/data/__init__.py
@@ -688,7 +688,7 @@ def load_birth_names():
     <h1>Birth Names Dashboard</h1>
     <p>
         The source dataset came from
-        <a href="https://github.com/hadley/babynames">[here]</a>
+        <a href="https://github.com/hadley/babynames" target="_blank">[here]</a>
     </p>
     <img src="/static/assets/images/babytux.jpg">
 </div>

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message