diff --git a/IPython/html/static/notebook/js/widgets/model_container.js b/IPython/html/static/notebook/js/widgets/model_container.js
index 2b8a896..a4f1325 100644
--- a/IPython/html/static/notebook/js/widgets/model_container.js
+++ b/IPython/html/static/notebook/js/widgets/model_container.js
@@ -1,2 +1,17 @@
var ContainerModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('container_widget', ContainerModel);
+
+var ContainerView = IPython.WidgetView.extend({
+
+ render : function(){
+ this.$el.html('');
+ this.$container = $('
')
+ .addClass('container')
+ .addClass(this.model.comm.comm_id);
+ this.$el.append(this.$container);
+ },
+
+ update : function(){},
+});
+
+IPython.notebook.widget_manager.register_widget_view('ContainerView', ContainerView);
diff --git a/IPython/html/static/notebook/js/widgets/model_float_range.js b/IPython/html/static/notebook/js/widgets/model_float_range.js
index fad0d59..0fc5366 100644
--- a/IPython/html/static/notebook/js/widgets/model_float_range.js
+++ b/IPython/html/static/notebook/js/widgets/model_float_range.js
@@ -1,2 +1,119 @@
var FloatRangeWidgetModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('FloatRangeWidgetModel', FloatRangeWidgetModel);
+
+var FloatSliderView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.$slider = $('')
+ .slider({})
+ .addClass('slider');
+
+ // Put the slider in a container
+ this.$slider_container = $('')
+ .css('padding-top', '4px')
+ .css('padding-bottom', '4px')
+ .append(this.$slider);
+ this.$el.append(this.$slider_container);
+
+ // Set defaults.
+ this.update();
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ // Slider related keys.
+ var _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation'];
+ for (var index in _keys) {
+ var key = _keys[index];
+ if (this.model.get(key) != undefined) {
+ this.$slider.slider("option", key, this.model.get(key));
+ }
+ }
+ },
+
+ // Handles: User input
+ events: { "slide" : "handleSliderChange" },
+ handleSliderChange: function(e, ui) {
+ this.model.set('value', ui.value);
+ this.model.apply(this);
+ },
+});
+
+IPython.notebook.widget_manager.register_widget_view('FloatSliderView', FloatSliderView);
+
+
+var FloatTextView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.$textbox = $('')
+ .addClass('input')
+ .appendTo(this.$el);
+ this.update(); // Set defaults.
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ var value = this.model.get('value');
+ if (!this.changing && parseFloat(this.$textbox.val()) != value) {
+ this.$textbox.val(value);
+ }
+
+ if (this.model.get('disabled')) {
+ this.$textbox.attr('disabled','disabled');
+ } else {
+ this.$textbox.removeAttr('disabled');
+ }
+ },
+
+
+ events: {"keyup input" : "handleChanging",
+ "paste input" : "handleChanging",
+ "cut input" : "handleChanging",
+ "change input" : "handleChanged"}, // Fires only when control is validated or looses focus.
+
+ // Handles and validates user input.
+ handleChanging: function(e) {
+
+ // Try to parse value as a float.
+ var numericalValue = 0.0;
+ if (e.target.value != '') {
+ numericalValue = parseFloat(e.target.value);
+ }
+
+ // If parse failed, reset value to value stored in model.
+ if (isNaN(numericalValue)) {
+ e.target.value = this.model.get('value');
+ } else if (!isNaN(numericalValue)) {
+ numericalValue = Math.min(this.model.get('max'), numericalValue);
+ numericalValue = Math.max(this.model.get('min'), numericalValue);
+
+ // Apply the value if it has changed.
+ if (numericalValue != this.model.get('value')) {
+ this.changing = true;
+ this.model.set('value', numericalValue);
+ this.model.apply(this);
+ this.changing = false;
+ }
+ }
+ },
+
+ // Applies validated input.
+ handleChanged: function(e) {
+ // Update the textbox
+ if (this.model.get('value') != e.target.value) {
+ e.target.value = this.model.get('value');
+ }
+ }
+});
+
+IPython.notebook.widget_manager.register_widget_view('FloatTextView', FloatTextView);
diff --git a/IPython/html/static/notebook/js/widgets/model_int_range.js b/IPython/html/static/notebook/js/widgets/model_int_range.js
index e927052..996aeec 100644
--- a/IPython/html/static/notebook/js/widgets/model_int_range.js
+++ b/IPython/html/static/notebook/js/widgets/model_int_range.js
@@ -1,2 +1,117 @@
var IntRangeWidgetModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('IntRangeWidgetModel', IntRangeWidgetModel);
+
+var IntSliderView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el.html('');
+ this.$slider = $('')
+ .slider({})
+ .addClass('slider');
+
+ // Put the slider in a container
+ this.$slider_container = $('')
+ .css('padding-top', '4px')
+ .css('padding-bottom', '4px')
+ .addClass(this.model.comm.comm_id)
+ .append(this.$slider);
+ this.$el.append(this.$slider_container);
+
+ // Set defaults.
+ this.update();
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ // Slider related keys.
+ var _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation'];
+ for (var index in _keys) {
+ var key = _keys[index];
+ if (this.model.get(key) != undefined) {
+ this.$slider.slider("option", key, this.model.get(key));
+ }
+ }
+ },
+
+ // Handles: User input
+ events: { "slide" : "handleSliderChange" },
+ handleSliderChange: function(e, ui) {
+ this.model.set('value', ~~ui.value); // Double bit-wise not to truncate decimel
+ this.model.apply(this);
+ },
+});
+
+IPython.notebook.widget_manager.register_widget_view('IntSliderView', IntSliderView);
+
+var IntTextView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.$textbox = $('')
+ .addClass('input')
+ .appendTo(this.$el);
+ this.update(); // Set defaults.
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ var value = this.model.get('value');
+ if (!this.changing && parseInt(this.$textbox.val()) != value) {
+ this.$textbox.val(value);
+ }
+
+ if (this.model.get('disabled')) {
+ this.$textbox.attr('disabled','disabled');
+ } else {
+ this.$textbox.removeAttr('disabled');
+ }
+ },
+
+
+ events: {"keyup input" : "handleChanging",
+ "paste input" : "handleChanging",
+ "cut input" : "handleChanging",
+ "change input" : "handleChanged"}, // Fires only when control is validated or looses focus.
+
+ // Handles and validates user input.
+ handleChanging: function(e) {
+
+ // Try to parse value as a float.
+ var numericalValue = 0;
+ if (e.target.value != '') {
+ numericalValue = parseInt(e.target.value);
+ }
+
+ // If parse failed, reset value to value stored in model.
+ if (isNaN(numericalValue)) {
+ e.target.value = this.model.get('value');
+ } else if (!isNaN(numericalValue)) {
+ numericalValue = Math.min(this.model.get('max'), numericalValue);
+ numericalValue = Math.max(this.model.get('min'), numericalValue);
+
+ // Apply the value if it has changed.
+ if (numericalValue != this.model.get('value')) {
+ this.changing = true;
+ this.model.set('value', numericalValue);
+ this.model.apply(this);
+ this.changing = false;
+ }
+ }
+ },
+
+ // Applies validated input.
+ handleChanged: function(e) {
+ // Update the textbox
+ if (this.model.get('value') != e.target.value) {
+ e.target.value = this.model.get('value');
+ }
+ }
+});
+
+IPython.notebook.widget_manager.register_widget_view('IntTextView', IntTextView);
diff --git a/IPython/html/static/notebook/js/widgets/model_selection.js b/IPython/html/static/notebook/js/widgets/model_selection.js
index 7741f82..e4eedb5 100644
--- a/IPython/html/static/notebook/js/widgets/model_selection.js
+++ b/IPython/html/static/notebook/js/widgets/model_selection.js
@@ -1,2 +1,128 @@
var SelectionWidgetModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);
+
+var DropdownView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.$buttongroup = $('')
+ .addClass('btn-group')
+ .appendTo(this.$el);
+ this.$droplabel = $('')
+ .addClass('btn')
+ .appendTo(this.$buttongroup);
+ this.$dropbutton = $('')
+ .addClass('btn')
+ .addClass('dropdown-toggle')
+ .attr('data-toggle', 'dropdown')
+ .html('')
+ .appendTo(this.$buttongroup);
+ this.$droplist = $('')
+ .addClass('dropdown-menu')
+ .appendTo(this.$buttongroup);
+
+ // Set defaults.
+ this.update();
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ this.$droplabel.html(this.model.get('value'));
+
+ var items = this.model.get('values');
+ this.$droplist.html('');
+ for (var index in items) {
+ var that = this;
+ var item_button = $('')
+ .html(items[index])
+ .on('click', function(e){
+ that.model.set('value', $(e.target).html(), this );
+ })
+
+ this.$droplist.append($('').append(item_button))
+ }
+
+ if (this.model.get('disabled')) {
+ this.$buttongroup.attr('disabled','disabled');
+ this.$droplabel.attr('disabled','disabled');
+ this.$dropbutton.attr('disabled','disabled');
+ this.$droplist.attr('disabled','disabled');
+ } else {
+ this.$buttongroup.removeAttr('disabled');
+ this.$droplabel.removeAttr('disabled');
+ this.$dropbutton.removeAttr('disabled');
+ this.$droplist.removeAttr('disabled');
+ }
+ },
+
+});
+
+IPython.notebook.widget_manager.register_widget_view('DropdownView', DropdownView);
+var RadioButtonView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.update();
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+
+ // Add missing items to the DOM.
+ var items = this.model.get('values');
+ for (var index in items) {
+ var item_query = ' :input[value="' + items[index] + '"]';
+ if (this.$el.find(item_query).length == 0) {
+ var $label = $('')
+ .addClass('radio')
+ .html(items[index])
+ .appendTo(this.$el);
+
+ var that = this;
+ $('')
+ .attr('type', 'radio')
+ .addClass(this.model)
+ .val(items[index])
+ .prependTo($label)
+ .on('click', function(e){
+ that.model.set('value', $(e.target).val(), this);
+ that.model.apply();
+ });
+ }
+
+ if (this.model.get('value') == items[index]) {
+ this.$el.find(item_query).prop('checked', true);
+ } else {
+ this.$el.find(item_query).prop('checked', false);
+ }
+ }
+
+ // Remove items that no longer exist.
+ this.$el.find('input').each(function(i, obj) {
+ var value = $(obj).val();
+ var found = false;
+ for (var index in items) {
+ if (items[index] == value) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ $(obj).parent().remove();
+ }
+ });
+ },
+
+});
+
+IPython.notebook.widget_manager.register_widget_view('RadioButtonView', RadioButtonView);
diff --git a/IPython/html/static/notebook/js/widgets/model_string.js b/IPython/html/static/notebook/js/widgets/model_string.js
index 84e099e..cc7c930 100644
--- a/IPython/html/static/notebook/js/widgets/model_string.js
+++ b/IPython/html/static/notebook/js/widgets/model_string.js
@@ -1,2 +1,74 @@
var StringWidgetModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel);
+
+var TextareaView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.$textbox = $('')
+ .attr('rows', 5)
+ .appendTo(this.$el);
+ this.update(); // Set defaults.
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ if (!this.user_invoked_update) {
+ this.$textbox.val(this.model.get('value'));
+ }
+ },
+
+ events: {"keyup textarea" : "handleChanging",
+ "paste textarea" : "handleChanging",
+ "cut textarea" : "handleChanging"},
+
+ // Handles and validates user input.
+ handleChanging: function(e) {
+ this.user_invoked_update = true;
+ this.model.set('value', e.target.value);
+ this.model.apply(this);
+ this.user_invoked_update = false;
+ },
+});
+
+IPython.notebook.widget_manager.register_widget_view('TextareaView', TextareaView);
+
+var TextboxView = IPython.WidgetView.extend({
+
+ // Called when view is rendered.
+ render : function(){
+ this.$el
+ .html('')
+ .addClass(this.model.comm.comm_id);
+ this.$textbox = $('')
+ .addClass('input')
+ .appendTo(this.$el);
+ this.update(); // Set defaults.
+ },
+
+ // Handles: Backend -> Frontend Sync
+ // Frontent -> Frontend Sync
+ update : function(){
+ if (!this.user_invoked_update) {
+ this.$textbox.val(this.model.get('value'));
+ }
+ },
+
+ events: {"keyup input" : "handleChanging",
+ "paste input" : "handleChanging",
+ "cut input" : "handleChanging"},
+
+ // Handles and validates user input.
+ handleChanging: function(e) {
+ this.user_invoked_update = true;
+ this.model.set('value', e.target.value);
+ this.model.apply(this);
+ this.user_invoked_update = false;
+ },
+});
+
+IPython.notebook.widget_manager.register_widget_view('TextboxView', TextboxView);
diff --git a/IPython/html/static/notebook/js/widgets/view_container.js b/IPython/html/static/notebook/js/widgets/view_container.js
deleted file mode 100644
index 331cf1d..0000000
--- a/IPython/html/static/notebook/js/widgets/view_container.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var ContainerView = IPython.WidgetView.extend({
-
- render : function(){
- this.$el.html('');
- this.$container = $('')
- .addClass('container')
- .addClass(this.model.comm.comm_id);
- this.$el.append(this.$container);
- },
-
- update : function(){},
-});
-
-IPython.notebook.widget_manager.register_widget_view('ContainerView', ContainerView);
diff --git a/IPython/html/static/notebook/js/widgets/view_float_range_slider.js b/IPython/html/static/notebook/js/widgets/view_float_range_slider.js
deleted file mode 100644
index 217cc7e..0000000
--- a/IPython/html/static/notebook/js/widgets/view_float_range_slider.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var FloatSliderView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.$slider = $('')
- .slider({})
- .addClass('slider');
-
- // Put the slider in a container
- this.$slider_container = $('')
- .css('padding-top', '4px')
- .css('padding-bottom', '4px')
- .append(this.$slider);
- this.$el.append(this.$slider_container);
-
- // Set defaults.
- this.update();
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- // Slider related keys.
- var _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation'];
- for (var index in _keys) {
- var key = _keys[index];
- if (this.model.get(key) != undefined) {
- this.$slider.slider("option", key, this.model.get(key));
- }
- }
- },
-
- // Handles: User input
- events: { "slide" : "handleSliderChange" },
- handleSliderChange: function(e, ui) {
- this.model.set('value', ui.value);
- this.model.apply(this);
- },
-});
-
-IPython.notebook.widget_manager.register_widget_view('FloatSliderView', FloatSliderView);
diff --git a/IPython/html/static/notebook/js/widgets/view_float_range_text.js b/IPython/html/static/notebook/js/widgets/view_float_range_text.js
deleted file mode 100644
index d2f5a6a..0000000
--- a/IPython/html/static/notebook/js/widgets/view_float_range_text.js
+++ /dev/null
@@ -1,71 +0,0 @@
-
-var FloatTextView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.$textbox = $('')
- .addClass('input')
- .appendTo(this.$el);
- this.update(); // Set defaults.
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- var value = this.model.get('value');
- if (!this.changing && parseFloat(this.$textbox.val()) != value) {
- this.$textbox.val(value);
- }
-
- if (this.model.get('disabled')) {
- this.$textbox.attr('disabled','disabled');
- } else {
- this.$textbox.removeAttr('disabled');
- }
- },
-
-
- events: {"keyup input" : "handleChanging",
- "paste input" : "handleChanging",
- "cut input" : "handleChanging",
- "change input" : "handleChanged"}, // Fires only when control is validated or looses focus.
-
- // Handles and validates user input.
- handleChanging: function(e) {
-
- // Try to parse value as a float.
- var numericalValue = 0.0;
- if (e.target.value != '') {
- numericalValue = parseFloat(e.target.value);
- }
-
- // If parse failed, reset value to value stored in model.
- if (isNaN(numericalValue)) {
- e.target.value = this.model.get('value');
- } else if (!isNaN(numericalValue)) {
- numericalValue = Math.min(this.model.get('max'), numericalValue);
- numericalValue = Math.max(this.model.get('min'), numericalValue);
-
- // Apply the value if it has changed.
- if (numericalValue != this.model.get('value')) {
- this.changing = true;
- this.model.set('value', numericalValue);
- this.model.apply(this);
- this.changing = false;
- }
- }
- },
-
- // Applies validated input.
- handleChanged: function(e) {
- // Update the textbox
- if (this.model.get('value') != e.target.value) {
- e.target.value = this.model.get('value');
- }
- }
-});
-
-IPython.notebook.widget_manager.register_widget_view('FloatTextView', FloatTextView);
diff --git a/IPython/html/static/notebook/js/widgets/view_int_range_slider.js b/IPython/html/static/notebook/js/widgets/view_int_range_slider.js
deleted file mode 100644
index 17bb0d1..0000000
--- a/IPython/html/static/notebook/js/widgets/view_int_range_slider.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var IntSliderView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el.html('');
- this.$slider = $('')
- .slider({})
- .addClass('slider');
-
- // Put the slider in a container
- this.$slider_container = $('')
- .css('padding-top', '4px')
- .css('padding-bottom', '4px')
- .addClass(this.model.comm.comm_id)
- .append(this.$slider);
- this.$el.append(this.$slider_container);
-
- // Set defaults.
- this.update();
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- // Slider related keys.
- var _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation'];
- for (var index in _keys) {
- var key = _keys[index];
- if (this.model.get(key) != undefined) {
- this.$slider.slider("option", key, this.model.get(key));
- }
- }
- },
-
- // Handles: User input
- events: { "slide" : "handleSliderChange" },
- handleSliderChange: function(e, ui) {
- this.model.set('value', ~~ui.value); // Double bit-wise not to truncate decimel
- this.model.apply(this);
- },
-});
-
-IPython.notebook.widget_manager.register_widget_view('IntSliderView', IntSliderView);
diff --git a/IPython/html/static/notebook/js/widgets/view_int_range_text.js b/IPython/html/static/notebook/js/widgets/view_int_range_text.js
deleted file mode 100644
index eb35e13..0000000
--- a/IPython/html/static/notebook/js/widgets/view_int_range_text.js
+++ /dev/null
@@ -1,70 +0,0 @@
-var IntTextView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.$textbox = $('')
- .addClass('input')
- .appendTo(this.$el);
- this.update(); // Set defaults.
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- var value = this.model.get('value');
- if (!this.changing && parseInt(this.$textbox.val()) != value) {
- this.$textbox.val(value);
- }
-
- if (this.model.get('disabled')) {
- this.$textbox.attr('disabled','disabled');
- } else {
- this.$textbox.removeAttr('disabled');
- }
- },
-
-
- events: {"keyup input" : "handleChanging",
- "paste input" : "handleChanging",
- "cut input" : "handleChanging",
- "change input" : "handleChanged"}, // Fires only when control is validated or looses focus.
-
- // Handles and validates user input.
- handleChanging: function(e) {
-
- // Try to parse value as a float.
- var numericalValue = 0;
- if (e.target.value != '') {
- numericalValue = parseInt(e.target.value);
- }
-
- // If parse failed, reset value to value stored in model.
- if (isNaN(numericalValue)) {
- e.target.value = this.model.get('value');
- } else if (!isNaN(numericalValue)) {
- numericalValue = Math.min(this.model.get('max'), numericalValue);
- numericalValue = Math.max(this.model.get('min'), numericalValue);
-
- // Apply the value if it has changed.
- if (numericalValue != this.model.get('value')) {
- this.changing = true;
- this.model.set('value', numericalValue);
- this.model.apply(this);
- this.changing = false;
- }
- }
- },
-
- // Applies validated input.
- handleChanged: function(e) {
- // Update the textbox
- if (this.model.get('value') != e.target.value) {
- e.target.value = this.model.get('value');
- }
- }
-});
-
-IPython.notebook.widget_manager.register_widget_view('IntTextView', IntTextView);
diff --git a/IPython/html/static/notebook/js/widgets/view_selection_dropdown.js b/IPython/html/static/notebook/js/widgets/view_selection_dropdown.js
deleted file mode 100644
index 45c2ab7..0000000
--- a/IPython/html/static/notebook/js/widgets/view_selection_dropdown.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var DropdownView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
-
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.$buttongroup = $('')
- .addClass('btn-group')
- .appendTo(this.$el);
- this.$droplabel = $('')
- .addClass('btn')
- .appendTo(this.$buttongroup);
- this.$dropbutton = $('')
- .addClass('btn')
- .addClass('dropdown-toggle')
- .attr('data-toggle', 'dropdown')
- .html('')
- .appendTo(this.$buttongroup);
- this.$droplist = $('')
- .addClass('dropdown-menu')
- .appendTo(this.$buttongroup);
-
- // Set defaults.
- this.update();
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- this.$droplabel.html(this.model.get('value'));
-
- var items = this.model.get('values');
- this.$droplist.html('');
- for (var index in items) {
- var that = this;
- var item_button = $('')
- .html(items[index])
- .on('click', function(e){
- that.model.set('value', $(e.target).html(), this );
- })
-
- this.$droplist.append($('').append(item_button))
- }
-
- if (this.model.get('disabled')) {
- this.$buttongroup.attr('disabled','disabled');
- this.$droplabel.attr('disabled','disabled');
- this.$dropbutton.attr('disabled','disabled');
- this.$droplist.attr('disabled','disabled');
- } else {
- this.$buttongroup.removeAttr('disabled');
- this.$droplabel.removeAttr('disabled');
- this.$dropbutton.removeAttr('disabled');
- this.$droplist.removeAttr('disabled');
- }
- },
-
-});
-
-IPython.notebook.widget_manager.register_widget_view('DropdownView', DropdownView);
diff --git a/IPython/html/static/notebook/js/widgets/view_selection_radiobutton.js b/IPython/html/static/notebook/js/widgets/view_selection_radiobutton.js
deleted file mode 100644
index db473fa..0000000
--- a/IPython/html/static/notebook/js/widgets/view_selection_radiobutton.js
+++ /dev/null
@@ -1,63 +0,0 @@
-var RadioButtonView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.update();
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
-
- // Add missing items to the DOM.
- var items = this.model.get('values');
- for (var index in items) {
- var item_query = ' :input[value="' + items[index] + '"]';
- if (this.$el.find(item_query).length == 0) {
- var $label = $('')
- .addClass('radio')
- .html(items[index])
- .appendTo(this.$el);
-
- var that = this;
- $('')
- .attr('type', 'radio')
- .addClass(this.model)
- .val(items[index])
- .prependTo($label)
- .on('click', function(e){
- that.model.set('value', $(e.target).val(), this);
- that.model.apply();
- });
- }
-
- if (this.model.get('value') == items[index]) {
- this.$el.find(item_query).prop('checked', true);
- } else {
- this.$el.find(item_query).prop('checked', false);
- }
- }
-
- // Remove items that no longer exist.
- this.$el.find('input').each(function(i, obj) {
- var value = $(obj).val();
- var found = false;
- for (var index in items) {
- if (items[index] == value) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- $(obj).parent().remove();
- }
- });
- },
-
-});
-
-IPython.notebook.widget_manager.register_widget_view('RadioButtonView', RadioButtonView);
diff --git a/IPython/html/static/notebook/js/widgets/view_string_textarea.js b/IPython/html/static/notebook/js/widgets/view_string_textarea.js
deleted file mode 100644
index 29ab80d..0000000
--- a/IPython/html/static/notebook/js/widgets/view_string_textarea.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var TextareaView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.$textbox = $('')
- .attr('rows', 5)
- .appendTo(this.$el);
- this.update(); // Set defaults.
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- if (!this.user_invoked_update) {
- this.$textbox.val(this.model.get('value'));
- }
- },
-
- events: {"keyup textarea" : "handleChanging",
- "paste textarea" : "handleChanging",
- "cut textarea" : "handleChanging"},
-
- // Handles and validates user input.
- handleChanging: function(e) {
- this.user_invoked_update = true;
- this.model.set('value', e.target.value);
- this.model.apply(this);
- this.user_invoked_update = false;
- },
-});
-
-IPython.notebook.widget_manager.register_widget_view('TextareaView', TextareaView);
diff --git a/IPython/html/static/notebook/js/widgets/view_string_textbox.js b/IPython/html/static/notebook/js/widgets/view_string_textbox.js
deleted file mode 100644
index 0c770fd..0000000
--- a/IPython/html/static/notebook/js/widgets/view_string_textbox.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var TextboxView = IPython.WidgetView.extend({
-
- // Called when view is rendered.
- render : function(){
- this.$el
- .html('')
- .addClass(this.model.comm.comm_id);
- this.$textbox = $('')
- .addClass('input')
- .appendTo(this.$el);
- this.update(); // Set defaults.
- },
-
- // Handles: Backend -> Frontend Sync
- // Frontent -> Frontend Sync
- update : function(){
- if (!this.user_invoked_update) {
- this.$textbox.val(this.model.get('value'));
- }
- },
-
- events: {"keyup input" : "handleChanging",
- "paste input" : "handleChanging",
- "cut input" : "handleChanging"},
-
- // Handles and validates user input.
- handleChanging: function(e) {
- this.user_invoked_update = true;
- this.model.set('value', e.target.value);
- this.model.apply(this);
- this.user_invoked_update = false;
- },
-});
-
-IPython.notebook.widget_manager.register_widget_view('TextboxView', TextboxView);