##// END OF EJS Templates
Help section implemented and working.
Brian E. Granger -
Show More
@@ -63,6 +63,9 b' var IPython = (function (IPython) {'
63 this.left_panel_element.append(this.cell_section.element);
63 this.left_panel_element.append(this.cell_section.element);
64 this.kernel_section = new IPython.KernelSection();
64 this.kernel_section = new IPython.KernelSection();
65 this.left_panel_element.append(this.kernel_section.element);
65 this.left_panel_element.append(this.kernel_section.element);
66 this.help_section = new IPython.HelpSection();
67 this.left_panel_element.append(this.help_section.element);
68 this.help_section.collapse();
66 }
69 }
67
70
68 LeftPanel.prototype.collapse = function () {
71 LeftPanel.prototype.collapse = function () {
@@ -28,31 +28,5 b' $(document).ready(function () {'
28 IPython.notebook.insert_code_cell_after();
28 IPython.notebook.insert_code_cell_after();
29 IPython.layout_manager.do_resize();
29 IPython.layout_manager.do_resize();
30 IPython.pager.collapse();
30 IPython.pager.collapse();
31
32 // $("#menu_tabs").tabs();
33
34 // $("#help_toolbar").buttonset();
35
36 // $("#kernel_toolbar").buttonset();
37 // $("#interrupt_kernel").click(function () {IPython.notebook.kernel.interrupt();});
38 // $("#restart_kernel").click(function () {IPython.notebook.kernel.restart();});
39 // $("#kernel_status").addClass("status_idle");
40
41 // $("#move_cell").buttonset();
42 // $("#move_up").button("option", "icons", {primary:"ui-icon-arrowthick-1-n"});
43 // $("#move_up").button("option", "text", false);
44 // $("#move_up").click(function () {IPython.notebook.move_cell_up();});
45 // $("#move_down").button("option", "icons", {primary:"ui-icon-arrowthick-1-s"});
46 // $("#move_down").button("option", "text", false);
47 // $("#move_down").click(function () {IPython.notebook.move_cell_down();});
48
49 // $("#insert_delete").buttonset();
50 // $("#insert_cell_before").click(function () {IPython.notebook.insert_code_cell_before();});
51 // $("#insert_cell_after").click(function () {IPython.notebook.insert_code_cell_after();});
52 // $("#delete_cell").button("option", "icons", {primary:"ui-icon-closethick"});
53 // $("#delete_cell").button("option", "text", false);
54 // $("#delete_cell").click(function () {IPython.notebook.delete_cell();});
55
56
57 });
31 });
58
32
@@ -144,12 +144,12 b' var IPython = (function (IPython) {'
144
144
145 this.content.addClass('ui-helper-clearfix');
145 this.content.addClass('ui-helper-clearfix');
146
146
147 var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
147 var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
148 append($('<span/>').addClass('cell_section_row_buttons').
148 append($('<span/>').addClass('cell_section_row_buttons').
149 append($('<button>X</button>').attr('id','delete_cell'))).
149 append($('<button>X</button>').attr('id','delete_cell'))).
150 append($('<span/>').html('Actions').addClass('cell_section_row_header'));
150 append($('<span/>').html('Actions').addClass('cell_section_row_header'));
151 row1.find('#delete_cell').button();
151 row0.find('#delete_cell').button();
152 this.content.append(row1);
152 this.content.append(row0);
153
153
154 var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
154 var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
155 append($('<span/>').attr('id','insert').addClass('cell_section_row_buttons').
155 append($('<span/>').attr('id','insert').addClass('cell_section_row_buttons').
@@ -175,13 +175,13 b' var IPython = (function (IPython) {'
175 row3.find('#cell_type').buttonset();
175 row3.find('#cell_type').buttonset();
176 this.content.append(row3);
176 this.content.append(row3);
177
177
178 var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
178 var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
179 append($('<span/>').attr('id','toggle_output').addClass('cell_section_row_buttons').
179 append($('<span/>').attr('id','toggle_output').addClass('cell_section_row_buttons').
180 append( $('<button>Collapse</button>').attr('id','collapse_cell') ).
180 append( $('<button>Collapse</button>').attr('id','collapse_cell') ).
181 append( $('<button>Expand</button>').attr('id','expand_cell') ) ).
181 append( $('<button>Expand</button>').attr('id','expand_cell') ) ).
182 append($('<span/>').html('Output').addClass('button_label'));
182 append($('<span/>').html('Output').addClass('button_label'));
183 row0.find('#toggle_output').buttonset();
183 row1.find('#toggle_output').buttonset();
184 this.content.append(row0);
184 this.content.append(row1);
185
185
186 var row0 = $('<div>').addClass('cell_section_row').
186 var row0 = $('<div>').addClass('cell_section_row').
187 append($('<span/>').attr('id','run_cells').addClass('cell_section_row_buttons').
187 append($('<span/>').attr('id','run_cells').addClass('cell_section_row_buttons').
@@ -204,10 +204,80 b' var IPython = (function (IPython) {'
204 KernelSection.prototype = new PanelSection();
204 KernelSection.prototype = new PanelSection();
205
205
206
206
207 KernelSection.prototype.bind_events = function () {
208 PanelSection.prototype.bind_events.apply(this);
209 this.content.find('#restart_kernel').click(function () {
210 IPython.notebook.kernel.restart();
211 });
212 this.content.find('#int_kernel').click(function () {
213 IPython.notebook.kernel.interrupt();
214 });
215 };
216
217
218 KernelSection.prototype.create_children = function () {
219
220 this.content.addClass('ui-helper-clearfix');
221
222 var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
223 append($('<span/>').attr('id','int_restart').addClass('cell_section_row_buttons').
224 append( $('<button>Interrupt</button>').attr('id','int_kernel') ).
225 append( $('<button>Restart</button>').attr('id','restart_kernel') )).
226 append($('<span/>').html('Actions').addClass('cell_section_row_header'));
227 row0.find('#int_restart').buttonset();
228 this.content.append(row0);
229 };
230
231
232 // HelpSection
233
234 var HelpSection = function () {
235 this.section_name = "Help";
236 PanelSection.apply(this, arguments);
237 };
238
239
240 HelpSection.prototype = new PanelSection();
241
242
243 HelpSection.prototype.bind_events = function () {
244 PanelSection.prototype.bind_events.apply(this);
245 };
246
247
248 HelpSection.prototype.create_children = function () {
249
250 this.content.addClass('ui-helper-clearfix');
251
252 var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
253 append($('<span/>').attr('id','help_buttons0').addClass('cell_section_row_buttons').
254 append( $('<button/>').attr('id','python_help').
255 append( $('<a>Python</a>').attr('href','http://docs.python.org').attr('target','_blank') )).
256 append( $('<button/>').attr('id','ipython_help').
257 append( $('<a>IPython</a>').attr('href','http://ipython.org/documentation.html').attr('target','_blank') )).
258 append( $('<button/>').attr('id','numpy_help').
259 append( $('<a>NumPy</a>').attr('href','http://docs.scipy.org/doc/numpy/reference/').attr('target','_blank') ))).
260 append($('<span/>').html('Links').addClass('cell_section_row_header'));
261 row0.find('#help_buttons0').buttonset();
262 this.content.append(row0);
263
264 var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix').
265 append($('<span/>').attr('id','help_buttons1').addClass('cell_section_row_buttons').
266 append( $('<button/>').attr('id','matplotlib_help').
267 append( $('<a>Matplotlib</a>').attr('href','http://matplotlib.sourceforge.net/').attr('target','_blank') )).
268 append( $('<button/>').attr('id','scipy_help').
269 append( $('<a>SciPy</a>').attr('href','http://docs.scipy.org/doc/scipy/reference/').attr('target','_blank') )).
270 append( $('<button/>').attr('id','sympy_help').
271 append( $('<a>SymPy</a>').attr('href','http://docs.sympy.org/dev/index.html').attr('target','_blank') )));
272 row1.find('#help_buttons1').buttonset();
273 this.content.append(row1);
274 };
275
207 IPython.PanelSection = PanelSection;
276 IPython.PanelSection = PanelSection;
208 IPython.NotebookSection = NotebookSection;
277 IPython.NotebookSection = NotebookSection;
209 IPython.CellSection = CellSection;
278 IPython.CellSection = CellSection;
210 IPython.KernelSection = KernelSection;
279 IPython.KernelSection = KernelSection;
280 IPython.HelpSection = HelpSection;
211
281
212 return IPython;
282 return IPython;
213
283
@@ -68,56 +68,3 b''
68 </html>
68 </html>
69
69
70
70
71 <!--<div id="tools">-->
72
73 <!--<div id="menu_tabs">-->
74 <!-- <span id="kernel_status">Idle</span>-->
75 <!-- <ul>-->
76 <!-- <li><a href="#cell_tab">Cell</a></li>-->
77 <!-- <li><a href="#kernel_tab">Kernel</a></li>-->
78 <!-- <li><a href="#help_tab">Help</a></li>-->
79 <!-- </ul>-->
80 <!-- <div id="cell_tab">-->
81 <!-- <span id="cell_toolbar">-->
82 <!-- <span id="move_cell">-->
83 <!-- <button id="move_up">Move up</button>-->
84 <!-- <button id="move_down">Move down</button>-->
85 <!-- </span>-->
86 <!-- <span id="insert_delete">-->
87 <!-- <button id="insert_cell_before">Before</button>-->
88 <!-- <button id="insert_cell_after">After</button>-->
89 <!-- <button id="delete_cell">Delete</button>-->
90 <!-- </span>-->
91 <!-- <span id="cell_type">-->
92 <!-- <button id="to_code">Code</button>-->
93 <!-- <button id="to_text">Text</button>-->
94 <!-- </span>-->
95 <!-- <span id="sort">-->
96 <!-- <button id="sort_cells">Sort</button>-->
97 <!-- </span>-->
98 <!-- <span id="toggle">-->
99 <!-- <button id="collapse">Collapse</button>-->
100 <!-- <button id="expand">Expand</button>-->
101 <!-- </span>-->
102 <!-- </span>-->
103 <!-- </div>-->
104 <!-- <div id="kernel_tab">-->
105 <!-- <span id="kernel_toolbar">-->
106 <!-- <button id="interrupt_kernel">Interrupt</button>-->
107 <!-- <button id="restart_kernel">Restart</button>-->
108 <!-- </span>-->
109 <!-- </div>-->
110 <!-- <div id="help_tab">-->
111 <!-- <span id="help_toolbar">-->
112 <!-- <button><a href="http://docs.python.org" target="_blank">Python</a></button>-->
113 <!-- <button><a href="http://ipython.github.com/ipython-doc/dev/index.html" target="_blank">IPython</a></button>-->
114 <!-- <button><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></button>-->
115 <!-- <button><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></button>-->
116 <!-- <button><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></button>-->
117 <!-- <button><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></button>-->
118 <!-- </span>-->
119 <!-- </div>-->
120 <!--</div>-->
121
122 <!--</div>-->
123
General Comments 0
You need to be logged in to leave comments. Login now