Show More
@@ -1,206 +1,206 b'' | |||||
1 | //---------------------------------------------------------------------------- |
|
1 | //---------------------------------------------------------------------------- | |
2 | // Copyright (C) 2011 The IPython Development Team |
|
2 | // Copyright (C) 2011 The IPython Development Team | |
3 | // |
|
3 | // | |
4 | // Distributed under the terms of the BSD License. The full license is in |
|
4 | // Distributed under the terms of the BSD License. The full license is in | |
5 | // the file COPYING, distributed as part of this software. |
|
5 | // the file COPYING, distributed as part of this software. | |
6 | //---------------------------------------------------------------------------- |
|
6 | //---------------------------------------------------------------------------- | |
7 |
|
7 | |||
8 | //============================================================================ |
|
8 | //============================================================================ | |
9 | // ToolBar |
|
9 | // ToolBar | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 | var IPython = (function (IPython) { |
|
12 | var IPython = (function (IPython) { | |
13 |
|
13 | |||
14 | var MainToolBar = function (selector) { |
|
14 | var MainToolBar = function (selector) { | |
15 | IPython.ToolBar.apply(this, arguments); |
|
15 | IPython.ToolBar.apply(this, arguments); | |
16 | this.construct(); |
|
16 | this.construct(); | |
17 | this.add_celltype_list(); |
|
17 | this.add_celltype_list(); | |
18 | this.add_celltoolbar_list(); |
|
18 | this.add_celltoolbar_list(); | |
19 | this.bind_events(); |
|
19 | this.bind_events(); | |
20 | }; |
|
20 | }; | |
21 |
|
21 | |||
22 | MainToolBar.prototype = new IPython.ToolBar(); |
|
22 | MainToolBar.prototype = new IPython.ToolBar(); | |
23 |
|
23 | |||
24 | MainToolBar.prototype.construct = function () { |
|
24 | MainToolBar.prototype.construct = function () { | |
25 | this.add_buttons_group([ |
|
25 | this.add_buttons_group([ | |
26 | { |
|
26 | { | |
27 | id : 'save_b', |
|
27 | id : 'save_b', | |
28 | label : 'Save Checkpoint', |
|
28 | label : 'Save and Checkpoint', | |
29 | icon : 'ui-icon-disk', |
|
29 | icon : 'ui-icon-disk', | |
30 | callback : function () { |
|
30 | callback : function () { | |
31 | IPython.notebook.save_checkpoint(); |
|
31 | IPython.notebook.save_checkpoint(); | |
32 | } |
|
32 | } | |
33 | } |
|
33 | } | |
34 | ]); |
|
34 | ]); | |
35 | this.add_buttons_group([ |
|
35 | this.add_buttons_group([ | |
36 | { |
|
36 | { | |
37 | id : 'cut_b', |
|
37 | id : 'cut_b', | |
38 | label : 'Cut Cell', |
|
38 | label : 'Cut Cell', | |
39 | icon : 'ui-icon-scissors', |
|
39 | icon : 'ui-icon-scissors', | |
40 | callback : function () { |
|
40 | callback : function () { | |
41 | IPython.notebook.cut_cell(); |
|
41 | IPython.notebook.cut_cell(); | |
42 | } |
|
42 | } | |
43 | }, |
|
43 | }, | |
44 | { |
|
44 | { | |
45 | id : 'copy_b', |
|
45 | id : 'copy_b', | |
46 | label : 'Copy Cell', |
|
46 | label : 'Copy Cell', | |
47 | icon : 'ui-icon-copy', |
|
47 | icon : 'ui-icon-copy', | |
48 | callback : function () { |
|
48 | callback : function () { | |
49 | IPython.notebook.copy_cell(); |
|
49 | IPython.notebook.copy_cell(); | |
50 | } |
|
50 | } | |
51 | }, |
|
51 | }, | |
52 | { |
|
52 | { | |
53 | id : 'paste_b', |
|
53 | id : 'paste_b', | |
54 | label : 'Paste Cell Below', |
|
54 | label : 'Paste Cell Below', | |
55 | icon : 'ui-icon-clipboard', |
|
55 | icon : 'ui-icon-clipboard', | |
56 | callback : function () { |
|
56 | callback : function () { | |
57 | IPython.notebook.paste_cell_below(); |
|
57 | IPython.notebook.paste_cell_below(); | |
58 | } |
|
58 | } | |
59 | } |
|
59 | } | |
60 | ],'cut_copy_paste'); |
|
60 | ],'cut_copy_paste'); | |
61 |
|
61 | |||
62 | this.add_buttons_group([ |
|
62 | this.add_buttons_group([ | |
63 | { |
|
63 | { | |
64 | id : 'move_up_b', |
|
64 | id : 'move_up_b', | |
65 | label : 'Move Cell Up', |
|
65 | label : 'Move Cell Up', | |
66 | icon : 'ui-icon-arrowthick-1-n', |
|
66 | icon : 'ui-icon-arrowthick-1-n', | |
67 | callback : function () { |
|
67 | callback : function () { | |
68 | IPython.notebook.move_cell_up(); |
|
68 | IPython.notebook.move_cell_up(); | |
69 | } |
|
69 | } | |
70 | }, |
|
70 | }, | |
71 | { |
|
71 | { | |
72 | id : 'move_down_b', |
|
72 | id : 'move_down_b', | |
73 | label : 'Move Cell Down', |
|
73 | label : 'Move Cell Down', | |
74 | icon : 'ui-icon-arrowthick-1-s', |
|
74 | icon : 'ui-icon-arrowthick-1-s', | |
75 | callback : function () { |
|
75 | callback : function () { | |
76 | IPython.notebook.move_cell_down(); |
|
76 | IPython.notebook.move_cell_down(); | |
77 | } |
|
77 | } | |
78 | } |
|
78 | } | |
79 | ],'move_up_down'); |
|
79 | ],'move_up_down'); | |
80 |
|
80 | |||
81 | this.add_buttons_group([ |
|
81 | this.add_buttons_group([ | |
82 | { |
|
82 | { | |
83 | id : 'insert_above_b', |
|
83 | id : 'insert_above_b', | |
84 | label : 'Insert Cell Above', |
|
84 | label : 'Insert Cell Above', | |
85 | icon : 'ui-icon-arrowthickstop-1-n', |
|
85 | icon : 'ui-icon-arrowthickstop-1-n', | |
86 | callback : function () { |
|
86 | callback : function () { | |
87 | IPython.notebook.insert_cell_above('code'); |
|
87 | IPython.notebook.insert_cell_above('code'); | |
88 | } |
|
88 | } | |
89 | }, |
|
89 | }, | |
90 | { |
|
90 | { | |
91 | id : 'insert_below_b', |
|
91 | id : 'insert_below_b', | |
92 | label : 'Insert Cell Below', |
|
92 | label : 'Insert Cell Below', | |
93 | icon : 'ui-icon-arrowthickstop-1-s', |
|
93 | icon : 'ui-icon-arrowthickstop-1-s', | |
94 | callback : function () { |
|
94 | callback : function () { | |
95 | IPython.notebook.insert_cell_below('code'); |
|
95 | IPython.notebook.insert_cell_below('code'); | |
96 | } |
|
96 | } | |
97 | } |
|
97 | } | |
98 | ],'insert_above_below'); |
|
98 | ],'insert_above_below'); | |
99 |
|
99 | |||
100 | this.add_buttons_group([ |
|
100 | this.add_buttons_group([ | |
101 | { |
|
101 | { | |
102 | id : 'run_b', |
|
102 | id : 'run_b', | |
103 | label : 'Run Cell', |
|
103 | label : 'Run Cell', | |
104 | icon : 'ui-icon-play', |
|
104 | icon : 'ui-icon-play', | |
105 | callback : function () { |
|
105 | callback : function () { | |
106 | IPython.notebook.execute_selected_cell(); |
|
106 | IPython.notebook.execute_selected_cell(); | |
107 | } |
|
107 | } | |
108 | }, |
|
108 | }, | |
109 | { |
|
109 | { | |
110 | id : 'interrupt_b', |
|
110 | id : 'interrupt_b', | |
111 | label : 'Interrupt', |
|
111 | label : 'Interrupt', | |
112 | icon : 'ui-icon-stop', |
|
112 | icon : 'ui-icon-stop', | |
113 | callback : function () { |
|
113 | callback : function () { | |
114 | IPython.notebook.kernel.interrupt(); |
|
114 | IPython.notebook.kernel.interrupt(); | |
115 | } |
|
115 | } | |
116 | } |
|
116 | } | |
117 | ],'run_int'); |
|
117 | ],'run_int'); | |
118 | }; |
|
118 | }; | |
119 |
|
119 | |||
120 | MainToolBar.prototype.add_celltype_list = function () { |
|
120 | MainToolBar.prototype.add_celltype_list = function () { | |
121 | this.element |
|
121 | this.element | |
122 | .append($('<select/>') |
|
122 | .append($('<select/>') | |
123 | .attr('id','cell_type') |
|
123 | .attr('id','cell_type') | |
124 | .addClass('ui-widget-content') |
|
124 | .addClass('ui-widget-content') | |
125 | .append($('<option/>').attr('value','code').text('Code')) |
|
125 | .append($('<option/>').attr('value','code').text('Code')) | |
126 | .append($('<option/>').attr('value','markdown').text('Markdown')) |
|
126 | .append($('<option/>').attr('value','markdown').text('Markdown')) | |
127 | .append($('<option/>').attr('value','raw').text('Raw Text')) |
|
127 | .append($('<option/>').attr('value','raw').text('Raw Text')) | |
128 | .append($('<option/>').attr('value','heading1').text('Heading 1')) |
|
128 | .append($('<option/>').attr('value','heading1').text('Heading 1')) | |
129 | .append($('<option/>').attr('value','heading2').text('Heading 2')) |
|
129 | .append($('<option/>').attr('value','heading2').text('Heading 2')) | |
130 | .append($('<option/>').attr('value','heading3').text('Heading 3')) |
|
130 | .append($('<option/>').attr('value','heading3').text('Heading 3')) | |
131 | .append($('<option/>').attr('value','heading4').text('Heading 4')) |
|
131 | .append($('<option/>').attr('value','heading4').text('Heading 4')) | |
132 | .append($('<option/>').attr('value','heading5').text('Heading 5')) |
|
132 | .append($('<option/>').attr('value','heading5').text('Heading 5')) | |
133 | .append($('<option/>').attr('value','heading6').text('Heading 6')) |
|
133 | .append($('<option/>').attr('value','heading6').text('Heading 6')) | |
134 | ); |
|
134 | ); | |
135 | }; |
|
135 | }; | |
136 |
|
136 | |||
137 |
|
137 | |||
138 | MainToolBar.prototype.add_celltoolbar_list = function () { |
|
138 | MainToolBar.prototype.add_celltoolbar_list = function () { | |
139 | var label = $('<label/>').text('Cell Toolbar:'); |
|
139 | var label = $('<label/>').text('Cell Toolbar:'); | |
140 | var select = $('<select/>') |
|
140 | var select = $('<select/>') | |
141 | .addClass('ui-widget-content') |
|
141 | .addClass('ui-widget-content') | |
142 | .attr('id', 'ctb_select') |
|
142 | .attr('id', 'ctb_select') | |
143 | .append($('<option/>').attr('value', '').text('None')); |
|
143 | .append($('<option/>').attr('value', '').text('None')); | |
144 | this.element.append(label).append(select); |
|
144 | this.element.append(label).append(select); | |
145 | select.change(function() { |
|
145 | select.change(function() { | |
146 | var val = $(this).val() |
|
146 | var val = $(this).val() | |
147 | if (val =='') { |
|
147 | if (val =='') { | |
148 | IPython.CellToolbar.global_hide(); |
|
148 | IPython.CellToolbar.global_hide(); | |
149 | } else { |
|
149 | } else { | |
150 | IPython.CellToolbar.global_show(); |
|
150 | IPython.CellToolbar.global_show(); | |
151 | IPython.CellToolbar.activate_preset(val); |
|
151 | IPython.CellToolbar.activate_preset(val); | |
152 | } |
|
152 | } | |
153 | }); |
|
153 | }); | |
154 | // Setup the currently registered presets. |
|
154 | // Setup the currently registered presets. | |
155 | var presets = IPython.CellToolbar.list_presets(); |
|
155 | var presets = IPython.CellToolbar.list_presets(); | |
156 | for (var i=0; i<presets.length; i++) { |
|
156 | for (var i=0; i<presets.length; i++) { | |
157 | var name = presets[i]; |
|
157 | var name = presets[i]; | |
158 | select.append($('<option/>').attr('value', name).text(name)); |
|
158 | select.append($('<option/>').attr('value', name).text(name)); | |
159 | } |
|
159 | } | |
160 | // Setup future preset registrations. |
|
160 | // Setup future preset registrations. | |
161 | $([IPython.events]).on('preset_added.CellToolbar', function (event, data) { |
|
161 | $([IPython.events]).on('preset_added.CellToolbar', function (event, data) { | |
162 | var name = data.name; |
|
162 | var name = data.name; | |
163 | select.append($('<option/>').attr('value', name).text(name)); |
|
163 | select.append($('<option/>').attr('value', name).text(name)); | |
164 | }); |
|
164 | }); | |
165 | }; |
|
165 | }; | |
166 |
|
166 | |||
167 |
|
167 | |||
168 | MainToolBar.prototype.bind_events = function () { |
|
168 | MainToolBar.prototype.bind_events = function () { | |
169 | var that = this; |
|
169 | var that = this; | |
170 |
|
170 | |||
171 | this.element.find('#cell_type').change(function () { |
|
171 | this.element.find('#cell_type').change(function () { | |
172 | var cell_type = $(this).val(); |
|
172 | var cell_type = $(this).val(); | |
173 | if (cell_type === 'code') { |
|
173 | if (cell_type === 'code') { | |
174 | IPython.notebook.to_code(); |
|
174 | IPython.notebook.to_code(); | |
175 | } else if (cell_type === 'markdown') { |
|
175 | } else if (cell_type === 'markdown') { | |
176 | IPython.notebook.to_markdown(); |
|
176 | IPython.notebook.to_markdown(); | |
177 | } else if (cell_type === 'raw') { |
|
177 | } else if (cell_type === 'raw') { | |
178 | IPython.notebook.to_raw(); |
|
178 | IPython.notebook.to_raw(); | |
179 | } else if (cell_type === 'heading1') { |
|
179 | } else if (cell_type === 'heading1') { | |
180 | IPython.notebook.to_heading(undefined, 1); |
|
180 | IPython.notebook.to_heading(undefined, 1); | |
181 | } else if (cell_type === 'heading2') { |
|
181 | } else if (cell_type === 'heading2') { | |
182 | IPython.notebook.to_heading(undefined, 2); |
|
182 | IPython.notebook.to_heading(undefined, 2); | |
183 | } else if (cell_type === 'heading3') { |
|
183 | } else if (cell_type === 'heading3') { | |
184 | IPython.notebook.to_heading(undefined, 3); |
|
184 | IPython.notebook.to_heading(undefined, 3); | |
185 | } else if (cell_type === 'heading4') { |
|
185 | } else if (cell_type === 'heading4') { | |
186 | IPython.notebook.to_heading(undefined, 4); |
|
186 | IPython.notebook.to_heading(undefined, 4); | |
187 | } else if (cell_type === 'heading5') { |
|
187 | } else if (cell_type === 'heading5') { | |
188 | IPython.notebook.to_heading(undefined, 5); |
|
188 | IPython.notebook.to_heading(undefined, 5); | |
189 | } else if (cell_type === 'heading6') { |
|
189 | } else if (cell_type === 'heading6') { | |
190 | IPython.notebook.to_heading(undefined, 6); |
|
190 | IPython.notebook.to_heading(undefined, 6); | |
191 | } |
|
191 | } | |
192 | }); |
|
192 | }); | |
193 | $([IPython.events]).on('selected_cell_type_changed.Notebook', function (event, data) { |
|
193 | $([IPython.events]).on('selected_cell_type_changed.Notebook', function (event, data) { | |
194 | if (data.cell_type === 'heading') { |
|
194 | if (data.cell_type === 'heading') { | |
195 | that.element.find('#cell_type').val(data.cell_type+data.level); |
|
195 | that.element.find('#cell_type').val(data.cell_type+data.level); | |
196 | } else { |
|
196 | } else { | |
197 | that.element.find('#cell_type').val(data.cell_type); |
|
197 | that.element.find('#cell_type').val(data.cell_type); | |
198 | } |
|
198 | } | |
199 | }); |
|
199 | }); | |
200 | }; |
|
200 | }; | |
201 |
|
201 | |||
202 | IPython.MainToolBar = MainToolBar; |
|
202 | IPython.MainToolBar = MainToolBar; | |
203 |
|
203 | |||
204 | return IPython; |
|
204 | return IPython; | |
205 |
|
205 | |||
206 | }(IPython)); |
|
206 | }(IPython)); |
@@ -1,259 +1,256 b'' | |||||
1 | //---------------------------------------------------------------------------- |
|
1 | //---------------------------------------------------------------------------- | |
2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
2 | // Copyright (C) 2008-2011 The IPython Development Team | |
3 | // |
|
3 | // | |
4 | // Distributed under the terms of the BSD License. The full license is in |
|
4 | // Distributed under the terms of the BSD License. The full license is in | |
5 | // the file COPYING, distributed as part of this software. |
|
5 | // the file COPYING, distributed as part of this software. | |
6 | //---------------------------------------------------------------------------- |
|
6 | //---------------------------------------------------------------------------- | |
7 |
|
7 | |||
8 | //============================================================================ |
|
8 | //============================================================================ | |
9 | // MenuBar |
|
9 | // MenuBar | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 | /** |
|
12 | /** | |
13 | * @module IPython |
|
13 | * @module IPython | |
14 | * @namespace IPython |
|
14 | * @namespace IPython | |
15 | * @submodule MenuBar |
|
15 | * @submodule MenuBar | |
16 | */ |
|
16 | */ | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | var IPython = (function (IPython) { |
|
19 | var IPython = (function (IPython) { | |
20 |
|
20 | |||
21 | /** |
|
21 | /** | |
22 | * A MenuBar Class to generate the menubar of IPython noteboko |
|
22 | * A MenuBar Class to generate the menubar of IPython noteboko | |
23 | * @Class MenuBar |
|
23 | * @Class MenuBar | |
24 | * |
|
24 | * | |
25 | * @constructor |
|
25 | * @constructor | |
26 | * |
|
26 | * | |
27 | * |
|
27 | * | |
28 | * @param selector {string} selector for the menubar element in DOM |
|
28 | * @param selector {string} selector for the menubar element in DOM | |
29 | * @param {object} [options] |
|
29 | * @param {object} [options] | |
30 | * @param [options.baseProjectUrl] {String} String to use for the |
|
30 | * @param [options.baseProjectUrl] {String} String to use for the | |
31 | * Base Project url, default would be to inspect |
|
31 | * Base Project url, default would be to inspect | |
32 | * $('body').data('baseProjectUrl'); |
|
32 | * $('body').data('baseProjectUrl'); | |
33 | * does not support change for now is set through this option |
|
33 | * does not support change for now is set through this option | |
34 | */ |
|
34 | */ | |
35 | var MenuBar = function (selector, options) { |
|
35 | var MenuBar = function (selector, options) { | |
36 | var options = options || {}; |
|
36 | var options = options || {}; | |
37 | if(options.baseProjectUrl!= undefined){ |
|
37 | if(options.baseProjectUrl!= undefined){ | |
38 | this._baseProjectUrl = options.baseProjectUrl; |
|
38 | this._baseProjectUrl = options.baseProjectUrl; | |
39 | } |
|
39 | } | |
40 | this.selector = selector; |
|
40 | this.selector = selector; | |
41 | if (this.selector !== undefined) { |
|
41 | if (this.selector !== undefined) { | |
42 | this.element = $(selector); |
|
42 | this.element = $(selector); | |
43 | this.style(); |
|
43 | this.style(); | |
44 | this.bind_events(); |
|
44 | this.bind_events(); | |
45 | } |
|
45 | } | |
46 | }; |
|
46 | }; | |
47 |
|
47 | |||
48 | MenuBar.prototype.baseProjectUrl = function(){ |
|
48 | MenuBar.prototype.baseProjectUrl = function(){ | |
49 | return this._baseProjectUrl || $('body').data('baseProjectUrl'); |
|
49 | return this._baseProjectUrl || $('body').data('baseProjectUrl'); | |
50 | }; |
|
50 | }; | |
51 |
|
51 | |||
52 |
|
52 | |||
53 | MenuBar.prototype.style = function () { |
|
53 | MenuBar.prototype.style = function () { | |
54 | this.element.addClass('border-box-sizing'); |
|
54 | this.element.addClass('border-box-sizing'); | |
55 | $('ul#menus').menubar({ |
|
55 | $('ul#menus').menubar({ | |
56 | select : function (event, ui) { |
|
56 | select : function (event, ui) { | |
57 | // The selected cell loses focus when the menu is entered, so we |
|
57 | // The selected cell loses focus when the menu is entered, so we | |
58 | // re-select it upon selection. |
|
58 | // re-select it upon selection. | |
59 | var i = IPython.notebook.get_selected_index(); |
|
59 | var i = IPython.notebook.get_selected_index(); | |
60 | IPython.notebook.select(i); |
|
60 | IPython.notebook.select(i); | |
61 | } |
|
61 | } | |
62 | }); |
|
62 | }); | |
63 | }; |
|
63 | }; | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | MenuBar.prototype.bind_events = function () { |
|
66 | MenuBar.prototype.bind_events = function () { | |
67 | // File |
|
67 | // File | |
68 | var that = this; |
|
68 | var that = this; | |
69 | this.element.find('#new_notebook').click(function () { |
|
69 | this.element.find('#new_notebook').click(function () { | |
70 | window.open(that.baseProjectUrl()+'new'); |
|
70 | window.open(that.baseProjectUrl()+'new'); | |
71 | }); |
|
71 | }); | |
72 | this.element.find('#open_notebook').click(function () { |
|
72 | this.element.find('#open_notebook').click(function () { | |
73 | window.open(that.baseProjectUrl()); |
|
73 | window.open(that.baseProjectUrl()); | |
74 | }); |
|
74 | }); | |
75 | this.element.find('#rename_notebook').click(function () { |
|
75 | this.element.find('#rename_notebook').click(function () { | |
76 | IPython.save_widget.rename_notebook(); |
|
76 | IPython.save_widget.rename_notebook(); | |
77 | }); |
|
77 | }); | |
78 | this.element.find('#copy_notebook').click(function () { |
|
78 | this.element.find('#copy_notebook').click(function () { | |
79 | var notebook_id = IPython.notebook.get_notebook_id(); |
|
79 | var notebook_id = IPython.notebook.get_notebook_id(); | |
80 | var url = that.baseProjectUrl() + notebook_id + '/copy'; |
|
80 | var url = that.baseProjectUrl() + notebook_id + '/copy'; | |
81 | window.open(url,'_blank'); |
|
81 | window.open(url,'_blank'); | |
82 | return false; |
|
82 | return false; | |
83 | }); |
|
83 | }); | |
84 | this.element.find('#save_notebook').click(function () { |
|
|||
85 | IPython.notebook.save_notebook(); |
|
|||
86 | }); |
|
|||
87 | this.element.find('#save_checkpoint').click(function () { |
|
84 | this.element.find('#save_checkpoint').click(function () { | |
88 | IPython.notebook.save_checkpoint(); |
|
85 | IPython.notebook.save_checkpoint(); | |
89 | }); |
|
86 | }); | |
90 | this.element.find('#restore_checkpoint').click(function () { |
|
87 | this.element.find('#restore_checkpoint').click(function () { | |
91 | }); |
|
88 | }); | |
92 | this.element.find('#download_ipynb').click(function () { |
|
89 | this.element.find('#download_ipynb').click(function () { | |
93 | var notebook_id = IPython.notebook.get_notebook_id(); |
|
90 | var notebook_id = IPython.notebook.get_notebook_id(); | |
94 | var url = that.baseProjectUrl() + 'notebooks/' + |
|
91 | var url = that.baseProjectUrl() + 'notebooks/' + | |
95 | notebook_id + '?format=json'; |
|
92 | notebook_id + '?format=json'; | |
96 | window.location.assign(url); |
|
93 | window.location.assign(url); | |
97 | }); |
|
94 | }); | |
98 | this.element.find('#download_py').click(function () { |
|
95 | this.element.find('#download_py').click(function () { | |
99 | var notebook_id = IPython.notebook.get_notebook_id(); |
|
96 | var notebook_id = IPython.notebook.get_notebook_id(); | |
100 | var url = that.baseProjectUrl() + 'notebooks/' + |
|
97 | var url = that.baseProjectUrl() + 'notebooks/' + | |
101 | notebook_id + '?format=py'; |
|
98 | notebook_id + '?format=py'; | |
102 | window.location.assign(url); |
|
99 | window.location.assign(url); | |
103 | }); |
|
100 | }); | |
104 | this.element.find('#kill_and_exit').click(function () { |
|
101 | this.element.find('#kill_and_exit').click(function () { | |
105 | IPython.notebook.kernel.kill(); |
|
102 | IPython.notebook.kernel.kill(); | |
106 | setTimeout(function(){window.close();}, 200); |
|
103 | setTimeout(function(){window.close();}, 200); | |
107 | }); |
|
104 | }); | |
108 | // Edit |
|
105 | // Edit | |
109 | this.element.find('#cut_cell').click(function () { |
|
106 | this.element.find('#cut_cell').click(function () { | |
110 | IPython.notebook.cut_cell(); |
|
107 | IPython.notebook.cut_cell(); | |
111 | }); |
|
108 | }); | |
112 | this.element.find('#copy_cell').click(function () { |
|
109 | this.element.find('#copy_cell').click(function () { | |
113 | IPython.notebook.copy_cell(); |
|
110 | IPython.notebook.copy_cell(); | |
114 | }); |
|
111 | }); | |
115 | this.element.find('#delete_cell').click(function () { |
|
112 | this.element.find('#delete_cell').click(function () { | |
116 | IPython.notebook.delete_cell(); |
|
113 | IPython.notebook.delete_cell(); | |
117 | }); |
|
114 | }); | |
118 | this.element.find('#undelete_cell').click(function () { |
|
115 | this.element.find('#undelete_cell').click(function () { | |
119 | IPython.notebook.undelete(); |
|
116 | IPython.notebook.undelete(); | |
120 | }); |
|
117 | }); | |
121 | this.element.find('#split_cell').click(function () { |
|
118 | this.element.find('#split_cell').click(function () { | |
122 | IPython.notebook.split_cell(); |
|
119 | IPython.notebook.split_cell(); | |
123 | }); |
|
120 | }); | |
124 | this.element.find('#merge_cell_above').click(function () { |
|
121 | this.element.find('#merge_cell_above').click(function () { | |
125 | IPython.notebook.merge_cell_above(); |
|
122 | IPython.notebook.merge_cell_above(); | |
126 | }); |
|
123 | }); | |
127 | this.element.find('#merge_cell_below').click(function () { |
|
124 | this.element.find('#merge_cell_below').click(function () { | |
128 | IPython.notebook.merge_cell_below(); |
|
125 | IPython.notebook.merge_cell_below(); | |
129 | }); |
|
126 | }); | |
130 | this.element.find('#move_cell_up').click(function () { |
|
127 | this.element.find('#move_cell_up').click(function () { | |
131 | IPython.notebook.move_cell_up(); |
|
128 | IPython.notebook.move_cell_up(); | |
132 | }); |
|
129 | }); | |
133 | this.element.find('#move_cell_down').click(function () { |
|
130 | this.element.find('#move_cell_down').click(function () { | |
134 | IPython.notebook.move_cell_down(); |
|
131 | IPython.notebook.move_cell_down(); | |
135 | }); |
|
132 | }); | |
136 | this.element.find('#select_previous').click(function () { |
|
133 | this.element.find('#select_previous').click(function () { | |
137 | IPython.notebook.select_prev(); |
|
134 | IPython.notebook.select_prev(); | |
138 | }); |
|
135 | }); | |
139 | this.element.find('#select_next').click(function () { |
|
136 | this.element.find('#select_next').click(function () { | |
140 | IPython.notebook.select_next(); |
|
137 | IPython.notebook.select_next(); | |
141 | }); |
|
138 | }); | |
142 | // View |
|
139 | // View | |
143 | this.element.find('#toggle_header').click(function () { |
|
140 | this.element.find('#toggle_header').click(function () { | |
144 | $('div#header').toggle(); |
|
141 | $('div#header').toggle(); | |
145 | IPython.layout_manager.do_resize(); |
|
142 | IPython.layout_manager.do_resize(); | |
146 | }); |
|
143 | }); | |
147 | this.element.find('#toggle_toolbar').click(function () { |
|
144 | this.element.find('#toggle_toolbar').click(function () { | |
148 | IPython.toolbar.toggle(); |
|
145 | IPython.toolbar.toggle(); | |
149 | }); |
|
146 | }); | |
150 | // Insert |
|
147 | // Insert | |
151 | this.element.find('#insert_cell_above').click(function () { |
|
148 | this.element.find('#insert_cell_above').click(function () { | |
152 | IPython.notebook.insert_cell_above('code'); |
|
149 | IPython.notebook.insert_cell_above('code'); | |
153 | }); |
|
150 | }); | |
154 | this.element.find('#insert_cell_below').click(function () { |
|
151 | this.element.find('#insert_cell_below').click(function () { | |
155 | IPython.notebook.insert_cell_below('code'); |
|
152 | IPython.notebook.insert_cell_below('code'); | |
156 | }); |
|
153 | }); | |
157 | // Cell |
|
154 | // Cell | |
158 | this.element.find('#run_cell').click(function () { |
|
155 | this.element.find('#run_cell').click(function () { | |
159 | IPython.notebook.execute_selected_cell(); |
|
156 | IPython.notebook.execute_selected_cell(); | |
160 | }); |
|
157 | }); | |
161 | this.element.find('#run_cell_in_place').click(function () { |
|
158 | this.element.find('#run_cell_in_place').click(function () { | |
162 | IPython.notebook.execute_selected_cell({terminal:true}); |
|
159 | IPython.notebook.execute_selected_cell({terminal:true}); | |
163 | }); |
|
160 | }); | |
164 | this.element.find('#run_all_cells').click(function () { |
|
161 | this.element.find('#run_all_cells').click(function () { | |
165 | IPython.notebook.execute_all_cells(); |
|
162 | IPython.notebook.execute_all_cells(); | |
166 | }).attr('title', 'Run all cells in the notebook'); |
|
163 | }).attr('title', 'Run all cells in the notebook'); | |
167 | this.element.find('#run_all_cells_above').click(function () { |
|
164 | this.element.find('#run_all_cells_above').click(function () { | |
168 | IPython.notebook.execute_cells_above(); |
|
165 | IPython.notebook.execute_cells_above(); | |
169 | }).attr('title', 'Run all cells above (but not including) this cell'); |
|
166 | }).attr('title', 'Run all cells above (but not including) this cell'); | |
170 | this.element.find('#run_all_cells_below').click(function () { |
|
167 | this.element.find('#run_all_cells_below').click(function () { | |
171 | IPython.notebook.execute_cells_below(); |
|
168 | IPython.notebook.execute_cells_below(); | |
172 | }).attr('title', 'Run this cell and all cells below it'); |
|
169 | }).attr('title', 'Run this cell and all cells below it'); | |
173 | this.element.find('#to_code').click(function () { |
|
170 | this.element.find('#to_code').click(function () { | |
174 | IPython.notebook.to_code(); |
|
171 | IPython.notebook.to_code(); | |
175 | }); |
|
172 | }); | |
176 | this.element.find('#to_markdown').click(function () { |
|
173 | this.element.find('#to_markdown').click(function () { | |
177 | IPython.notebook.to_markdown(); |
|
174 | IPython.notebook.to_markdown(); | |
178 | }); |
|
175 | }); | |
179 | this.element.find('#to_raw').click(function () { |
|
176 | this.element.find('#to_raw').click(function () { | |
180 | IPython.notebook.to_raw(); |
|
177 | IPython.notebook.to_raw(); | |
181 | }); |
|
178 | }); | |
182 | this.element.find('#to_heading1').click(function () { |
|
179 | this.element.find('#to_heading1').click(function () { | |
183 | IPython.notebook.to_heading(undefined, 1); |
|
180 | IPython.notebook.to_heading(undefined, 1); | |
184 | }); |
|
181 | }); | |
185 | this.element.find('#to_heading2').click(function () { |
|
182 | this.element.find('#to_heading2').click(function () { | |
186 | IPython.notebook.to_heading(undefined, 2); |
|
183 | IPython.notebook.to_heading(undefined, 2); | |
187 | }); |
|
184 | }); | |
188 | this.element.find('#to_heading3').click(function () { |
|
185 | this.element.find('#to_heading3').click(function () { | |
189 | IPython.notebook.to_heading(undefined, 3); |
|
186 | IPython.notebook.to_heading(undefined, 3); | |
190 | }); |
|
187 | }); | |
191 | this.element.find('#to_heading4').click(function () { |
|
188 | this.element.find('#to_heading4').click(function () { | |
192 | IPython.notebook.to_heading(undefined, 4); |
|
189 | IPython.notebook.to_heading(undefined, 4); | |
193 | }); |
|
190 | }); | |
194 | this.element.find('#to_heading5').click(function () { |
|
191 | this.element.find('#to_heading5').click(function () { | |
195 | IPython.notebook.to_heading(undefined, 5); |
|
192 | IPython.notebook.to_heading(undefined, 5); | |
196 | }); |
|
193 | }); | |
197 | this.element.find('#to_heading6').click(function () { |
|
194 | this.element.find('#to_heading6').click(function () { | |
198 | IPython.notebook.to_heading(undefined, 6); |
|
195 | IPython.notebook.to_heading(undefined, 6); | |
199 | }); |
|
196 | }); | |
200 | this.element.find('#toggle_output').click(function () { |
|
197 | this.element.find('#toggle_output').click(function () { | |
201 | IPython.notebook.toggle_output(); |
|
198 | IPython.notebook.toggle_output(); | |
202 | }); |
|
199 | }); | |
203 | this.element.find('#collapse_all_output').click(function () { |
|
200 | this.element.find('#collapse_all_output').click(function () { | |
204 | IPython.notebook.collapse_all_output(); |
|
201 | IPython.notebook.collapse_all_output(); | |
205 | }); |
|
202 | }); | |
206 | this.element.find('#scroll_all_output').click(function () { |
|
203 | this.element.find('#scroll_all_output').click(function () { | |
207 | IPython.notebook.scroll_all_output(); |
|
204 | IPython.notebook.scroll_all_output(); | |
208 | }); |
|
205 | }); | |
209 | this.element.find('#expand_all_output').click(function () { |
|
206 | this.element.find('#expand_all_output').click(function () { | |
210 | IPython.notebook.expand_all_output(); |
|
207 | IPython.notebook.expand_all_output(); | |
211 | }); |
|
208 | }); | |
212 | this.element.find('#clear_all_output').click(function () { |
|
209 | this.element.find('#clear_all_output').click(function () { | |
213 | IPython.notebook.clear_all_output(); |
|
210 | IPython.notebook.clear_all_output(); | |
214 | }); |
|
211 | }); | |
215 | // Kernel |
|
212 | // Kernel | |
216 | this.element.find('#int_kernel').click(function () { |
|
213 | this.element.find('#int_kernel').click(function () { | |
217 | IPython.notebook.kernel.interrupt(); |
|
214 | IPython.notebook.kernel.interrupt(); | |
218 | }); |
|
215 | }); | |
219 | this.element.find('#restart_kernel').click(function () { |
|
216 | this.element.find('#restart_kernel').click(function () { | |
220 | IPython.notebook.restart_kernel(); |
|
217 | IPython.notebook.restart_kernel(); | |
221 | }); |
|
218 | }); | |
222 | // Help |
|
219 | // Help | |
223 | this.element.find('#keyboard_shortcuts').click(function () { |
|
220 | this.element.find('#keyboard_shortcuts').click(function () { | |
224 | IPython.quick_help.show_keyboard_shortcuts(); |
|
221 | IPython.quick_help.show_keyboard_shortcuts(); | |
225 | }); |
|
222 | }); | |
226 |
|
223 | |||
227 | this.update_restore_checkpoint(null); |
|
224 | this.update_restore_checkpoint(null); | |
228 |
|
225 | |||
229 | $([IPython.events]).on('checkpoints_listed.Notebook', function (event, data) { |
|
226 | $([IPython.events]).on('checkpoints_listed.Notebook', function (event, data) { | |
230 | that.update_restore_checkpoint(data); |
|
227 | that.update_restore_checkpoint(data); | |
231 | }); |
|
228 | }); | |
232 |
|
229 | |||
233 | $([IPython.events]).on('checkpoint_created.Notebook', function (event, data) { |
|
230 | $([IPython.events]).on('checkpoint_created.Notebook', function (event, data) { | |
234 | that.update_restore_checkpoint(data); |
|
231 | that.update_restore_checkpoint(data); | |
235 | }); |
|
232 | }); | |
236 | }; |
|
233 | }; | |
237 |
|
234 | |||
238 | MenuBar.prototype.update_restore_checkpoint = function(checkpoint) { |
|
235 | MenuBar.prototype.update_restore_checkpoint = function(checkpoint) { | |
239 | if (!checkpoint) { |
|
236 | if (!checkpoint) { | |
240 | this.element.find("#restore_checkpoint") |
|
237 | this.element.find("#restore_checkpoint") | |
241 | .addClass('ui-state-disabled') |
|
238 | .addClass('ui-state-disabled') | |
242 | .off('click') |
|
239 | .off('click') | |
243 | .find('a').text("Revert"); |
|
240 | .find('a').text("Revert"); | |
244 | return; |
|
241 | return; | |
245 | }; |
|
242 | }; | |
246 | var d = new Date(checkpoint.last_modified); |
|
243 | var d = new Date(checkpoint.last_modified); | |
247 | this.element.find("#restore_checkpoint") |
|
244 | this.element.find("#restore_checkpoint") | |
248 | .removeClass('ui-state-disabled') |
|
245 | .removeClass('ui-state-disabled') | |
249 | .off('click') |
|
246 | .off('click') | |
250 | .click(function () { |
|
247 | .click(function () { | |
251 | IPython.notebook.restore_checkpoint_dialog(); |
|
248 | IPython.notebook.restore_checkpoint_dialog(); | |
252 | }).find('a').html("Revert to: <br/>" + d.format("mmm dd HH:MM:ss")); |
|
249 | }).find('a').html("Revert to: <br/>" + d.format("mmm dd HH:MM:ss")); | |
253 | } |
|
250 | } | |
254 |
|
251 | |||
255 | IPython.MenuBar = MenuBar; |
|
252 | IPython.MenuBar = MenuBar; | |
256 |
|
253 | |||
257 | return IPython; |
|
254 | return IPython; | |
258 |
|
255 | |||
259 | }(IPython)); |
|
256 | }(IPython)); |
@@ -1,235 +1,234 b'' | |||||
1 | {% extends "page.html" %} |
|
1 | {% extends "page.html" %} | |
2 |
|
2 | |||
3 | {% block stylesheet %} |
|
3 | {% block stylesheet %} | |
4 |
|
4 | |||
5 | {% if mathjax_url %} |
|
5 | {% if mathjax_url %} | |
6 | <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML-full&delayStartupUntil=configured" charset="utf-8"></script> |
|
6 | <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML-full&delayStartupUntil=configured" charset="utf-8"></script> | |
7 | {% endif %} |
|
7 | {% endif %} | |
8 | <script type="text/javascript"> |
|
8 | <script type="text/javascript"> | |
9 | // MathJax disabled, set as null to distingish from *missing* MathJax, |
|
9 | // MathJax disabled, set as null to distingish from *missing* MathJax, | |
10 | // where it will be undefined, and should prompt a dialog later. |
|
10 | // where it will be undefined, and should prompt a dialog later. | |
11 | window.mathjax_url = "{{mathjax_url}}"; |
|
11 | window.mathjax_url = "{{mathjax_url}}"; | |
12 | </script> |
|
12 | </script> | |
13 |
|
13 | |||
14 | <link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}"> |
|
14 | <link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}"> | |
15 | <link rel="stylesheet" href="{{ static_url("css/codemirror-ipython.css") }}"> |
|
15 | <link rel="stylesheet" href="{{ static_url("css/codemirror-ipython.css") }}"> | |
16 |
|
16 | |||
17 | <link rel="stylesheet" href="{{ static_url("prettify/prettify.css") }}"/> |
|
17 | <link rel="stylesheet" href="{{ static_url("prettify/prettify.css") }}"/> | |
18 |
|
18 | |||
19 | <link rel="stylesheet" href="{{ static_url("css/celltoolbar.css") }}" type="text/css" /> |
|
19 | <link rel="stylesheet" href="{{ static_url("css/celltoolbar.css") }}" type="text/css" /> | |
20 |
|
20 | |||
21 | {{super()}} |
|
21 | {{super()}} | |
22 |
|
22 | |||
23 | {% endblock %} |
|
23 | {% endblock %} | |
24 |
|
24 | |||
25 | {% block params %} |
|
25 | {% block params %} | |
26 |
|
26 | |||
27 | data-project={{project}} |
|
27 | data-project={{project}} | |
28 | data-base-project-url={{base_project_url}} |
|
28 | data-base-project-url={{base_project_url}} | |
29 | data-base-kernel-url={{base_kernel_url}} |
|
29 | data-base-kernel-url={{base_kernel_url}} | |
30 | data-read-only={{read_only and not logged_in}} |
|
30 | data-read-only={{read_only and not logged_in}} | |
31 | data-notebook-id={{notebook_id}} |
|
31 | data-notebook-id={{notebook_id}} | |
32 | class="notebook_app" |
|
32 | class="notebook_app" | |
33 |
|
33 | |||
34 | {% endblock %} |
|
34 | {% endblock %} | |
35 |
|
35 | |||
36 |
|
36 | |||
37 | {% block header %} |
|
37 | {% block header %} | |
38 |
|
38 | |||
39 | <span id="save_widget"> |
|
39 | <span id="save_widget"> | |
40 | <span id="notebook_name"></span> |
|
40 | <span id="notebook_name"></span> | |
41 | <span id="save_status"></span> |
|
41 | <span id="save_status"></span> | |
42 | </span> |
|
42 | </span> | |
43 |
|
43 | |||
44 | {% endblock %} |
|
44 | {% endblock %} | |
45 |
|
45 | |||
46 |
|
46 | |||
47 | {% block site %} |
|
47 | {% block site %} | |
48 |
|
48 | |||
49 | <div id="menubar_container"> |
|
49 | <div id="menubar_container"> | |
50 | <div id="menubar"> |
|
50 | <div id="menubar"> | |
51 | <ul id="menus"> |
|
51 | <ul id="menus"> | |
52 | <li><a href="#">File</a> |
|
52 | <li><a href="#">File</a> | |
53 | <ul> |
|
53 | <ul> | |
54 | <li id="new_notebook"><a href="#">New</a></li> |
|
54 | <li id="new_notebook"><a href="#">New</a></li> | |
55 | <li id="open_notebook"><a href="#">Open...</a></li> |
|
55 | <li id="open_notebook"><a href="#">Open...</a></li> | |
56 | <hr/> |
|
56 | <hr/> | |
57 | <li id="copy_notebook"><a href="#">Make a Copy...</a></li> |
|
57 | <li id="copy_notebook"><a href="#">Make a Copy...</a></li> | |
58 | <li id="rename_notebook"><a href="#">Rename...</a></li> |
|
58 | <li id="rename_notebook"><a href="#">Rename...</a></li> | |
59 |
<li id="save_ |
|
59 | <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li> | |
60 | <li id="save_checkpoint"><a href="#">Save Checkpoint</a></li> |
|
|||
61 | <hr/> |
|
60 | <hr/> | |
62 | <li id="restore_checkpoint"><a href="#">Revert to Checkpoint</a></li> |
|
61 | <li id="restore_checkpoint"><a href="#">Revert to Checkpoint</a></li> | |
63 | <hr/> |
|
62 | <hr/> | |
64 | <li><a href="#">Download as</a> |
|
63 | <li><a href="#">Download as</a> | |
65 | <ul> |
|
64 | <ul> | |
66 | <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li> |
|
65 | <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li> | |
67 | <li id="download_py"><a href="#">Python (.py)</a></li> |
|
66 | <li id="download_py"><a href="#">Python (.py)</a></li> | |
68 | </ul> |
|
67 | </ul> | |
69 | </li> |
|
68 | </li> | |
70 | <!--<hr/> |
|
69 | <!--<hr/> | |
71 | <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li>--> |
|
70 | <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li>--> | |
72 | <hr/> |
|
71 | <hr/> | |
73 | <li id="kill_and_exit"><a href="#" >Close and halt</a></li> |
|
72 | <li id="kill_and_exit"><a href="#" >Close and halt</a></li> | |
74 | </ul> |
|
73 | </ul> | |
75 | </li> |
|
74 | </li> | |
76 | <li><a href="#">Edit</a> |
|
75 | <li><a href="#">Edit</a> | |
77 | <ul> |
|
76 | <ul> | |
78 | <li id="cut_cell"><a href="#">Cut Cell</a></li> |
|
77 | <li id="cut_cell"><a href="#">Cut Cell</a></li> | |
79 | <li id="copy_cell"><a href="#">Copy Cell</a></li> |
|
78 | <li id="copy_cell"><a href="#">Copy Cell</a></li> | |
80 | <li id="paste_cell_above" class="ui-state-disabled"><a href="#">Paste Cell Above</a></li> |
|
79 | <li id="paste_cell_above" class="ui-state-disabled"><a href="#">Paste Cell Above</a></li> | |
81 | <li id="paste_cell_below" class="ui-state-disabled"><a href="#">Paste Cell Below</a></li> |
|
80 | <li id="paste_cell_below" class="ui-state-disabled"><a href="#">Paste Cell Below</a></li> | |
82 | <li id="paste_cell_replace" class="ui-state-disabled"><a href="#">Paste Cell & Replace</a></li> |
|
81 | <li id="paste_cell_replace" class="ui-state-disabled"><a href="#">Paste Cell & Replace</a></li> | |
83 | <li id="delete_cell"><a href="#">Delete Cell</a></li> |
|
82 | <li id="delete_cell"><a href="#">Delete Cell</a></li> | |
84 | <li id="undelete_cell" class="ui-state-disabled"><a href="#">Undo Delete Cell</a></li> |
|
83 | <li id="undelete_cell" class="ui-state-disabled"><a href="#">Undo Delete Cell</a></li> | |
85 | <hr/> |
|
84 | <hr/> | |
86 | <li id="split_cell"><a href="#">Split Cell</a></li> |
|
85 | <li id="split_cell"><a href="#">Split Cell</a></li> | |
87 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> |
|
86 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> | |
88 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> |
|
87 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> | |
89 | <hr/> |
|
88 | <hr/> | |
90 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> |
|
89 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> | |
91 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> |
|
90 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> | |
92 | <hr/> |
|
91 | <hr/> | |
93 | <li id="select_previous"><a href="#">Select Previous Cell</a></li> |
|
92 | <li id="select_previous"><a href="#">Select Previous Cell</a></li> | |
94 | <li id="select_next"><a href="#">Select Next Cell</a></li> |
|
93 | <li id="select_next"><a href="#">Select Next Cell</a></li> | |
95 | </ul> |
|
94 | </ul> | |
96 | </li> |
|
95 | </li> | |
97 | <li><a href="#">View</a> |
|
96 | <li><a href="#">View</a> | |
98 | <ul> |
|
97 | <ul> | |
99 | <li id="toggle_header"><a href="#">Toggle Header</a></li> |
|
98 | <li id="toggle_header"><a href="#">Toggle Header</a></li> | |
100 | <li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li> |
|
99 | <li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li> | |
101 | </ul> |
|
100 | </ul> | |
102 | </li> |
|
101 | </li> | |
103 | <li><a href="#">Insert</a> |
|
102 | <li><a href="#">Insert</a> | |
104 | <ul> |
|
103 | <ul> | |
105 | <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li> |
|
104 | <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li> | |
106 | <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li> |
|
105 | <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li> | |
107 | </ul> |
|
106 | </ul> | |
108 | </li> |
|
107 | </li> | |
109 | <li><a href="#">Cell</a> |
|
108 | <li><a href="#">Cell</a> | |
110 | <ul> |
|
109 | <ul> | |
111 | <li id="run_cell"><a href="#">Run</a></li> |
|
110 | <li id="run_cell"><a href="#">Run</a></li> | |
112 | <li id="run_cell_in_place"><a href="#">Run in Place</a></li> |
|
111 | <li id="run_cell_in_place"><a href="#">Run in Place</a></li> | |
113 | <li id="run_all_cells"><a href="#">Run All</a></li> |
|
112 | <li id="run_all_cells"><a href="#">Run All</a></li> | |
114 | <li id="run_all_cells_above"><a href="#">Run All Above</a></li> |
|
113 | <li id="run_all_cells_above"><a href="#">Run All Above</a></li> | |
115 | <li id="run_all_cells_below"><a href="#">Run All Below</a></li> |
|
114 | <li id="run_all_cells_below"><a href="#">Run All Below</a></li> | |
116 | <hr/> |
|
115 | <hr/> | |
117 | <li id="to_code"><a href="#">Code</a></li> |
|
116 | <li id="to_code"><a href="#">Code</a></li> | |
118 | <li id="to_markdown"><a href="#">Markdown </a></li> |
|
117 | <li id="to_markdown"><a href="#">Markdown </a></li> | |
119 | <li id="to_raw"><a href="#">Raw Text</a></li> |
|
118 | <li id="to_raw"><a href="#">Raw Text</a></li> | |
120 | <li id="to_heading1"><a href="#">Heading 1</a></li> |
|
119 | <li id="to_heading1"><a href="#">Heading 1</a></li> | |
121 | <li id="to_heading2"><a href="#">Heading 2</a></li> |
|
120 | <li id="to_heading2"><a href="#">Heading 2</a></li> | |
122 | <li id="to_heading3"><a href="#">Heading 3</a></li> |
|
121 | <li id="to_heading3"><a href="#">Heading 3</a></li> | |
123 | <li id="to_heading4"><a href="#">Heading 4</a></li> |
|
122 | <li id="to_heading4"><a href="#">Heading 4</a></li> | |
124 | <li id="to_heading5"><a href="#">Heading 5</a></li> |
|
123 | <li id="to_heading5"><a href="#">Heading 5</a></li> | |
125 | <li id="to_heading6"><a href="#">Heading 6</a></li> |
|
124 | <li id="to_heading6"><a href="#">Heading 6</a></li> | |
126 | <hr/> |
|
125 | <hr/> | |
127 | <li id="toggle_output"><a href="#">Toggle Current Output</a></li> |
|
126 | <li id="toggle_output"><a href="#">Toggle Current Output</a></li> | |
128 | <li id="all_outputs"><a href="#">All Output</a> |
|
127 | <li id="all_outputs"><a href="#">All Output</a> | |
129 | <ul> |
|
128 | <ul> | |
130 | <li id="expand_all_output"><a href="#">Expand</a></li> |
|
129 | <li id="expand_all_output"><a href="#">Expand</a></li> | |
131 | <li id="scroll_all_output"><a href="#">Scroll Long</a></li> |
|
130 | <li id="scroll_all_output"><a href="#">Scroll Long</a></li> | |
132 | <li id="collapse_all_output"><a href="#">Collapse</a></li> |
|
131 | <li id="collapse_all_output"><a href="#">Collapse</a></li> | |
133 | <li id="clear_all_output"><a href="#">Clear</a></li> |
|
132 | <li id="clear_all_output"><a href="#">Clear</a></li> | |
134 | </ul> |
|
133 | </ul> | |
135 | </li> |
|
134 | </li> | |
136 | </ul> |
|
135 | </ul> | |
137 | </li> |
|
136 | </li> | |
138 | <li><a href="#">Kernel</a> |
|
137 | <li><a href="#">Kernel</a> | |
139 | <ul> |
|
138 | <ul> | |
140 | <li id="int_kernel"><a href="#">Interrupt</a></li> |
|
139 | <li id="int_kernel"><a href="#">Interrupt</a></li> | |
141 | <li id="restart_kernel"><a href="#">Restart</a></li> |
|
140 | <li id="restart_kernel"><a href="#">Restart</a></li> | |
142 | </ul> |
|
141 | </ul> | |
143 | </li> |
|
142 | </li> | |
144 | <li><a href="#">Help</a> |
|
143 | <li><a href="#">Help</a> | |
145 | <ul> |
|
144 | <ul> | |
146 | <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li> |
|
145 | <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li> | |
147 | <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li> |
|
146 | <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li> | |
148 | <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li> |
|
147 | <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li> | |
149 | <hr/> |
|
148 | <hr/> | |
150 | <li><a href="http://docs.python.org" target="_blank">Python</a></li> |
|
149 | <li><a href="http://docs.python.org" target="_blank">Python</a></li> | |
151 | <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li> |
|
150 | <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li> | |
152 | <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li> |
|
151 | <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li> | |
153 | <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li> |
|
152 | <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li> | |
154 | <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li> |
|
153 | <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li> | |
155 | </ul> |
|
154 | </ul> | |
156 | </li> |
|
155 | </li> | |
157 | </ul> |
|
156 | </ul> | |
158 |
|
157 | |||
159 | </div> |
|
158 | </div> | |
160 | <div id="notification_area"> |
|
159 | <div id="notification_area"> | |
161 | </div> |
|
160 | </div> | |
162 | </div> |
|
161 | </div> | |
163 |
|
162 | |||
164 |
|
163 | |||
165 | <div id="maintoolbar"></div> |
|
164 | <div id="maintoolbar"></div> | |
166 |
|
165 | |||
167 | <div id="ipython-main-app"> |
|
166 | <div id="ipython-main-app"> | |
168 |
|
167 | |||
169 | <div id="notebook_panel"> |
|
168 | <div id="notebook_panel"> | |
170 | <div id="notebook"></div> |
|
169 | <div id="notebook"></div> | |
171 | <div id="pager_splitter"></div> |
|
170 | <div id="pager_splitter"></div> | |
172 | <div id="pager_container"> |
|
171 | <div id="pager_container"> | |
173 | <div id='pager_button_area'> |
|
172 | <div id='pager_button_area'> | |
174 | </div> |
|
173 | </div> | |
175 | <div id="pager"></div> |
|
174 | <div id="pager"></div> | |
176 | </div> |
|
175 | </div> | |
177 | </div> |
|
176 | </div> | |
178 |
|
177 | |||
179 | </div> |
|
178 | </div> | |
180 | <div id='tooltip' class='ipython_tooltip' style='display:none'></div> |
|
179 | <div id='tooltip' class='ipython_tooltip' style='display:none'></div> | |
181 |
|
180 | |||
182 |
|
181 | |||
183 | {% endblock %} |
|
182 | {% endblock %} | |
184 |
|
183 | |||
185 |
|
184 | |||
186 | {% block script %} |
|
185 | {% block script %} | |
187 |
|
186 | |||
188 | {{super()}} |
|
187 | {{super()}} | |
189 |
|
188 | |||
190 | <script src="{{ static_url("components/codemirror/lib/codemirror.js") }}" charset="utf-8"></script> |
|
189 | <script src="{{ static_url("components/codemirror/lib/codemirror.js") }}" charset="utf-8"></script> | |
191 | <script src="{{ static_url("components/codemirror/addon/mode/loadmode.js") }}" charset="utf-8"></script> |
|
190 | <script src="{{ static_url("components/codemirror/addon/mode/loadmode.js") }}" charset="utf-8"></script> | |
192 | <script src="{{ static_url("components/codemirror/addon/mode/multiplex.js") }}" charset="utf-8"></script> |
|
191 | <script src="{{ static_url("components/codemirror/addon/mode/multiplex.js") }}" charset="utf-8"></script> | |
193 | <script src="{{ static_url("js/codemirror-ipython.js") }}" charset="utf-8"></script> |
|
192 | <script src="{{ static_url("js/codemirror-ipython.js") }}" charset="utf-8"></script> | |
194 | <script src="{{ static_url("components/codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> |
|
193 | <script src="{{ static_url("components/codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> | |
195 | <script src="{{ static_url("components/codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> |
|
194 | <script src="{{ static_url("components/codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> | |
196 | <script src="{{ static_url("components/codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> |
|
195 | <script src="{{ static_url("components/codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> | |
197 | <script src="{{ static_url("components/codemirror/mode/css/css.js") }}" charset="utf-8"></script> |
|
196 | <script src="{{ static_url("components/codemirror/mode/css/css.js") }}" charset="utf-8"></script> | |
198 | <script src="{{ static_url("components/codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> |
|
197 | <script src="{{ static_url("components/codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> | |
199 | <script src="{{ static_url("components/codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> |
|
198 | <script src="{{ static_url("components/codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> | |
200 |
|
199 | |||
201 | <script src="{{ static_url("pagedown/Markdown.Converter.js") }}" charset="utf-8"></script> |
|
200 | <script src="{{ static_url("pagedown/Markdown.Converter.js") }}" charset="utf-8"></script> | |
202 |
|
201 | |||
203 | <script src="{{ static_url("prettify/prettify.js") }}" charset="utf-8"></script> |
|
202 | <script src="{{ static_url("prettify/prettify.js") }}" charset="utf-8"></script> | |
204 | <script src="{{ static_url("dateformat/date.format.js") }}" charset="utf-8"></script> |
|
203 | <script src="{{ static_url("dateformat/date.format.js") }}" charset="utf-8"></script> | |
205 |
|
204 | |||
206 | <script src="{{ static_url("js/events.js") }}" type="text/javascript" charset="utf-8"></script> |
|
205 | <script src="{{ static_url("js/events.js") }}" type="text/javascript" charset="utf-8"></script> | |
207 | <script src="{{ static_url("js/utils.js") }}" type="text/javascript" charset="utf-8"></script> |
|
206 | <script src="{{ static_url("js/utils.js") }}" type="text/javascript" charset="utf-8"></script> | |
208 | <script src="{{ static_url("js/layoutmanager.js") }}" type="text/javascript" charset="utf-8"></script> |
|
207 | <script src="{{ static_url("js/layoutmanager.js") }}" type="text/javascript" charset="utf-8"></script> | |
209 | <script src="{{ static_url("js/mathjaxutils.js") }}" type="text/javascript" charset="utf-8"></script> |
|
208 | <script src="{{ static_url("js/mathjaxutils.js") }}" type="text/javascript" charset="utf-8"></script> | |
210 | <script src="{{ static_url("js/outputarea.js") }}" type="text/javascript" charset="utf-8"></script> |
|
209 | <script src="{{ static_url("js/outputarea.js") }}" type="text/javascript" charset="utf-8"></script> | |
211 | <script src="{{ static_url("js/cell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
210 | <script src="{{ static_url("js/cell.js") }}" type="text/javascript" charset="utf-8"></script> | |
212 | <script src="{{ static_url("js/celltoolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
211 | <script src="{{ static_url("js/celltoolbar.js") }}" type="text/javascript" charset="utf-8"></script> | |
213 | <script src="{{ static_url("js/codecell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
212 | <script src="{{ static_url("js/codecell.js") }}" type="text/javascript" charset="utf-8"></script> | |
214 | <script src="{{ static_url("js/completer.js") }}" type="text/javascript" charset="utf-8"></script> |
|
213 | <script src="{{ static_url("js/completer.js") }}" type="text/javascript" charset="utf-8"></script> | |
215 | <script src="{{ static_url("js/textcell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
214 | <script src="{{ static_url("js/textcell.js") }}" type="text/javascript" charset="utf-8"></script> | |
216 | <script src="{{ static_url("js/kernel.js") }}" type="text/javascript" charset="utf-8"></script> |
|
215 | <script src="{{ static_url("js/kernel.js") }}" type="text/javascript" charset="utf-8"></script> | |
217 | <script src="{{ static_url("js/savewidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
216 | <script src="{{ static_url("js/savewidget.js") }}" type="text/javascript" charset="utf-8"></script> | |
218 | <script src="{{ static_url("js/quickhelp.js") }}" type="text/javascript" charset="utf-8"></script> |
|
217 | <script src="{{ static_url("js/quickhelp.js") }}" type="text/javascript" charset="utf-8"></script> | |
219 | <script src="{{ static_url("js/pager.js") }}" type="text/javascript" charset="utf-8"></script> |
|
218 | <script src="{{ static_url("js/pager.js") }}" type="text/javascript" charset="utf-8"></script> | |
220 | <script src="{{ static_url("js/menubar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
219 | <script src="{{ static_url("js/menubar.js") }}" type="text/javascript" charset="utf-8"></script> | |
221 | <script src="{{ static_url("js/toolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
220 | <script src="{{ static_url("js/toolbar.js") }}" type="text/javascript" charset="utf-8"></script> | |
222 | <script src="{{ static_url("js/maintoolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
221 | <script src="{{ static_url("js/maintoolbar.js") }}" type="text/javascript" charset="utf-8"></script> | |
223 | <script src="{{ static_url("js/notebook.js") }}" type="text/javascript" charset="utf-8"></script> |
|
222 | <script src="{{ static_url("js/notebook.js") }}" type="text/javascript" charset="utf-8"></script> | |
224 | <script src="{{ static_url("js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
223 | <script src="{{ static_url("js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script> | |
225 | <script src="{{ static_url("js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script> |
|
224 | <script src="{{ static_url("js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script> | |
226 | <script src="{{ static_url("js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script> |
|
225 | <script src="{{ static_url("js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script> | |
227 | <script src="{{ static_url("js/config.js") }}" type="text/javascript" charset="utf-8"></script> |
|
226 | <script src="{{ static_url("js/config.js") }}" type="text/javascript" charset="utf-8"></script> | |
228 | <script src="{{ static_url("js/notebookmain.js") }}" type="text/javascript" charset="utf-8"></script> |
|
227 | <script src="{{ static_url("js/notebookmain.js") }}" type="text/javascript" charset="utf-8"></script> | |
229 |
|
228 | |||
230 | <script src="{{ static_url("js/contexthint.js") }}" charset="utf-8"></script> |
|
229 | <script src="{{ static_url("js/contexthint.js") }}" charset="utf-8"></script> | |
231 |
|
230 | |||
232 | <script src="{{ static_url("js/celltoolbarpresets/default.js") }}" type="text/javascript" charset="utf-8"></script> |
|
231 | <script src="{{ static_url("js/celltoolbarpresets/default.js") }}" type="text/javascript" charset="utf-8"></script> | |
233 | <script src="{{ static_url("js/celltoolbarpresets/slideshow.js") }}" type="text/javascript" charset="utf-8"></script> |
|
232 | <script src="{{ static_url("js/celltoolbarpresets/slideshow.js") }}" type="text/javascript" charset="utf-8"></script> | |
234 |
|
233 | |||
235 | {% endblock %} |
|
234 | {% endblock %} |
General Comments 0
You need to be logged in to leave comments.
Login now