mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
s/view_name/_view_name
This commit is contained in:
parent
2d13d05e9c
commit
288b8a0ced
@ -91,7 +91,7 @@
|
||||
},
|
||||
|
||||
WidgetManager.prototype.create_view = function(model, options, view) {
|
||||
var view_name = model.get('view_name');
|
||||
var view_name = model.get('_view_name');
|
||||
var ViewType = WidgetManager._view_types[view_name];
|
||||
if (ViewType !== undefined && ViewType !== null) {
|
||||
|
||||
|
@ -119,7 +119,7 @@ class Widget(LoggingConfigurable):
|
||||
#-------------------------------------------------------------------------
|
||||
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
|
||||
_view_name = Unicode(help="""Default view registered in the front-end
|
||||
to use to represent the widget.""", sync=True)
|
||||
_comm = Instance('IPython.kernel.comm.Comm')
|
||||
|
||||
|
@ -26,9 +26,9 @@ class _BoolWidget(DOMWidget):
|
||||
|
||||
|
||||
class CheckBoxWidget(_BoolWidget):
|
||||
view_name = Unicode('CheckBoxView', sync=True)
|
||||
_view_name = Unicode('CheckBoxView', sync=True)
|
||||
|
||||
|
||||
class ToggleButtonWidget(_BoolWidget):
|
||||
view_name = Unicode('ToggleButtonView', sync=True)
|
||||
_view_name = Unicode('ToggleButtonView', sync=True)
|
||||
|
@ -21,7 +21,7 @@ from IPython.utils.traitlets import Unicode, Bool
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class ButtonWidget(DOMWidget):
|
||||
view_name = Unicode('ButtonView', sync=True)
|
||||
_view_name = Unicode('ButtonView', sync=True)
|
||||
|
||||
# Keys
|
||||
description = Unicode('', help="Description of the button (label).", sync=True)
|
||||
|
@ -20,7 +20,7 @@ from IPython.utils.traitlets import Unicode, Bool, List, Instance
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class ContainerWidget(DOMWidget):
|
||||
view_name = Unicode('ContainerView', sync=True)
|
||||
_view_name = Unicode('ContainerView', sync=True)
|
||||
|
||||
# Keys, all private and managed by helper methods. Flexible box model
|
||||
# classes...
|
||||
@ -50,7 +50,7 @@ class ContainerWidget(DOMWidget):
|
||||
|
||||
|
||||
class PopupWidget(ContainerWidget):
|
||||
view_name = Unicode('PopupView', sync=True)
|
||||
_view_name = Unicode('PopupView', sync=True)
|
||||
|
||||
description = Unicode(sync=True)
|
||||
button_text = Unicode(sync=True)
|
||||
|
@ -42,18 +42,18 @@ class _BoundedFloatWidget(_FloatWidget):
|
||||
|
||||
|
||||
class FloatTextWidget(_FloatWidget):
|
||||
view_name = Unicode('FloatTextView', sync=True)
|
||||
_view_name = Unicode('FloatTextView', sync=True)
|
||||
|
||||
|
||||
class BoundedFloatTextWidget(_BoundedFloatWidget):
|
||||
view_name = Unicode('FloatTextView', sync=True)
|
||||
_view_name = Unicode('FloatTextView', sync=True)
|
||||
|
||||
|
||||
class FloatSliderWidget(_BoundedFloatWidget):
|
||||
view_name = Unicode('FloatSliderView', sync=True)
|
||||
_view_name = Unicode('FloatSliderView', sync=True)
|
||||
orientation = Enum([u'horizontal', u'vertical'], u'horizontal',
|
||||
help="Vertical or horizontal.", sync=True)
|
||||
|
||||
|
||||
class FloatProgressWidget(_BoundedFloatWidget):
|
||||
view_name = Unicode('ProgressView', sync=True)
|
||||
_view_name = Unicode('ProgressView', sync=True)
|
||||
|
@ -23,7 +23,7 @@ from IPython.utils.traitlets import Unicode, CUnicode, Bytes
|
||||
# Classes
|
||||
#-----------------------------------------------------------------------------
|
||||
class ImageWidget(DOMWidget):
|
||||
view_name = Unicode('ImageView', sync=True)
|
||||
_view_name = Unicode('ImageView', sync=True)
|
||||
|
||||
# Define the custom state properties to sync with the front-end
|
||||
format = Unicode('png', sync=True)
|
||||
|
@ -42,18 +42,18 @@ class _BoundedIntWidget(_IntWidget):
|
||||
|
||||
|
||||
class IntTextWidget(_IntWidget):
|
||||
view_name = Unicode('IntTextView', sync=True)
|
||||
_view_name = Unicode('IntTextView', sync=True)
|
||||
|
||||
|
||||
class BoundedIntTextWidget(_BoundedIntWidget):
|
||||
view_name = Unicode('IntTextView', sync=True)
|
||||
_view_name = Unicode('IntTextView', sync=True)
|
||||
|
||||
|
||||
class IntSliderWidget(_BoundedIntWidget):
|
||||
view_name = Unicode('IntSliderView', sync=True)
|
||||
_view_name = Unicode('IntSliderView', sync=True)
|
||||
orientation = Enum([u'horizontal', u'vertical'], u'horizontal',
|
||||
help="Vertical or horizontal.", sync=True)
|
||||
|
||||
|
||||
class IntProgressWidget(_BoundedIntWidget):
|
||||
view_name = Unicode('ProgressView', sync=True)
|
||||
_view_name = Unicode('ProgressView', sync=True)
|
||||
|
@ -85,16 +85,16 @@ class _SelectionWidget(DOMWidget):
|
||||
|
||||
|
||||
class ToggleButtonsWidget(_SelectionWidget):
|
||||
view_name = Unicode('ToggleButtonsView', sync=True)
|
||||
_view_name = Unicode('ToggleButtonsView', sync=True)
|
||||
|
||||
|
||||
class DropdownWidget(_SelectionWidget):
|
||||
view_name = Unicode('DropdownView', sync=True)
|
||||
_view_name = Unicode('DropdownView', sync=True)
|
||||
|
||||
|
||||
class RadioButtonsWidget(_SelectionWidget):
|
||||
view_name = Unicode('RadioButtonsView', sync=True)
|
||||
_view_name = Unicode('RadioButtonsView', sync=True)
|
||||
|
||||
|
||||
class ListBoxWidget(_SelectionWidget):
|
||||
view_name = Unicode('ListBoxView', sync=True)
|
||||
_view_name = Unicode('ListBoxView', sync=True)
|
||||
|
@ -51,8 +51,8 @@ class _SelectionContainerWidget(ContainerWidget):
|
||||
|
||||
|
||||
class AccordionWidget(_SelectionContainerWidget):
|
||||
view_name = Unicode('AccordionView', sync=True)
|
||||
_view_name = Unicode('AccordionView', sync=True)
|
||||
|
||||
|
||||
class TabWidget(_SelectionContainerWidget):
|
||||
view_name = Unicode('TabView', sync=True)
|
||||
_view_name = Unicode('TabView', sync=True)
|
||||
|
@ -26,22 +26,22 @@ class _StringWidget(DOMWidget):
|
||||
|
||||
|
||||
class HTMLWidget(_StringWidget):
|
||||
view_name = Unicode('HTMLView', sync=True)
|
||||
_view_name = Unicode('HTMLView', sync=True)
|
||||
|
||||
|
||||
class LatexWidget(_StringWidget):
|
||||
view_name = Unicode('LatexView', sync=True)
|
||||
_view_name = Unicode('LatexView', sync=True)
|
||||
|
||||
|
||||
class TextAreaWidget(_StringWidget):
|
||||
view_name = Unicode('TextAreaView', sync=True)
|
||||
_view_name = Unicode('TextAreaView', sync=True)
|
||||
|
||||
def scroll_to_bottom(self):
|
||||
self.send({"method": "scroll_to_bottom"})
|
||||
|
||||
|
||||
class TextBoxWidget(_StringWidget):
|
||||
view_name = Unicode('TextBoxView', sync=True)
|
||||
_view_name = Unicode('TextBoxView', sync=True)
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(TextBoxWidget, self).__init__(**kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user