mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Added require.js shims for underscore and backbone
This is necessary since underscore and backbone are no longer AMD modules.
This commit is contained in:
parent
b588a56f76
commit
3361826b5a
@ -21,8 +21,8 @@
|
|||||||
// Use require.js 'define' method so that require.js is intelligent enough to
|
// Use require.js 'define' method so that require.js is intelligent enough to
|
||||||
// syncronously load everything within this file when it is being 'required'
|
// syncronously load everything within this file when it is being 'required'
|
||||||
// elsewhere.
|
// elsewhere.
|
||||||
define(["components/underscore/underscore-min",
|
define(["underscore",
|
||||||
"components/backbone/backbone-min",
|
"backbone",
|
||||||
], function (underscore, backbone) {
|
], function (underscore, backbone) {
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
define(["notebook/js/widgetmanager",
|
define(["notebook/js/widgetmanager",
|
||||||
"components/underscore/underscore-min",
|
"underscore",
|
||||||
"components/backbone/backbone-min"],
|
"backbone"],
|
||||||
function(widget_manager, underscore, backbone){
|
function(widget_manager, underscore, backbone){
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -21,7 +21,18 @@
|
|||||||
require.config({
|
require.config({
|
||||||
baseUrl: '{{static_url("")}}',
|
baseUrl: '{{static_url("")}}',
|
||||||
paths: {
|
paths: {
|
||||||
nbextensions : '{{ base_project_url }}nbextensions'
|
nbextensions : '{{ base_project_url }}nbextensions',
|
||||||
|
underscore : '{{static_url()}}components/underscore/underscore-min',
|
||||||
|
backbone : '{{static_url()}}components/backbone/backbone-min',
|
||||||
|
},
|
||||||
|
shim: {
|
||||||
|
underscore: {
|
||||||
|
exports: '_'
|
||||||
|
},
|
||||||
|
backbone: {
|
||||||
|
deps: ["underscore", "jquery"],
|
||||||
|
exports: "Backbone"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user