diff --git a/IPython/html/static/notebook/js/celltoolbar.js b/IPython/html/static/notebook/js/celltoolbar.js index c98c4be..0cb6a76 100644 --- a/IPython/html/static/notebook/js/celltoolbar.js +++ b/IPython/html/static/notebook/js/celltoolbar.js @@ -350,6 +350,36 @@ define([ /** + * A utility function to generate bindings between a input field and cell/metadata + * @method utils.input_ui_generator + * @static + * + * @param name {string} Label in front of the input field + * @param setter {function( cell, newValue )} + * A setter method to set the newValue + * @param getter {function( cell )} + * A getter methods which return the current value. + * + * @return callback {function( div, cell )} Callback to be passed to `register_callback` + * + */ + CellToolbar.utils.input_ui_generator = function(name, setter, getter){ + return function(div, cell, celltoolbar) { + var button_container = $(div); + + var text = $('').attr('type', 'text'); + var lbl = $('