diff --git a/IPython/frontend/html/notebook/static/css/metaui.css b/IPython/frontend/html/notebook/static/css/metaui.css index 1e1e6c0..c442689 100644 --- a/IPython/frontend/html/notebook/static/css/metaui.css +++ b/IPython/frontend/html/notebook/static/css/metaui.css @@ -1,6 +1,6 @@ /*Css for the metadata edit area*/ -.metaedit{ +.celltoolbar{ border:thin solid #DDD; margin-left:81px; border-bottom:none; @@ -10,24 +10,24 @@ display:none; } -.code_cell .metaedit{ +.code_cell .celltoolbar{ margin-left:81px; } -.text_cell .metaedit{ +.text_cell .celltoolbar{ margin-left:0px; } -.editmetaon div.input_area , .editmetaon div.text_cell_input{ +.celltoolbar-on div.input_area , .celltoolbar-on div.text_cell_input{ border-top-right-radius: 0px; border-top-left-radius: 0px; } -.editmetaon .metaedit { +.celltoolbar-on .celltoolbar { display:block; } -.metaedit ui-button { +.celltoolbar ui-button { border :none; } @@ -41,13 +41,13 @@ border : none; } -.metaedit select { +.celltoolbar select { margin:10px; margin-top:0px; margin-bottom:0px; } -.metaedit input[type=checkbox] { +.celltoolbar input[type=checkbox] { margin-bottom:1px; } diff --git a/IPython/frontend/html/notebook/static/js/cell.js b/IPython/frontend/html/notebook/static/js/cell.js index 1092b5b..0006a91 100644 --- a/IPython/frontend/html/notebook/static/js/cell.js +++ b/IPython/frontend/html/notebook/static/js/cell.js @@ -163,7 +163,7 @@ var IPython = (function (IPython) { if (data.metadata !== undefined) { this.metadata = data.metadata; } - this.metaui.rebuild(); + this.celltoolbar.rebuild(); }; diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 450da1c..0c57d3d 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -58,10 +58,10 @@ var IPython = (function (IPython) { /** @method create_element */ CodeCell.prototype.create_element = function () { - this.metaui = new IPython.MetaUI(this); + this.celltoolbar = new IPython.CellToolbar(this); var cell = $('
').addClass('cell border-box-sizing code_cell vbox'); - cell.append(this.metaui.$element); + cell.append(this.celltoolbar.element); cell.attr('tabindex','2'); var input = $('').addClass('input hbox'); input.append($('').addClass('prompt input_prompt')); diff --git a/IPython/frontend/html/notebook/static/js/custom.js b/IPython/frontend/html/notebook/static/js/custom.js index d1f01b6..c565753 100644 --- a/IPython/frontend/html/notebook/static/js/custom.js +++ b/IPython/frontend/html/notebook/static/js/custom.js @@ -34,10 +34,10 @@ * to load custom script into the notebook. * * // to load the metadata ui extension example. - * $.getScript('/static/js/examples/metaui.example.js'); + * $.getScript('/static/js/examples/celltoolbar.example.js'); * // or * // to load the metadata ui extension to control slideshow mode / reveal js for nbconvert - * $.getScript('/static/js/examples/metaui.slideshow.js'); + * $.getScript('/static/js/examples/celltoolbar.slideshow.js'); * * * @module IPython diff --git a/IPython/frontend/html/notebook/static/js/examples/metaui.example.js b/IPython/frontend/html/notebook/static/js/examples/celltoolbar.example.js similarity index 92% rename from IPython/frontend/html/notebook/static/js/examples/metaui.example.js rename to IPython/frontend/html/notebook/static/js/examples/celltoolbar.example.js index 414d05a..e190a62 100644 --- a/IPython/frontend/html/notebook/static/js/examples/metaui.example.js +++ b/IPython/frontend/html/notebook/static/js/examples/celltoolbar.example.js @@ -6,23 +6,23 @@ //---------------------------------------------------------------------------- //============================================================================ -// MetaUI Example +// CellToolbar Example //============================================================================ /** - * Example Use for the MetaUI library + * Example Use for the CellToolbar library * add the following to your custom.js to load - * metadata UI for slideshow + * Celltoolbar UI for slideshow * * ``` - * $.getScript('/static/js/examples/metaui.example.js'); + * $.getScript('/static/js/examples/celltoolbar.example.js'); * ``` */ // IIFE without asignement, we don't modifiy the IPython namespace (function (IPython) { "use strict"; - var MetaUI = IPython.MetaUI; + var CellToolbar = IPython.CellToolbar; var raw_edit = function(cell){ @@ -89,7 +89,7 @@ button_container.append(button); } - MetaUI.register_callback('example.rawedit',add_raw_edit_button); + CellToolbar.register_callback('example.rawedit',add_raw_edit_button); var example_preset = [] example_preset.push('example.rawedit'); @@ -121,7 +121,7 @@ button_container.append(button); } - MetaUI.register_callback('example.lock',simple_button); + CellToolbar.register_callback('example.lock',simple_button); example_preset.push('example.lock'); var toggle_test = function(div, cell) { @@ -135,7 +135,7 @@ button_container.append(button); } - MetaUI.register_callback('example.toggle',toggle_test); + CellToolbar.register_callback('example.toggle',toggle_test); example_preset.push('example.toggle'); var checkbox_test = function(div, cell) { @@ -154,7 +154,7 @@ } - MetaUI.register_callback('example.checkbox',checkbox_test); + CellToolbar.register_callback('example.checkbox',checkbox_test); example_preset.push('example.checkbox'); var select_test = function(div, cell) { @@ -174,11 +174,11 @@ } - MetaUI.register_callback('example.select',select_test); + CellToolbar.register_callback('example.select',select_test); example_preset.push('example.select'); - MetaUI.register_preset('example',example_preset); - MetaUI.set_preset('example'); + CellToolbar.register_preset('example',example_preset); + CellToolbar.set_preset('example'); console.log('Example extension for metadata editting loaded.'); }(IPython)); diff --git a/IPython/frontend/html/notebook/static/js/maintoolbar.js b/IPython/frontend/html/notebook/static/js/maintoolbar.js index a73e12d..a58c1e4 100644 --- a/IPython/frontend/html/notebook/static/js/maintoolbar.js +++ b/IPython/frontend/html/notebook/static/js/maintoolbar.js @@ -18,8 +18,8 @@ var IPython = (function (IPython) { this.add_drop_down_list(); this.bind_events(); $(this.selector) - .append($('').text('MetaUI')) - .append(IPython.MetaUI.$dropdown_preset_selector) + .append($('').text('CellToolbar')) + .append(IPython.CellToolbar.dropdown_preset_element) }; MainToolBar.prototype = new IPython.ToolBar(); diff --git a/IPython/frontend/html/notebook/static/js/metaui.js b/IPython/frontend/html/notebook/static/js/metaui.js index 3c171f1..970e924 100644 --- a/IPython/frontend/html/notebook/static/js/metaui.js +++ b/IPython/frontend/html/notebook/static/js/metaui.js @@ -6,7 +6,7 @@ //---------------------------------------------------------------------------- //============================================================================ -// MetaUI +// CellToolbar //============================================================================ @@ -14,7 +14,7 @@ * A Module to control the per-cell toolbar. * @module IPython * @namespace IPython - * @submodule MetaUI + * @submodule CellToolbar */ var IPython = (function (IPython) { "use strict"; @@ -22,30 +22,30 @@ var IPython = (function (IPython) { /** * @constructor - * @class MetaUI + * @class CellToolbar * @param {The cell to attach the metadata UI to} cell */ - var MetaUI = function (cell) { - MetaUI._instances.push(this); - this.$metainner = $(''); + var CellToolbar = function (cell) { + CellToolbar._instances.push(this); + this.inner_element = $(''); this.cell = cell; - this.$element = $('').addClass('metaedit') - .append(this.$metainner) + this.element = $('').addClass('celltoolbar') + .append(this.inner_element) this.rebuild(); return this; }; - MetaUI.$dropdown_preset_selector = $('') - .attr('id','metaui_selector') + CellToolbar.dropdown_preset_element = $('') + .attr('id','celltoolbar_selector') .append($('').attr('value','').text('-')) - MetaUI.$dropdown_preset_selector.change(function(){ - var val = MetaUI.$dropdown_preset_selector.val() + CellToolbar.dropdown_preset_element.change(function(){ + var val = CellToolbar.dropdown_preset_element.val() if(val ==''){ - $('body').removeClass('editmetaon') + $('body').removeClass('celltoolbar-on') } else { - $('body').addClass('editmetaon') - MetaUI.set_preset(val) + $('body').addClass('celltoolbar-on') + CellToolbar.set_preset(val) } }) @@ -57,7 +57,7 @@ var IPython = (function (IPython) { * @property _callback_dict * @private */ - MetaUI._callback_dict = {}; + CellToolbar._callback_dict = {}; /** * Class variable that should contain the reverse order list of the button @@ -65,25 +65,25 @@ var IPython = (function (IPython) { * @property _button_list * @private */ - MetaUI._button_list = []; + CellToolbar._button_list = []; /** * keep a list of all instances to * be able to llop over them... * but how to 'destroy' them ? * have to think about it... - * or loop over the cells, and find their MetaUI instances. + * or loop over the cells, and find their CellToolbar instances. * @private * @property _instances */ - MetaUI._instances =[] + CellToolbar._instances =[] /** * keep a list of all the availlabel presets for the toolbar * @private * @property _presets */ - MetaUI._presets ={} + CellToolbar._presets ={} // this is by design not a prototype. /** @@ -125,11 +125,11 @@ var IPython = (function (IPython) { * * // now we register the callback under the name `foo` to give the * // user the ability to use it later - * MetaUI.register_callback('foo',toggle); + * CellToolbar.register_callback('foo',toggle); */ - MetaUI.register_callback = function(name, callback){ + CellToolbar.register_callback = function(name, callback){ // what do we do if name already exist ? - MetaUI._callback_dict[name] = callback; + CellToolbar._callback_dict[name] = callback; }; /** @@ -144,18 +144,18 @@ var IPython = (function (IPython) { * @private * @example * - * MetaUI.register_callback('foo.c1',function(div,cell){...}); - * MetaUI.register_callback('foo.c2',function(div,cell){...}); - * MetaUI.register_callback('foo.c3',function(div,cell){...}); - * MetaUI.register_callback('foo.c4',function(div,cell){...}); - * MetaUI.register_callback('foo.c5',function(div,cell){...}); + * CellToolbar.register_callback('foo.c1',function(div,cell){...}); + * CellToolbar.register_callback('foo.c2',function(div,cell){...}); + * CellToolbar.register_callback('foo.c3',function(div,cell){...}); + * CellToolbar.register_callback('foo.c4',function(div,cell){...}); + * CellToolbar.register_callback('foo.c5',function(div,cell){...}); * - * MetaUI.register_preset('foo.foo_preset1',['foo.c1','foo.c2','foo.c5']) - * MetaUI.register_preset('foo.foo_preset2',['foo.c4','foo.c5']) + * CellToolbar.register_preset('foo.foo_preset1',['foo.c1','foo.c2','foo.c5']) + * CellToolbar.register_preset('foo.foo_preset2',['foo.c4','foo.c5']) */ - MetaUI.register_preset = function(name, preset_list){ - MetaUI._presets[name] = preset_list - MetaUI.$dropdown_preset_selector.append( + CellToolbar.register_preset = function(name, preset_list){ + CellToolbar._presets[name] = preset_list + CellToolbar.dropdown_preset_element.append( $('').attr('value',name).text(name) ) } @@ -168,14 +168,14 @@ var IPython = (function (IPython) { * @private * @example * - * MetaUI.set_preset('foo.foo_preset1'); + * CellToolbar.set_preset('foo.foo_preset1'); */ - MetaUI.set_preset= function(preset_name){ - var preset = MetaUI._presets[preset_name]; + CellToolbar.set_preset= function(preset_name){ + var preset = CellToolbar._presets[preset_name]; if(preset != undefined){ - MetaUI._button_list = preset; - MetaUI.rebuild_all(); + CellToolbar._button_list = preset; + CellToolbar.rebuild_all(); } } @@ -188,9 +188,9 @@ var IPython = (function (IPython) { * @static * */ - MetaUI.rebuild_all = function(){ - for(var i in MetaUI._instances){ - MetaUI._instances[i].rebuild(); + CellToolbar.rebuild_all = function(){ + for(var i in CellToolbar._instances){ + CellToolbar._instances[i].rebuild(); } } @@ -198,22 +198,22 @@ var IPython = (function (IPython) { * Rebuild all the button on the toolbar to update it's state. * @method rebuild */ - MetaUI.prototype.rebuild = function(){ + CellToolbar.prototype.rebuild = function(){ // strip evrything from the div // which is probabli metainner. - // or this.$element. - this.$metainner.empty(); + // or this.element. + this.inner_element.empty(); //this.add_raw_edit_button() - var cdict = MetaUI._callback_dict; - var preset = MetaUI._button_list; + var cdict = CellToolbar._callback_dict; + var preset = CellToolbar._button_list; // Yes we iterate on the class varaible, not the instance one. - for ( var index in MetaUI._button_list){ + for ( var index in CellToolbar._button_list){ var local_div = $('').addClass('button_container'); // Note, // do this the other way, wrap in try/catch and don't append if any errors. - this.$metainner.append(local_div) + this.inner_element.append(local_div) cdict[preset[index]](local_div,this.cell) } @@ -284,7 +284,7 @@ var IPython = (function (IPython) { button_container.append(button); } - MetaUI.register_callback('example.rawedit',add_raw_edit_button); + CellToolbar.register_callback('example.rawedit',add_raw_edit_button); var example_preset = [] example_preset.push('example.rawedit'); @@ -315,11 +315,11 @@ var IPython = (function (IPython) { button_container.append(button); } - MetaUI.register_callback('default.help',add_simple_dialog_button) + CellToolbar.register_callback('default.help',add_simple_dialog_button) var default_preset = [] default_preset.push('default.help') - MetaUI.register_preset('default',default_preset) - MetaUI.set_preset('default') + CellToolbar.register_preset('default',default_preset) + CellToolbar.set_preset('default') var simple_button = function(div, cell) { var button_container = $(div); @@ -348,7 +348,7 @@ var IPython = (function (IPython) { button_container.append(button); } - MetaUI.register_callback('example.lock',simple_button); + CellToolbar.register_callback('example.lock',simple_button); example_preset.push('example.lock'); var toggle_test = function(div, cell) { @@ -362,12 +362,12 @@ var IPython = (function (IPython) { button_container.append(button); } - MetaUI.register_callback('example.toggle',toggle_test); + CellToolbar.register_callback('example.toggle',toggle_test); example_preset.push('example.toggle'); /** */ - MetaUI.utils = {}; + CellToolbar.utils = {}; /** * A utility function to generate bindings between a checkbox and metadata @@ -386,7 +386,7 @@ var IPython = (function (IPython) { * * An exmple that bind the subkey `slideshow.isSectionStart` to a checkbox with a `New Slide` label * - * var newSlide = MetaUI.utils.checkbox_ui_generator('New Slide', + * var newSlide = CellToolbar.utils.checkbox_ui_generator('New Slide', * // setter * function(metadata,value){ * // we check that the slideshow namespace exist and create it if needed @@ -403,10 +403,10 @@ var IPython = (function (IPython) { * } * ); * - * MetaUI.register_callback('newSlide', newSlide); + * CellToolbar.register_callback('newSlide', newSlide); * */ - MetaUI.utils.checkbox_ui_generator = function(name,setter,getter){ + CellToolbar.utils.checkbox_ui_generator = function(name,setter,getter){ return function(div, cell) { var button_container = $(div) @@ -443,7 +443,7 @@ var IPython = (function (IPython) { * * @example * - * var select_type = MetaUI.utils.select_ui_generator([ + * var select_type = CellToolbar.utils.select_ui_generator([ * ["-" ,undefined ], * ["Header Slide" ,"header_slide" ], * ["Slide" ,"slide" ], @@ -464,10 +464,10 @@ var IPython = (function (IPython) { * // return the value * return (ns == undefined)? undefined: ns.slide_type * } - * MetaUI.register_callback('slideshow.select',select_type); + * CellToolbar.register_callback('slideshow.select',select_type); * */ - MetaUI.utils.select_ui_generator = function(list_list,setter, getter, label){ + CellToolbar.utils.select_ui_generator = function(list_list,setter, getter, label){ label= label? label: ""; return function(div, cell) { var button_container = $(div) @@ -490,7 +490,7 @@ var IPython = (function (IPython) { }; - IPython.MetaUI = MetaUI; + IPython.CellToolbar = CellToolbar; return IPython; }(IPython)); diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index d84f892..b50188f 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -43,8 +43,8 @@ var IPython = (function (IPython) { */ TextCell.prototype.create_element = function () { var cell = $("