mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Everyone uses one model
This commit is contained in:
parent
b16171ac76
commit
c1c7bb7563
@ -203,6 +203,7 @@ function(widget_manager, underscore, backbone){
|
||||
},
|
||||
|
||||
});
|
||||
widget_manager.register_widget_model('WidgetModel', WidgetModel);
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -15,10 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
var BoolWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('BoolWidgetModel', BoolWidgetModel);
|
||||
|
||||
var CheckboxView = IPython.DOMWidgetView.extend({
|
||||
|
||||
// Called when view is rendered.
|
||||
|
@ -15,10 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
|
||||
var ButtonWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('ButtonWidgetModel', ButtonWidgetModel);
|
||||
|
||||
var ButtonView = IPython.DOMWidgetView.extend({
|
||||
|
||||
// Called when view is rendered.
|
||||
|
@ -15,10 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager) {
|
||||
|
||||
var ContainerModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('ContainerWidgetModel', ContainerModel);
|
||||
|
||||
var ContainerView = IPython.DOMWidgetView.extend({
|
||||
|
||||
render: function(){
|
||||
|
@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
var FloatWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('FloatWidgetModel', FloatWidgetModel);
|
||||
|
||||
// The Views for this model are shared with the bounded float, and can be
|
||||
// found in widget_float_range.js.
|
||||
});
|
@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
var ImageWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('ImageWidgetModel', ImageWidgetModel);
|
||||
|
||||
var ImageView = IPython.DOMWidgetView.extend({
|
||||
|
||||
// Called when view is rendered.
|
||||
|
@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
var IntWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel);
|
||||
|
||||
// The Views for this model are shared with the bounded int, and can be
|
||||
// found in widget_int_range.js.
|
||||
});
|
@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
var SelectionWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);
|
||||
|
||||
var DropdownView = IPython.DOMWidgetView.extend({
|
||||
|
||||
// Called when view is rendered.
|
||||
|
@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
var SelectionContainerModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('SelectionContainerWidgetModel', SelectionContainerModel);
|
||||
|
||||
var AccordionView = IPython.DOMWidgetView.extend({
|
||||
|
||||
render: function(){
|
||||
|
@ -15,9 +15,6 @@
|
||||
**/
|
||||
|
||||
define(["notebook/js/widgets/widget"], function(widget_manager){
|
||||
var StringWidgetModel = IPython.WidgetModel.extend({});
|
||||
widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel);
|
||||
|
||||
var HTMLView = IPython.DOMWidgetView.extend({
|
||||
|
||||
// Called when view is rendered.
|
||||
|
@ -44,7 +44,7 @@ class Widget(LoggingConfigurable):
|
||||
|
||||
|
||||
# Public declarations (Instance level)
|
||||
model_name = Unicode('widget', help="""Name of the backbone model
|
||||
model_name = Unicode('WidgetModel', help="""Name of the backbone model
|
||||
registered in the front-end to create and sync this widget with.""")
|
||||
view_name = Unicode(help="""Default view registered in the front-end
|
||||
to use to represent the widget.""", sync=True)
|
||||
|
@ -20,7 +20,6 @@ from IPython.utils.traitlets import Unicode, Bool, List
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class BoolWidget(DOMWidget):
|
||||
target_name = Unicode('BoolWidgetModel')
|
||||
view_name = Unicode('CheckboxView', sync=True)
|
||||
|
||||
# Model Keys
|
||||
|
@ -24,7 +24,6 @@ from IPython.utils.traitlets import Unicode, Bool, Int
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class ButtonWidget(DOMWidget):
|
||||
target_name = Unicode('ButtonWidgetModel')
|
||||
view_name = Unicode('ButtonView', sync=True)
|
||||
|
||||
# Keys
|
||||
|
@ -20,7 +20,6 @@ from IPython.utils.traitlets import Unicode, Bool, List, Instance
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class ContainerWidget(DOMWidget):
|
||||
target_name = Unicode('ContainerWidgetModel')
|
||||
view_name = Unicode('ContainerView', sync=True)
|
||||
|
||||
# Keys, all private and managed by helper methods. Flexible box model
|
||||
|
@ -20,7 +20,6 @@ from IPython.utils.traitlets import Unicode, Float, Bool, List
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class FloatWidget(DOMWidget):
|
||||
target_name = Unicode('FloatWidgetModel')
|
||||
view_name = Unicode('FloatTextView', sync=True)
|
||||
|
||||
# Keys
|
||||
|
@ -23,7 +23,6 @@ from IPython.utils.traitlets import Unicode, Bytes
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class ImageWidget(DOMWidget):
|
||||
target_name = Unicode('ImageWidgetModel')
|
||||
view_name = Unicode('ImageView', sync=True)
|
||||
|
||||
# Define the custom state properties to sync with the front-end
|
||||
|
@ -20,7 +20,6 @@ from IPython.utils.traitlets import Unicode, Int, Bool, List
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class IntWidget(DOMWidget):
|
||||
target_name = Unicode('IntWidgetModel')
|
||||
view_name = Unicode('IntTextView', sync=True)
|
||||
|
||||
# Keys
|
||||
|
@ -20,7 +20,6 @@ from IPython.utils.traitlets import Unicode, List, Bool
|
||||
# SelectionWidget
|
||||
#-----------------------------------------------------------------------------
|
||||
class SelectionWidget(DOMWidget):
|
||||
target_name = Unicode('SelectionWidgetModel')
|
||||
view_name = Unicode('DropdownView', sync=True)
|
||||
|
||||
# Keys
|
||||
|
@ -21,7 +21,6 @@ from IPython.utils.traitlets import Unicode, Dict, Int, List, Instance
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class SelectionContainerWidget(DOMWidget):
|
||||
target_name = Unicode('SelectionContainerWidgetModel')
|
||||
view_name = Unicode('TabView', sync=True)
|
||||
|
||||
# Keys
|
||||
|
@ -23,7 +23,6 @@ from IPython.utils.traitlets import Unicode, Bool, List, Int
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class StringWidget(DOMWidget):
|
||||
target_name = Unicode('StringWidgetModel')
|
||||
view_name = Unicode('TextBoxView', sync=True)
|
||||
|
||||
# Keys
|
||||
|
Loading…
Reference in New Issue
Block a user