From 71e81687700579eb94a86840e4c22aa640e1d20c 2011-07-21 03:42:35 From: Brian E. Granger Date: 2011-07-21 03:42:35 Subject: [PATCH] Controls in cell section have a solid layout. --- diff --git a/IPython/frontend/html/notebook/static/css/notebook.css b/IPython/frontend/html/notebook/static/css/notebook.css index fed7832..cebc68e 100644 --- a/IPython/frontend/html/notebook/static/css/notebook.css +++ b/IPython/frontend/html/notebook/static/css/notebook.css @@ -123,14 +123,42 @@ div.section_content { padding: 5px; } +#expand_cell, #collapse_cell, #insert_cell_above, #insert_cell_below, +#move_cell_up, #move_cell_down, #to_code, #to_text, #run_selected_cell, +#run_all_cells { + width: 65px; +} + +.cell_section_row { + margin: 5px 0px; +} + +.cell_section_row_buttons { + float: right; +} + +.cell_section_row_header { + float: left; + font-size: 0.8em; + padding: 0.2em 0em; + font-weight: bold; +} span.button_label { - padding: 0.3em 1em; + padding: 0.2em 1em; font-size: 0.8em; + float: right; } +/* This is needed because FF was adding a 2px margin top and bottom. */ +.cell_section_row .ui-button { + margin-top: 0px; + margin-bottom: 0px; +} + + .ui-button .ui-button-text { - padding: 0.3em 0.9em; + padding: 0.2em 0.8em; font-size: 0.7em; } diff --git a/IPython/frontend/html/notebook/static/js/notebook_main.js b/IPython/frontend/html/notebook/static/js/notebook_main.js index a23fd51..66dc899 100644 --- a/IPython/frontend/html/notebook/static/js/notebook_main.js +++ b/IPython/frontend/html/notebook/static/js/notebook_main.js @@ -53,16 +53,6 @@ $(document).ready(function () { // $("#delete_cell").button("option", "text", false); // $("#delete_cell").click(function () {IPython.notebook.delete_cell();}); -// $("#cell_type").buttonset(); -// $("#to_code").click(function () {IPython.notebook.text_to_code();}); -// $("#to_text").click(function () {IPython.notebook.code_to_text();}); - -// $("#sort").buttonset(); -// $("#sort_cells").click(function () {IPython.notebook.sort_cells();}); - -// $("#toggle").buttonset(); -// $("#collapse").click(function () {IPython.notebook.collapse();}); -// $("#expand").click(function () {IPython.notebook.expand();}); }); diff --git a/IPython/frontend/html/notebook/static/js/panelsection.js b/IPython/frontend/html/notebook/static/js/panelsection.js index 5450cbd..50cc6dd 100644 --- a/IPython/frontend/html/notebook/static/js/panelsection.js +++ b/IPython/frontend/html/notebook/static/js/panelsection.js @@ -131,65 +131,66 @@ var IPython = (function (IPython) { this.content.find('#to_text').click(function () { IPython.notebook.code_to_text(); }); + this.content.find('#run_selected_cell').click(function () { + alert("Not Implemented"); + }); + this.content.find('#run_all_cells').click(function () { + alert("Not Implemented"); + }); }; CellSection.prototype.create_children = function () { - var row0 = $('
'). - append($('').attr('id','toggle'). - append( $('').attr('id','collapse_cell') ). - append( $('').attr('id','expand_cell') ) ). - append($(''). - append($('').attr('id','delete_cell'))); - row0.find('#toggle').buttonset(); - row0.find('button#delete_cell').button(); - this.content.append(row0); - var row1 = $('
'). - append($('').html('Insert').addClass('button_label')). - append($('').attr('id','insert'). + this.content.addClass('ui-helper-clearfix'); + + var row1 = $('
').addClass('cell_section_row ui-helper-clearfix'). + append($('').addClass('cell_section_row_buttons'). + append($('').attr('id','delete_cell'))). + append($('').html('Actions').addClass('cell_section_row_header')); + row1.find('#delete_cell').button(); + this.content.append(row1); + + var row1 = $('
').addClass('cell_section_row ui-helper-clearfix'). + append($('').attr('id','insert').addClass('cell_section_row_buttons'). append( $('').attr('id','insert_cell_above') ). - append( $('').attr('id','insert_cell_below') ) ); + append( $('').attr('id','insert_cell_below') )). + append($('').html('Insert').addClass('button_label')); row1.find('#insert').buttonset(); this.content.append(row1); - var row2 = $('
'). - append($('').html('Move').addClass('button_label')). - append($('').attr('id','move'). + var row2 = $('
').addClass('cell_section_row ui-helper-clearfix'). + append($('').attr('id','move').addClass('cell_section_row_buttons'). append( $('').attr('id','move_cell_up') ). - append( $('').attr('id','move_cell_down') ) ); + append( $('').attr('id','move_cell_down') ) ). + append($('').html('Move').addClass('button_label')); row2.find('#move').buttonset(); this.content.append(row2); - var row3 = $('
'). - append($('').html('Cell Type').addClass('button_label')). - append($('').attr('id','cell_type'). + var row3 = $('
').addClass('cell_section_row ui-helper-clearfix'). + append($('').attr('id','cell_type').addClass('cell_section_row_buttons'). append( $('').attr('id','to_code') ). - append( $('').attr('id','to_text') ) ); + append( $('').attr('id','to_text') ) ). + append($('').html('Cell Type').addClass('button_label')); row3.find('#cell_type').buttonset(); - this.content.append(row3) + this.content.append(row3); + + var row0 = $('
').addClass('cell_section_row ui-helper-clearfix'). + append($('').attr('id','toggle_output').addClass('cell_section_row_buttons'). + append( $('').attr('id','collapse_cell') ). + append( $('').attr('id','expand_cell') ) ). + append($('').html('Output').addClass('button_label')); + row0.find('#toggle_output').buttonset(); + this.content.append(row0); + + var row0 = $('
').addClass('cell_section_row'). + append($('').attr('id','run_cells').addClass('cell_section_row_buttons'). + append( $('').attr('id','run_selected_cell') ). + append( $('').attr('id','run_all_cells') ) ). + append($('').html('Run').addClass('button_label')); + row0.find('#run_cells').buttonset(); + this.content.append(row0); }; -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// // KernelSection diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index 987a2c6..706b326 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -16,7 +16,7 @@ var IPython = (function (IPython) { TextCell.prototype.create_element = function () { - var cell = $("
").addClass('cell text_cell'). + var cell = $("
").addClass('cell text_cell border-box-sizing'). append( $(""). addClass('text_cell_input monospace-font').