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:
Jonathan Frederic 2013-12-30 08:10:51 -08:00 committed by Jonathan Frederic
parent b588a56f76
commit 3361826b5a
3 changed files with 16 additions and 5 deletions

View File

@ -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) {
//-------------------------------------------------------------------- //--------------------------------------------------------------------

View File

@ -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){
//-------------------------------------------------------------------- //--------------------------------------------------------------------

View File

@ -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>