Show More
@@ -128,7 +128,13 var IPython = (function (IPython) { | |||||
128 | }); |
|
128 | }); | |
129 | this.element.find('#run_all_cells').click(function () { |
|
129 | this.element.find('#run_all_cells').click(function () { | |
130 | IPython.notebook.execute_all_cells(); |
|
130 | IPython.notebook.execute_all_cells(); | |
131 | }); |
|
131 | }).attr('title', 'Run all cells in the notebook'); | |
|
132 | this.element.find('#run_all_cells_above').click(function () { | |||
|
133 | IPython.notebook.execute_cells_above(); | |||
|
134 | }).attr('title', 'Run all cells above (but not including) this cell'); | |||
|
135 | this.element.find('#run_all_cells_below').click(function () { | |||
|
136 | IPython.notebook.execute_cells_below(); | |||
|
137 | }).attr('title', 'Run this cell and all cells below it'); | |||
132 | this.element.find('#to_code').click(function () { |
|
138 | this.element.find('#to_code').click(function () { | |
133 | IPython.notebook.to_code(); |
|
139 | IPython.notebook.to_code(); | |
134 | }); |
|
140 | }); |
@@ -1049,13 +1049,25 var IPython = (function (IPython) { | |||||
1049 | }; |
|
1049 | }; | |
1050 |
|
1050 | |||
1051 |
|
1051 | |||
|
1052 | Notebook.prototype.execute_cells_below = function () { | |||
|
1053 | this.execute_cell_range(this.get_selected_index(), this.ncells()); | |||
|
1054 | that.scroll_to_bottom(); | |||
|
1055 | }; | |||
|
1056 | ||||
|
1057 | Notebook.prototype.execute_cells_above = function () { | |||
|
1058 | this.execute_cell_range(0, this.get_selected_index()); | |||
|
1059 | }; | |||
|
1060 | ||||
1052 | Notebook.prototype.execute_all_cells = function () { |
|
1061 | Notebook.prototype.execute_all_cells = function () { | |
1053 |
|
|
1062 | this.execute_cell_range(0, this.ncells()); | |
1054 | for (var i=0; i<ncells; i++) { |
|
1063 | that.scroll_to_bottom(); | |
|
1064 | }; | |||
|
1065 | ||||
|
1066 | Notebook.prototype.execute_cell_range = function (start, end) { | |||
|
1067 | for (var i=start; i<end; i++) { | |||
1055 | this.select(i); |
|
1068 | this.select(i); | |
1056 | this.execute_selected_cell({add_new:false}); |
|
1069 | this.execute_selected_cell({add_new:false}); | |
1057 | }; |
|
1070 | }; | |
1058 | this.scroll_to_bottom(); |
|
|||
1059 | }; |
|
1071 | }; | |
1060 |
|
1072 | |||
1061 | // Persistance and loading |
|
1073 | // Persistance and loading |
@@ -108,6 +108,8 data-notebook-id={{notebook_id}} | |||||
108 | <li id="run_cell"><a href="#">Run</a></li> |
|
108 | <li id="run_cell"><a href="#">Run</a></li> | |
109 | <li id="run_cell_in_place"><a href="#">Run in Place</a></li> |
|
109 | <li id="run_cell_in_place"><a href="#">Run in Place</a></li> | |
110 | <li id="run_all_cells"><a href="#">Run All</a></li> |
|
110 | <li id="run_all_cells"><a href="#">Run All</a></li> | |
|
111 | <li id="run_all_cells_above"><a href="#">Run All Above</a></li> | |||
|
112 | <li id="run_all_cells_below"><a href="#">Run All Below</a></li> | |||
111 | <hr/> |
|
113 | <hr/> | |
112 | <li id="to_code"><a href="#">Code</a></li> |
|
114 | <li id="to_code"><a href="#">Code</a></li> | |
113 | <li id="to_markdown"><a href="#">Markdown </a></li> |
|
115 | <li id="to_markdown"><a href="#">Markdown </a></li> |
General Comments 0
You need to be logged in to leave comments.
Login now