Skip to content

Commit

Permalink
Merge pull request #565 from rclement/fix-requirejs-rxjs-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
greenape authored Sep 6, 2021
2 parents 1ce352d + 06a8984 commit 0fba25b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mknotebooks/templates/custom_markdown.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

{% block header %}
{{ super() }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
(function() {
function addWidgetsRenderer() {
var requireJsScript = document.createElement('script');
requireJsScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js';
var mimeElement = document.querySelector('script[type="application/vnd.jupyter.widget-view+json"]');
var scriptElement = document.createElement('script');
var jupyterWidgetsScript = document.createElement('script');
var widgetRendererSrc = 'https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js';
var widgetState;
Expand All @@ -22,8 +24,10 @@
}
} catch(e) {}
scriptElement.src = widgetRendererSrc;
document.body.appendChild(scriptElement);
jupyterWidgetsScript.src = widgetRendererSrc;
document.body.appendChild(requireJsScript);
document.body.appendChild(jupyterWidgetsScript);
}
document.addEventListener('DOMContentLoaded', addWidgetsRenderer);
Expand Down

0 comments on commit 0fba25b

Please sign in to comment.