Changed require.js load calls to allow require.js to pass

the import module handles around.
This commit is contained in:
Jonathan Frederic 2013-11-15 19:51:29 +00:00
parent 90030b238b
commit 1131100d21
9 changed files with 34 additions and 31 deletions

View File

@ -22,7 +22,7 @@
// elsewhere. // elsewhere.
define(["components/underscore/underscore-min", define(["components/underscore/underscore-min",
"components/backbone/backbone-min", "components/backbone/backbone-min",
], function(){ ], function(underscore, backbone){
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -480,6 +480,9 @@ define(["components/underscore/underscore-min",
IPython.WidgetModel = WidgetModel; IPython.WidgetModel = WidgetModel;
IPython.WidgetView = WidgetView; IPython.WidgetView = WidgetView;
IPython.widget_manager = new WidgetManager(); if (IPython.widget_manager==undefined || IPython.widget_manager==null) {
IPython.widget_manager = new WidgetManager();
}
return IPython.widget_manager;
}); });

View File

@ -14,10 +14,10 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var BoolWidgetModel = IPython.WidgetModel.extend({}); var BoolWidgetModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('BoolWidgetModel', BoolWidgetModel); widget_manager.register_widget_model('BoolWidgetModel', BoolWidgetModel);
var CheckboxView = IPython.WidgetView.extend({ var CheckboxView = IPython.WidgetView.extend({
@ -66,7 +66,7 @@ define(["notebook/js/widget"], function(){
}); });
IPython.widget_manager.register_widget_view('CheckboxView', CheckboxView); widget_manager.register_widget_view('CheckboxView', CheckboxView);
var ToggleButtonView = IPython.WidgetView.extend({ var ToggleButtonView = IPython.WidgetView.extend({
@ -119,6 +119,6 @@ define(["notebook/js/widget"], function(){
}, },
}); });
IPython.widget_manager.register_widget_view('ToggleButtonView', ToggleButtonView); widget_manager.register_widget_view('ToggleButtonView', ToggleButtonView);
}); });

View File

@ -14,10 +14,10 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var ButtonWidgetModel = IPython.WidgetModel.extend({}); var ButtonWidgetModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('ButtonWidgetModel', ButtonWidgetModel); widget_manager.register_widget_model('ButtonWidgetModel', ButtonWidgetModel);
var ButtonView = IPython.WidgetView.extend({ var ButtonView = IPython.WidgetView.extend({
@ -51,6 +51,6 @@ define(["notebook/js/widget"], function(){
}); });
IPython.widget_manager.register_widget_view('ButtonView', ButtonView); widget_manager.register_widget_view('ButtonView', ButtonView);
}); });

View File

@ -14,9 +14,9 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager) {
var ContainerModel = IPython.WidgetModel.extend({}); var ContainerModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('ContainerWidgetModel', ContainerModel); widget_manager.register_widget_model('ContainerWidgetModel', ContainerModel);
var ContainerView = IPython.WidgetView.extend({ var ContainerView = IPython.WidgetView.extend({
@ -58,5 +58,5 @@ define(["notebook/js/widget"], function(){
}, },
}); });
IPython.widget_manager.register_widget_view('ContainerView', ContainerView); widget_manager.register_widget_view('ContainerView', ContainerView);
}); });

View File

@ -14,7 +14,7 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var FloatWidgetModel = IPython.WidgetModel.extend({}); var FloatWidgetModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('FloatWidgetModel', FloatWidgetModel); widget_manager.register_widget_model('FloatWidgetModel', FloatWidgetModel);
}); });

View File

@ -14,7 +14,7 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var IntWidgetModel = IPython.WidgetModel.extend({}); var IntWidgetModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel); widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel);
}); });

View File

@ -14,9 +14,9 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var MulticontainerModel = IPython.WidgetModel.extend({}); var MulticontainerModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('MulticontainerWidgetModel', MulticontainerModel); widget_manager.register_widget_model('MulticontainerWidgetModel', MulticontainerModel);
var AccordionView = IPython.WidgetView.extend({ var AccordionView = IPython.WidgetView.extend({
@ -97,7 +97,7 @@ define(["notebook/js/widget"], function(){
}, },
}); });
IPython.widget_manager.register_widget_view('AccordionView', AccordionView); widget_manager.register_widget_view('AccordionView', AccordionView);
var TabView = IPython.WidgetView.extend({ var TabView = IPython.WidgetView.extend({
@ -174,5 +174,5 @@ define(["notebook/js/widget"], function(){
}, },
}); });
IPython.widget_manager.register_widget_view('TabView', TabView); widget_manager.register_widget_view('TabView', TabView);
}); });

View File

@ -14,9 +14,9 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var SelectionWidgetModel = IPython.WidgetModel.extend({}); var SelectionWidgetModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel); widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);
var DropdownView = IPython.WidgetView.extend({ var DropdownView = IPython.WidgetView.extend({
@ -106,7 +106,7 @@ define(["notebook/js/widget"], function(){
}); });
IPython.widget_manager.register_widget_view('DropdownView', DropdownView); widget_manager.register_widget_view('DropdownView', DropdownView);
var RadioButtonsView = IPython.WidgetView.extend({ var RadioButtonsView = IPython.WidgetView.extend({
@ -191,7 +191,7 @@ define(["notebook/js/widget"], function(){
}); });
IPython.widget_manager.register_widget_view('RadioButtonsView', RadioButtonsView); widget_manager.register_widget_view('RadioButtonsView', RadioButtonsView);
var ToggleButtonsView = IPython.WidgetView.extend({ var ToggleButtonsView = IPython.WidgetView.extend({
@ -273,5 +273,5 @@ define(["notebook/js/widget"], function(){
}); });
IPython.widget_manager.register_widget_view('ToggleButtonsView', ToggleButtonsView); widget_manager.register_widget_view('ToggleButtonsView', ToggleButtonsView);
}); });

View File

@ -14,9 +14,9 @@
* @namespace IPython * @namespace IPython
**/ **/
define(["notebook/js/widget"], function(){ define(["notebook/js/widget"], function(widget_manager){
var StringWidgetModel = IPython.WidgetModel.extend({}); var StringWidgetModel = IPython.WidgetModel.extend({});
IPython.widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel); widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel);
var LabelView = IPython.WidgetView.extend({ var LabelView = IPython.WidgetView.extend({
@ -35,7 +35,7 @@ define(["notebook/js/widget"], function(){
}); });
IPython.widget_manager.register_widget_view('LabelView', LabelView); widget_manager.register_widget_view('LabelView', LabelView);
var TextAreaView = IPython.WidgetView.extend({ var TextAreaView = IPython.WidgetView.extend({
@ -89,7 +89,7 @@ define(["notebook/js/widget"], function(){
}, },
}); });
IPython.widget_manager.register_widget_view('TextAreaView', TextAreaView); widget_manager.register_widget_view('TextAreaView', TextAreaView);
var TextBoxView = IPython.WidgetView.extend({ var TextBoxView = IPython.WidgetView.extend({
@ -143,5 +143,5 @@ define(["notebook/js/widget"], function(){
}, },
}); });
IPython.widget_manager.register_widget_view('TextBoxView', TextBoxView); widget_manager.register_widget_view('TextBoxView', TextBoxView);
}); });