require(["notebook/js/widget"], function(){ var StringWidgetModel = IPython.WidgetModel.extend({}); IPython.notebook.widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel); var LabelView = IPython.WidgetView.extend({ // Called when view is rendered. render : function(){ this.$el = $('
'); this.update(); // Set defaults. }, // Handles: Backend -> Frontend Sync // Frontent -> Frontend Sync update : function(){ this.$el.html(this.model.get('value')); return IPython.WidgetView.prototype.update.call(this); }, }); IPython.notebook.widget_manager.register_widget_view('LabelView', LabelView); var TextAreaView = IPython.WidgetView.extend({ // Called when view is rendered. render : function(){ this.$el .addClass('widget-hbox') .html(''); this.$label = $('
') .appendTo(this.$el) .addClass('widget-hlabel') .hide(); this.$textbox = $('