|
28 | 28 | {% block script %}
|
29 | 29 |
|
30 | 30 | {{super()}}
|
31 |
| - |
32 | 31 | <script type="text/javascript">
|
33 | 32 | sys_info = {{sys_info|safe}};
|
34 | 33 | </script>
|
35 | 34 |
|
36 | 35 | <script type="text/javascript" charset="utf-8">
|
| 36 | + // some ugly hacks to fix notebook 5.1.0's broken require config, as |
| 37 | + // introduced by https://github.com/jupyter/notebook/pull/2140 |
| 38 | + (function () { |
| 39 | + var nb_v_arr = sys_info.notebook_version.split('.'); |
| 40 | + if (Number(nb_v_arr[0]) == 5 && Number(nb_v_arr[1]) > 0) { |
| 41 | + console.log( |
| 42 | + '[nbextensions_configurator] patching requirejs config for notebook', |
| 43 | + sys_info.notebook_version); |
| 44 | + require.config({paths: { |
| 45 | + jed: 'components/jed/jed', |
| 46 | + json: 'components/requirejs-plugins/src/json', |
| 47 | + text: 'components/requirejs-text/text', |
| 48 | + moment: 'components/moment/min/moment-with-locales' |
| 49 | + }}); |
| 50 | + if (!require.defined('json!base/../../i18n/nbjs.json')) { |
| 51 | + define('json!base/../../i18n/nbjs.json', function() { return { |
| 52 | + "domain": "nbjs", |
| 53 | + "supported_languages": [], |
| 54 | + "locale_data": {"nbjs": {"": {"domain": "nbjs"}}} |
| 55 | + }; }); |
| 56 | + } |
| 57 | + } |
| 58 | + })(); // end ugly nb 5.1 hacks IIFE |
37 | 59 | require(['jquery'], function (jq) {
|
38 | 60 | // hack to fix notebook 4.2.1
|
39 | 61 | // see https://github.com/jupyter/notebook/pull/1399
|
|
0 commit comments