mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Unify handling of CodeMirror
Load codemirror as a script tag Load codemirror synchronously More cleanup of codemirror handling Make the config more succinct Reinstate mode/meta
This commit is contained in:
parent
3ea9c96bbc
commit
6205ba9a21
@ -21,6 +21,8 @@
|
||||
<script src="{{static_url("components/bootstrap/js/bootstrap.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
|
||||
<script src="{{static_url("components/bootstrap-tour/build/js/bootstrap-tour.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- window.Tour -->
|
||||
<script src="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
|
||||
<script src="{{static_url("components/codemirror/lib/codemirror.js") }}" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="{{static_url("components/codemirror/mode/meta.js") }}" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
window['staticURL'] = "{{static_url("", include_version=False)}}";
|
||||
@ -178,6 +180,19 @@
|
||||
define("jquery-ui", function () {
|
||||
return window.$;
|
||||
});
|
||||
|
||||
define("codemirror/lib/codemirror", function () {
|
||||
return window.CodeMirror;
|
||||
});
|
||||
|
||||
define("codemirror/mode/meta", function () {
|
||||
return window.CodeMirror;
|
||||
});
|
||||
|
||||
define("CodeMirror", function () {
|
||||
return window.CodeMirror;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{% block meta %}
|
||||
|
@ -39,8 +39,8 @@ var commonConfig = {
|
||||
bootstraptour: 'Tour',
|
||||
'jquery-ui': '$',
|
||||
typeahead: '$.typeahead',
|
||||
'codemirror/lib/codemirror': 'commonjs codemirror/lib/codemirror',
|
||||
'codemirror/mode/meta': 'commonjs codemirror/mode/meta',
|
||||
'codemirror/lib/codemirror': 'CodeMirror',
|
||||
'codemirror/mode/meta': 'CodeMirror',
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user