Permalink
Browse files

Help section implemented and working.

  • Loading branch information...
1 parent 71e8168 commit 0376908da90e99a4c54fdf32bba773fa731c9b10 @ellisonbg ellisonbg committed Jul 20, 2011
@@ -63,6 +63,9 @@ var IPython = (function (IPython) {
this.left_panel_element.append(this.cell_section.element);
this.kernel_section = new IPython.KernelSection();
this.left_panel_element.append(this.kernel_section.element);
+ this.help_section = new IPython.HelpSection();
+ this.left_panel_element.append(this.help_section.element);
+ this.help_section.collapse();
}
LeftPanel.prototype.collapse = function () {
@@ -28,31 +28,5 @@ $(document).ready(function () {
IPython.notebook.insert_code_cell_after();
IPython.layout_manager.do_resize();
IPython.pager.collapse();
-
-// $("#menu_tabs").tabs();
-
-// $("#help_toolbar").buttonset();
-
-// $("#kernel_toolbar").buttonset();
-// $("#interrupt_kernel").click(function () {IPython.notebook.kernel.interrupt();});
-// $("#restart_kernel").click(function () {IPython.notebook.kernel.restart();});
-// $("#kernel_status").addClass("status_idle");
-
-// $("#move_cell").buttonset();
-// $("#move_up").button("option", "icons", {primary:"ui-icon-arrowthick-1-n"});
-// $("#move_up").button("option", "text", false);
-// $("#move_up").click(function () {IPython.notebook.move_cell_up();});
-// $("#move_down").button("option", "icons", {primary:"ui-icon-arrowthick-1-s"});
-// $("#move_down").button("option", "text", false);
-// $("#move_down").click(function () {IPython.notebook.move_cell_down();});
-
-// $("#insert_delete").buttonset();
-// $("#insert_cell_before").click(function () {IPython.notebook.insert_code_cell_before();});
-// $("#insert_cell_after").click(function () {IPython.notebook.insert_code_cell_after();});
-// $("#delete_cell").button("option", "icons", {primary:"ui-icon-closethick"});
-// $("#delete_cell").button("option", "text", false);
-// $("#delete_cell").click(function () {IPython.notebook.delete_cell();});
-
-
});
@@ -144,12 +144,12 @@ var IPython = (function (IPython) {
this.content.addClass('ui-helper-clearfix');
- var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
+ var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
append($('<span/>').addClass('cell_section_row_buttons').
append($('<button>X</button>').attr('id','delete_cell'))).
append($('<span/>').html('Actions').addClass('cell_section_row_header'));
- row1.find('#delete_cell').button();
- this.content.append(row1);
+ row0.find('#delete_cell').button();
+ this.content.append(row0);
var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
append($('<span/>').attr('id','insert').addClass('cell_section_row_buttons').
@@ -175,13 +175,13 @@ var IPython = (function (IPython) {
row3.find('#cell_type').buttonset();
this.content.append(row3);
- var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
+ var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
append($('<span/>').attr('id','toggle_output').addClass('cell_section_row_buttons').
append( $('<button>Collapse</button>').attr('id','collapse_cell') ).
append( $('<button>Expand</button>').attr('id','expand_cell') ) ).
append($('<span/>').html('Output').addClass('button_label'));
- row0.find('#toggle_output').buttonset();
- this.content.append(row0);
+ row1.find('#toggle_output').buttonset();
+ this.content.append(row1);
var row0 = $('<div>').addClass('cell_section_row').
append($('<span/>').attr('id','run_cells').addClass('cell_section_row_buttons').
@@ -204,10 +204,80 @@ var IPython = (function (IPython) {
KernelSection.prototype = new PanelSection();
+ KernelSection.prototype.bind_events = function () {
+ PanelSection.prototype.bind_events.apply(this);
+ this.content.find('#restart_kernel').click(function () {
+ IPython.notebook.kernel.restart();
+ });
+ this.content.find('#int_kernel').click(function () {
+ IPython.notebook.kernel.interrupt();
+ });
+ };
+
+
+ KernelSection.prototype.create_children = function () {
+
+ this.content.addClass('ui-helper-clearfix');
+
+ var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
+ append($('<span/>').attr('id','int_restart').addClass('cell_section_row_buttons').
+ append( $('<button>Interrupt</button>').attr('id','int_kernel') ).
+ append( $('<button>Restart</button>').attr('id','restart_kernel') )).
+ append($('<span/>').html('Actions').addClass('cell_section_row_header'));
+ row0.find('#int_restart').buttonset();
+ this.content.append(row0);
+ };
+
+
+ // HelpSection
+
+ var HelpSection = function () {
+ this.section_name = "Help";
+ PanelSection.apply(this, arguments);
+ };
+
+
+ HelpSection.prototype = new PanelSection();
+
+
+ HelpSection.prototype.bind_events = function () {
+ PanelSection.prototype.bind_events.apply(this);
+ };
+
+
+ HelpSection.prototype.create_children = function () {
+
+ this.content.addClass('ui-helper-clearfix');
+
+ var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
+ append($('<span/>').attr('id','help_buttons0').addClass('cell_section_row_buttons').
+ append( $('<button/>').attr('id','python_help').
+ append( $('<a>Python</a>').attr('href','http://docs.python.org').attr('target','_blank') )).
+ append( $('<button/>').attr('id','ipython_help').
+ append( $('<a>IPython</a>').attr('href','http://ipython.org/documentation.html').attr('target','_blank') )).
+ append( $('<button/>').attr('id','numpy_help').
+ append( $('<a>NumPy</a>').attr('href','http://docs.scipy.org/doc/numpy/reference/').attr('target','_blank') ))).
+ append($('<span/>').html('Links').addClass('cell_section_row_header'));
+ row0.find('#help_buttons0').buttonset();
+ this.content.append(row0);
+
+ 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( $('<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').
+ append( $('<a>SymPy</a>').attr('href','http://docs.sympy.org/dev/index.html').attr('target','_blank') )));
+ row1.find('#help_buttons1').buttonset();
+ this.content.append(row1);
+ };
+
IPython.PanelSection = PanelSection;
IPython.NotebookSection = NotebookSection;
IPython.CellSection = CellSection;
IPython.KernelSection = KernelSection;
+ IPython.HelpSection = HelpSection;
return IPython;
@@ -68,56 +68,3 @@
</html>
-<!--<div id="tools">-->
-
-<!--<div id="menu_tabs">-->
-<!-- <span id="kernel_status">Idle</span>-->
-<!-- <ul>-->
-<!-- <li><a href="#cell_tab">Cell</a></li>-->
-<!-- <li><a href="#kernel_tab">Kernel</a></li>-->
-<!-- <li><a href="#help_tab">Help</a></li>-->
-<!-- </ul>-->
-<!-- <div id="cell_tab">-->
-<!-- <span id="cell_toolbar">-->
-<!-- <span id="move_cell">-->
-<!-- <button id="move_up">Move up</button>-->
-<!-- <button id="move_down">Move down</button>-->
-<!-- </span>-->
-<!-- <span id="insert_delete">-->
-<!-- <button id="insert_cell_before">Before</button>-->
-<!-- <button id="insert_cell_after">After</button>-->
-<!-- <button id="delete_cell">Delete</button>-->
-<!-- </span>-->
-<!-- <span id="cell_type">-->
-<!-- <button id="to_code">Code</button>-->
-<!-- <button id="to_text">Text</button>-->
-<!-- </span>-->
-<!-- <span id="sort">-->
-<!-- <button id="sort_cells">Sort</button>-->
-<!-- </span>-->
-<!-- <span id="toggle">-->
-<!-- <button id="collapse">Collapse</button>-->
-<!-- <button id="expand">Expand</button>-->
-<!-- </span>-->
-<!-- </span>-->
-<!-- </div>-->
-<!-- <div id="kernel_tab">-->
-<!-- <span id="kernel_toolbar">-->
-<!-- <button id="interrupt_kernel">Interrupt</button>-->
-<!-- <button id="restart_kernel">Restart</button>-->
-<!-- </span>-->
-<!-- </div>-->
-<!-- <div id="help_tab">-->
-<!-- <span id="help_toolbar">-->
-<!-- <button><a href="http://docs.python.org" target="_blank">Python</a></button>-->
-<!-- <button><a href="http://ipython.github.com/ipython-doc/dev/index.html" target="_blank">IPython</a></button>-->
-<!-- <button><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></button>-->
-<!-- <button><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></button>-->
-<!-- <button><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></button>-->
-<!-- <button><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></button>-->
-<!-- </span>-->
-<!-- </div>-->
-<!--</div>-->
-
-<!--</div>-->
-

0 comments on commit 0376908

Please sign in to comment.