Skip to content

Commit

Permalink
Minors fixes and initial work on save widget.
Browse files Browse the repository at this point in the history
* Fixed width of buttons in left panel.
* Started to create a save widget for the header.
  • Loading branch information
ellisonbg committed Jul 21, 2011
1 parent 0376908 commit e4683b7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
15 changes: 11 additions & 4 deletions IPython/frontend/html/notebook/static/css/notebook.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ body {
}


span#ipython_notebook h1 {
font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
font-size: 22pt;
div#header {
height: 35px;
padding: 5px;
margin: 0px;
width: 100%
}

span#ipython_notebook {
}

span#ipython_notebook h1 {
font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
font-size: 22pt;
}

span#kernel_status {
Expand Down Expand Up @@ -125,7 +131,8 @@ div.section_content {

#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 {
#run_all_cells, #int_kernel, #restart_kernel, #python_help, #ipython_help,
#numpy_help, #matplotlib_help, #scipy_help, #sympy_help {
width: 65px;
}

Expand Down
1 change: 1 addition & 0 deletions IPython/frontend/html/notebook/static/js/notebook_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ $(document).ready(function () {
$('div#notebook_panel').addClass('border-box-sizing ui-widget');

IPython.layout_manager = new IPython.LayoutManager();
// IPython.save_widget = new IPython.SaveWidget('span#save_widget');
IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter');
IPython.notebook = new IPython.Notebook('div#notebook');
Expand Down
2 changes: 1 addition & 1 deletion IPython/frontend/html/notebook/static/js/panelsection.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ var IPython = (function (IPython) {
var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
append($('<span/>').attr('id','help_buttons1').addClass('cell_section_row_buttons').
append( $('<button/>').attr('id','matplotlib_help').
append( $('<a>Matplotlib</a>').attr('href','http://matplotlib.sourceforge.net/').attr('target','_blank') )).
append( $('<a>MPL</a>').attr('href','http://matplotlib.sourceforge.net/').attr('target','_blank') )).
append( $('<button/>').attr('id','scipy_help').
append( $('<a>SciPy</a>').attr('href','http://docs.scipy.org/doc/scipy/reference/').attr('target','_blank') )).
append( $('<button/>').attr('id','sympy_help').
Expand Down
37 changes: 37 additions & 0 deletions IPython/frontend/html/notebook/static/js/savewidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

//============================================================================
// Cell
//============================================================================

var IPython = (function (IPython) {

var utils = IPython.utils;

var SaveWidget = function (selector) {
this.element = $(selector);
this.create_element();
if (this.element !== undefined) {
this.element.data("cell", this);
this.bind_events();
}
};


SaveWidget.prototype.bind_events = function () {
var that = this;
};


// Subclasses must implement create_element.
SaveWidget.prototype.create_element = function () {
this.element.
append($('textarea')).
append($('<button>Save</button>').button());
};

IPython.SaveWidget = SaveWidget;

return IPython;

}(IPython));

4 changes: 3 additions & 1 deletion IPython/frontend/html/notebook/templates/notebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>IPython Notebook</title>

<link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" />
<!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> -->
<!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> -->
<!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />-->

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script>
Expand All @@ -31,6 +31,7 @@

<div id="header">
<span id="ipython_notebook"><h1>IPython Notebook</h1></span>
<span id="save_widget"></span>
</div>

<div id="notebook_app">
Expand All @@ -55,6 +56,7 @@
<script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script>
Expand Down

0 comments on commit e4683b7

Please sign in to comment.