Show More
@@ -0,0 +1,179 b'' | |||||
|
1 | //---------------------------------------------------------------------------- | |||
|
2 | // Copyright (C) 2011 The IPython Development Team | |||
|
3 | // | |||
|
4 | // Distributed under the terms of the BSD License. The full license is in | |||
|
5 | // the file COPYING, distributed as part of this software. | |||
|
6 | //---------------------------------------------------------------------------- | |||
|
7 | ||||
|
8 | //============================================================================ | |||
|
9 | // ToolBar | |||
|
10 | //============================================================================ | |||
|
11 | ||||
|
12 | var IPython = (function (IPython) { | |||
|
13 | ||||
|
14 | var MainToolBar = function (selector) { | |||
|
15 | this.selector = selector; | |||
|
16 | IPython.ToolBar.apply(this, arguments); | |||
|
17 | this.construct(); | |||
|
18 | this.add_drop_down_list(); | |||
|
19 | this.bind_events(); | |||
|
20 | }; | |||
|
21 | ||||
|
22 | MainToolBar.prototype = new IPython.ToolBar(); | |||
|
23 | ||||
|
24 | MainToolBar.prototype.construct = function () { | |||
|
25 | this.add_buttons_group([ | |||
|
26 | { | |||
|
27 | id : 'save_b', | |||
|
28 | label : 'Save', | |||
|
29 | icon : 'ui-icon-disk', | |||
|
30 | callback : function () { | |||
|
31 | IPython.notebook.save_notebook(); | |||
|
32 | } | |||
|
33 | } | |||
|
34 | ]); | |||
|
35 | this.add_buttons_group([ | |||
|
36 | { | |||
|
37 | id : 'cut_b', | |||
|
38 | label : 'Cut Cell', | |||
|
39 | icon : 'ui-icon-scissors', | |||
|
40 | callback : function () { | |||
|
41 | IPython.notebook.cut_cell(); | |||
|
42 | } | |||
|
43 | }, | |||
|
44 | { | |||
|
45 | id : 'copy_b', | |||
|
46 | label : 'Copy Cell', | |||
|
47 | icon : 'ui-icon-copy', | |||
|
48 | callback : function () { | |||
|
49 | IPython.notebook.copy_cell(); | |||
|
50 | } | |||
|
51 | }, | |||
|
52 | { | |||
|
53 | id : 'paste_b', | |||
|
54 | label : 'Paste Cell', | |||
|
55 | icon : 'ui-icon-clipboard', | |||
|
56 | callback : function () { | |||
|
57 | IPython.notebook.paste_cell(); | |||
|
58 | } | |||
|
59 | } | |||
|
60 | ],'cut_copy_paste'); | |||
|
61 | ||||
|
62 | this.add_buttons_group([ | |||
|
63 | { | |||
|
64 | id : 'move_up_b', | |||
|
65 | label : 'Move Cell Up', | |||
|
66 | icon : 'ui-icon-arrowthick-1-n', | |||
|
67 | callback : function () { | |||
|
68 | IPython.notebook.move_cell_up(); | |||
|
69 | } | |||
|
70 | }, | |||
|
71 | { | |||
|
72 | id : 'move_down_b', | |||
|
73 | label : 'Move Cell Down', | |||
|
74 | icon : 'ui-icon-arrowthick-1-s', | |||
|
75 | callback : function () { | |||
|
76 | IPython.notebook.move_cell_down(); | |||
|
77 | } | |||
|
78 | } | |||
|
79 | ],'move_up_down'); | |||
|
80 | ||||
|
81 | this.add_buttons_group([ | |||
|
82 | { | |||
|
83 | id : 'insert_above_b', | |||
|
84 | label : 'Insert Cell Above', | |||
|
85 | icon : 'ui-icon-arrowthickstop-1-n', | |||
|
86 | callback : function () { | |||
|
87 | IPython.notebook.insert_cell_above('code'); | |||
|
88 | } | |||
|
89 | }, | |||
|
90 | { | |||
|
91 | id : 'insert_below_b', | |||
|
92 | label : 'Insert Cell Below', | |||
|
93 | icon : 'ui-icon-arrowthickstop-1-s', | |||
|
94 | callback : function () { | |||
|
95 | IPython.notebook.insert_cell_below('code'); | |||
|
96 | } | |||
|
97 | } | |||
|
98 | ],'insert_above_below'); | |||
|
99 | ||||
|
100 | this.add_buttons_group([ | |||
|
101 | { | |||
|
102 | id : 'run_b', | |||
|
103 | label : 'Run Cell', | |||
|
104 | icon : 'ui-icon-play', | |||
|
105 | callback : function () { | |||
|
106 | IPython.notebook.execute_selected_cell(); | |||
|
107 | } | |||
|
108 | }, | |||
|
109 | { | |||
|
110 | id : 'interrupt_b', | |||
|
111 | label : 'Interrupt', | |||
|
112 | icon : 'ui-icon-stop', | |||
|
113 | callback : function () { | |||
|
114 | IPython.notebook.kernel.interrupt(); | |||
|
115 | } | |||
|
116 | } | |||
|
117 | ],'run_int'); | |||
|
118 | ||||
|
119 | ||||
|
120 | }; | |||
|
121 | ||||
|
122 | MainToolBar.prototype.add_drop_down_list = function () { | |||
|
123 | var select = $(this.selector) | |||
|
124 | .append($('<select/>') | |||
|
125 | .attr('id','cell_type') | |||
|
126 | .addClass('ui-widget ui-widget-content') | |||
|
127 | .append($('<option/>').attr('value','code').text('Code')) | |||
|
128 | .append($('<option/>').attr('value','markdown').text('Markdown')) | |||
|
129 | .append($('<option/>').attr('value','raw').text('Raw Text')) | |||
|
130 | .append($('<option/>').attr('value','heading1').text('Heading 1')) | |||
|
131 | .append($('<option/>').attr('value','heading2').text('Heading 2')) | |||
|
132 | .append($('<option/>').attr('value','heading3').text('Heading 3')) | |||
|
133 | .append($('<option/>').attr('value','heading4').text('Heading 4')) | |||
|
134 | .append($('<option/>').attr('value','heading5').text('Heading 5')) | |||
|
135 | .append($('<option/>').attr('value','heading6').text('Heading 6')) | |||
|
136 | .append($('<option/>').attr('value','heading7').text('Heading 7')) | |||
|
137 | .append($('<option/>').attr('value','heading8').text('Heading 8')) | |||
|
138 | ); | |||
|
139 | }; | |||
|
140 | ||||
|
141 | MainToolBar.prototype.bind_events = function () { | |||
|
142 | var that = this; | |||
|
143 | ||||
|
144 | this.element.find('#cell_type').change(function () { | |||
|
145 | var cell_type = $(this).val(); | |||
|
146 | if (cell_type === 'code') { | |||
|
147 | IPython.notebook.to_code(); | |||
|
148 | } else if (cell_type === 'markdown') { | |||
|
149 | IPython.notebook.to_markdown(); | |||
|
150 | } else if (cell_type === 'raw') { | |||
|
151 | IPython.notebook.to_raw(); | |||
|
152 | } else if (cell_type === 'heading1') { | |||
|
153 | IPython.notebook.to_heading(undefined, 1); | |||
|
154 | } else if (cell_type === 'heading2') { | |||
|
155 | IPython.notebook.to_heading(undefined, 2); | |||
|
156 | } else if (cell_type === 'heading3') { | |||
|
157 | IPython.notebook.to_heading(undefined, 3); | |||
|
158 | } else if (cell_type === 'heading4') { | |||
|
159 | IPython.notebook.to_heading(undefined, 4); | |||
|
160 | } else if (cell_type === 'heading5') { | |||
|
161 | IPython.notebook.to_heading(undefined, 5); | |||
|
162 | } else if (cell_type === 'heading6') { | |||
|
163 | IPython.notebook.to_heading(undefined, 6); | |||
|
164 | } | |||
|
165 | }); | |||
|
166 | $([IPython.events]).on('selected_cell_type_changed.Notebook', function (event, data) { | |||
|
167 | if (data.cell_type === 'heading') { | |||
|
168 | that.element.find('#cell_type').val(data.cell_type+data.level); | |||
|
169 | } else { | |||
|
170 | that.element.find('#cell_type').val(data.cell_type); | |||
|
171 | } | |||
|
172 | }); | |||
|
173 | }; | |||
|
174 | ||||
|
175 | IPython.MainToolBar = MainToolBar; | |||
|
176 | ||||
|
177 | return IPython; | |||
|
178 | ||||
|
179 | }(IPython)); |
@@ -1,408 +1,408 b'' | |||||
1 | /** |
|
1 | /** | |
2 | * Primary styles |
|
2 | * Primary styles | |
3 | * |
|
3 | * | |
4 | * Author: IPython Development Team |
|
4 | * Author: IPython Development Team | |
5 | */ |
|
5 | */ | |
6 |
|
6 | |||
7 |
|
7 | |||
8 | body { |
|
8 | body { | |
9 | overflow: hidden; |
|
9 | overflow: hidden; | |
10 | } |
|
10 | } | |
11 |
|
11 | |||
12 | span#save_widget { |
|
12 | span#save_widget { | |
13 | padding: 5px; |
|
13 | padding: 5px; | |
14 | margin: 0px 0px 0px 300px; |
|
14 | margin: 0px 0px 0px 300px; | |
15 | display:inline-block; |
|
15 | display:inline-block; | |
16 | } |
|
16 | } | |
17 |
|
17 | |||
18 | span#notebook_name { |
|
18 | span#notebook_name { | |
19 | height: 1em; |
|
19 | height: 1em; | |
20 | line-height: 1em; |
|
20 | line-height: 1em; | |
21 | padding: 3px; |
|
21 | padding: 3px; | |
22 | border: none; |
|
22 | border: none; | |
23 | font-size: 146.5%; |
|
23 | font-size: 146.5%; | |
24 | } |
|
24 | } | |
25 |
|
25 | |||
26 | .ui-menubar-item .ui-button .ui-button-text { |
|
26 | .ui-menubar-item .ui-button .ui-button-text { | |
27 | padding: 0.4em 1.0em; |
|
27 | padding: 0.4em 1.0em; | |
28 | font-size: 100%; |
|
28 | font-size: 100%; | |
29 | } |
|
29 | } | |
30 |
|
30 | |||
31 | .ui-menu { |
|
31 | .ui-menu { | |
32 | -moz-box-shadow: 0px 6px 10px -1px #adadad; |
|
32 | -moz-box-shadow: 0px 6px 10px -1px #adadad; | |
33 | -webkit-box-shadow: 0px 6px 10px -1px #adadad; |
|
33 | -webkit-box-shadow: 0px 6px 10px -1px #adadad; | |
34 | box-shadow: 0px 6px 10px -1px #adadad; |
|
34 | box-shadow: 0px 6px 10px -1px #adadad; | |
35 | } |
|
35 | } | |
36 |
|
36 | |||
37 | .ui-menu .ui-menu-item a { |
|
37 | .ui-menu .ui-menu-item a { | |
38 | border: 1px solid transparent; |
|
38 | border: 1px solid transparent; | |
39 | padding: 2px 1.6em; |
|
39 | padding: 2px 1.6em; | |
40 | } |
|
40 | } | |
41 |
|
41 | |||
42 | .ui-menu .ui-menu-item a.ui-state-focus { |
|
42 | .ui-menu .ui-menu-item a.ui-state-focus { | |
43 | margin: 0; |
|
43 | margin: 0; | |
44 | } |
|
44 | } | |
45 |
|
45 | |||
46 | .ui-menu hr { |
|
46 | .ui-menu hr { | |
47 | margin: 0.3em 0; |
|
47 | margin: 0.3em 0; | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | #menubar_container { |
|
50 | #menubar_container { | |
51 | position: relative; |
|
51 | position: relative; | |
52 | } |
|
52 | } | |
53 |
|
53 | |||
54 | #notification_area { |
|
54 | #notification_area { | |
55 | position: absolute; |
|
55 | position: absolute; | |
56 | right: 0px; |
|
56 | right: 0px; | |
57 | top: 0px; |
|
57 | top: 0px; | |
58 | height: 25px; |
|
58 | height: 25px; | |
59 | padding: 3px 0px; |
|
59 | padding: 3px 0px; | |
60 | padding-right: 3px; |
|
60 | padding-right: 3px; | |
61 | z-index: 10; |
|
61 | z-index: 10; | |
62 | } |
|
62 | } | |
63 |
|
63 | |||
64 | .notification_widget{ |
|
64 | .notification_widget{ | |
65 | float : right; |
|
65 | float : right; | |
66 | right: 0px; |
|
66 | right: 0px; | |
67 | top: 1px; |
|
67 | top: 1px; | |
68 | height: 25px; |
|
68 | height: 25px; | |
69 | padding: 3px 6px; |
|
69 | padding: 3px 6px; | |
70 | z-index: 10; |
|
70 | z-index: 10; | |
71 | } |
|
71 | } | |
72 |
|
72 | |||
73 |
|
|
73 | .toolbar { | |
74 | padding: 3px 15px; |
|
74 | padding: 3px 15px; | |
75 | } |
|
75 | } | |
76 |
|
76 | |||
77 | #cell_type { |
|
77 | #cell_type { | |
78 | font-size: 85%; |
|
78 | font-size: 85%; | |
79 | } |
|
79 | } | |
80 |
|
80 | |||
81 |
|
81 | |||
82 | div#main_app { |
|
82 | div#main_app { | |
83 | width: 100%; |
|
83 | width: 100%; | |
84 | position: relative; |
|
84 | position: relative; | |
85 | } |
|
85 | } | |
86 |
|
86 | |||
87 | span#quick_help_area { |
|
87 | span#quick_help_area { | |
88 | position: static; |
|
88 | position: static; | |
89 | padding: 5px 0px; |
|
89 | padding: 5px 0px; | |
90 | margin: 0px 0px 0px 0px; |
|
90 | margin: 0px 0px 0px 0px; | |
91 | } |
|
91 | } | |
92 |
|
92 | |||
93 | .help_string { |
|
93 | .help_string { | |
94 | float: right; |
|
94 | float: right; | |
95 | width: 170px; |
|
95 | width: 170px; | |
96 | padding: 0px 5px; |
|
96 | padding: 0px 5px; | |
97 | text-align: left; |
|
97 | text-align: left; | |
98 | font-size: 85%; |
|
98 | font-size: 85%; | |
99 | } |
|
99 | } | |
100 |
|
100 | |||
101 | .help_string_label { |
|
101 | .help_string_label { | |
102 | float: right; |
|
102 | float: right; | |
103 | font-size: 85%; |
|
103 | font-size: 85%; | |
104 | } |
|
104 | } | |
105 |
|
105 | |||
106 | div#notebook_panel { |
|
106 | div#notebook_panel { | |
107 | margin: 0px 0px 0px 0px; |
|
107 | margin: 0px 0px 0px 0px; | |
108 | padding: 0px; |
|
108 | padding: 0px; | |
109 | } |
|
109 | } | |
110 |
|
110 | |||
111 | div#notebook { |
|
111 | div#notebook { | |
112 | overflow-y: scroll; |
|
112 | overflow-y: scroll; | |
113 | overflow-x: auto; |
|
113 | overflow-x: auto; | |
114 | width: 100%; |
|
114 | width: 100%; | |
115 | /* This spaces the cell away from the edge of the notebook area */ |
|
115 | /* This spaces the cell away from the edge of the notebook area */ | |
116 | padding: 5px 5px 15px 5px; |
|
116 | padding: 5px 5px 15px 5px; | |
117 | margin: 0px; |
|
117 | margin: 0px; | |
118 | background-color: white; |
|
118 | background-color: white; | |
119 | } |
|
119 | } | |
120 |
|
120 | |||
121 | div#pager_splitter { |
|
121 | div#pager_splitter { | |
122 | height: 8px; |
|
122 | height: 8px; | |
123 | } |
|
123 | } | |
124 |
|
124 | |||
125 | #pager_container { |
|
125 | #pager_container { | |
126 | position : relative; |
|
126 | position : relative; | |
127 | } |
|
127 | } | |
128 |
|
128 | |||
129 | div#pager { |
|
129 | div#pager { | |
130 | padding: 15px; |
|
130 | padding: 15px; | |
131 | overflow: auto; |
|
131 | overflow: auto; | |
132 | display: none; |
|
132 | display: none; | |
133 | } |
|
133 | } | |
134 |
|
134 | |||
135 | div.ui-widget-content { |
|
135 | div.ui-widget-content { | |
136 | border: 1px solid #aaa; |
|
136 | border: 1px solid #aaa; | |
137 | outline: none; |
|
137 | outline: none; | |
138 | } |
|
138 | } | |
139 |
|
139 | |||
140 | .cell { |
|
140 | .cell { | |
141 | border: 1px solid transparent; |
|
141 | border: 1px solid transparent; | |
142 | } |
|
142 | } | |
143 |
|
143 | |||
144 | div.cell { |
|
144 | div.cell { | |
145 | width: 100%; |
|
145 | width: 100%; | |
146 | padding: 5px 5px 5px 0px; |
|
146 | padding: 5px 5px 5px 0px; | |
147 | /* This acts as a spacer between cells, that is outside the border */ |
|
147 | /* This acts as a spacer between cells, that is outside the border */ | |
148 | margin: 2px 0px 2px 0px; |
|
148 | margin: 2px 0px 2px 0px; | |
149 | } |
|
149 | } | |
150 |
|
150 | |||
151 | div.code_cell { |
|
151 | div.code_cell { | |
152 | background-color: white; |
|
152 | background-color: white; | |
153 | } |
|
153 | } | |
154 |
|
154 | |||
155 | /* any special styling for code cells that are currently running goes here */ |
|
155 | /* any special styling for code cells that are currently running goes here */ | |
156 | div.code_cell.running { |
|
156 | div.code_cell.running { | |
157 | } |
|
157 | } | |
158 |
|
158 | |||
159 | div.prompt { |
|
159 | div.prompt { | |
160 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ |
|
160 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ | |
161 | width: 11ex; |
|
161 | width: 11ex; | |
162 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ |
|
162 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ | |
163 | padding: 0.4em; |
|
163 | padding: 0.4em; | |
164 | margin: 0px; |
|
164 | margin: 0px; | |
165 | font-family: monospace; |
|
165 | font-family: monospace; | |
166 | text-align:right; |
|
166 | text-align:right; | |
167 | } |
|
167 | } | |
168 |
|
168 | |||
169 | div.input { |
|
169 | div.input { | |
170 | page-break-inside: avoid; |
|
170 | page-break-inside: avoid; | |
171 | } |
|
171 | } | |
172 |
|
172 | |||
173 | /* input_area and input_prompt must match in top border and margin for alignment */ |
|
173 | /* input_area and input_prompt must match in top border and margin for alignment */ | |
174 | div.input_area { |
|
174 | div.input_area { | |
175 | color: black; |
|
175 | color: black; | |
176 | border: 1px solid #ddd; |
|
176 | border: 1px solid #ddd; | |
177 | border-radius: 3px; |
|
177 | border-radius: 3px; | |
178 | background: #f7f7f7; |
|
178 | background: #f7f7f7; | |
179 | } |
|
179 | } | |
180 |
|
180 | |||
181 | div.input_prompt { |
|
181 | div.input_prompt { | |
182 | color: navy; |
|
182 | color: navy; | |
183 | border-top: 1px solid transparent; |
|
183 | border-top: 1px solid transparent; | |
184 | } |
|
184 | } | |
185 |
|
185 | |||
186 | div.output_wrapper { |
|
186 | div.output_wrapper { | |
187 | /* This is a spacer between the input and output of each cell */ |
|
187 | /* This is a spacer between the input and output of each cell */ | |
188 | margin-top: 5px; |
|
188 | margin-top: 5px; | |
189 | margin-left: 5px; |
|
189 | margin-left: 5px; | |
190 | /* FF needs explicit width to stretch */ |
|
190 | /* FF needs explicit width to stretch */ | |
191 | width: 100%; |
|
191 | width: 100%; | |
192 | /* this position must be relative to enable descendents to be absolute within it */ |
|
192 | /* this position must be relative to enable descendents to be absolute within it */ | |
193 | position: relative; |
|
193 | position: relative; | |
194 | } |
|
194 | } | |
195 |
|
195 | |||
196 | /* class for the output area when it should be height-limited */ |
|
196 | /* class for the output area when it should be height-limited */ | |
197 | div.output_scroll { |
|
197 | div.output_scroll { | |
198 | /* ideally, this would be max-height, but FF barfs all over that */ |
|
198 | /* ideally, this would be max-height, but FF barfs all over that */ | |
199 | height: 24em; |
|
199 | height: 24em; | |
200 | /* FF needs this *and the wrapper* to specify full width, or it will shrinkwrap */ |
|
200 | /* FF needs this *and the wrapper* to specify full width, or it will shrinkwrap */ | |
201 | width: 100%; |
|
201 | width: 100%; | |
202 |
|
202 | |||
203 | overflow: auto; |
|
203 | overflow: auto; | |
204 | border-radius: 3px; |
|
204 | border-radius: 3px; | |
205 | box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8); |
|
205 | box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8); | |
206 | } |
|
206 | } | |
207 |
|
207 | |||
208 | /* output div while it is collapsed */ |
|
208 | /* output div while it is collapsed */ | |
209 | div.output_collapsed { |
|
209 | div.output_collapsed { | |
210 | margin-right: 5px; |
|
210 | margin-right: 5px; | |
211 | } |
|
211 | } | |
212 |
|
212 | |||
213 | div.out_prompt_overlay { |
|
213 | div.out_prompt_overlay { | |
214 | height: 100%; |
|
214 | height: 100%; | |
215 | padding: 0px; |
|
215 | padding: 0px; | |
216 | position: absolute; |
|
216 | position: absolute; | |
217 | border-radius: 3px; |
|
217 | border-radius: 3px; | |
218 | } |
|
218 | } | |
219 |
|
219 | |||
220 | div.out_prompt_overlay:hover { |
|
220 | div.out_prompt_overlay:hover { | |
221 | /* use inner shadow to get border that is computed the same on WebKit/FF */ |
|
221 | /* use inner shadow to get border that is computed the same on WebKit/FF */ | |
222 | box-shadow: inset 0 0 1px #000; |
|
222 | box-shadow: inset 0 0 1px #000; | |
223 | background: rgba(240, 240, 240, 0.5); |
|
223 | background: rgba(240, 240, 240, 0.5); | |
224 | } |
|
224 | } | |
225 |
|
225 | |||
226 | div.output_prompt { |
|
226 | div.output_prompt { | |
227 | color: darkred; |
|
227 | color: darkred; | |
228 | /* 5px right shift to account for margin in parent container */ |
|
228 | /* 5px right shift to account for margin in parent container */ | |
229 | margin: 0 5px 0 -5px; |
|
229 | margin: 0 5px 0 -5px; | |
230 | } |
|
230 | } | |
231 |
|
231 | |||
232 | /* This class is the outer container of all output sections. */ |
|
232 | /* This class is the outer container of all output sections. */ | |
233 | div.output_area { |
|
233 | div.output_area { | |
234 | padding: 0px; |
|
234 | padding: 0px; | |
235 | page-break-inside: avoid; |
|
235 | page-break-inside: avoid; | |
236 | } |
|
236 | } | |
237 |
|
237 | |||
238 | /* This class is for the output subarea inside the output_area and after |
|
238 | /* This class is for the output subarea inside the output_area and after | |
239 | the prompt div. */ |
|
239 | the prompt div. */ | |
240 | div.output_subarea { |
|
240 | div.output_subarea { | |
241 | padding: 0.4em 0.4em 0.4em 0.4em; |
|
241 | padding: 0.4em 0.4em 0.4em 0.4em; | |
242 | } |
|
242 | } | |
243 |
|
243 | |||
244 | /* The rest of the output_* classes are for special styling of the different |
|
244 | /* The rest of the output_* classes are for special styling of the different | |
245 | output types */ |
|
245 | output types */ | |
246 |
|
246 | |||
247 | /* all text output has this class: */ |
|
247 | /* all text output has this class: */ | |
248 | div.output_text { |
|
248 | div.output_text { | |
249 | text-align: left; |
|
249 | text-align: left; | |
250 | color: black; |
|
250 | color: black; | |
251 | font-family: monospace; |
|
251 | font-family: monospace; | |
252 | } |
|
252 | } | |
253 |
|
253 | |||
254 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ |
|
254 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ | |
255 | div.output_stream { |
|
255 | div.output_stream { | |
256 | padding-top: 0.0em; |
|
256 | padding-top: 0.0em; | |
257 | padding-bottom: 0.0em; |
|
257 | padding-bottom: 0.0em; | |
258 | } |
|
258 | } | |
259 | div.output_stdout { |
|
259 | div.output_stdout { | |
260 | } |
|
260 | } | |
261 | div.output_stderr { |
|
261 | div.output_stderr { | |
262 | background: #fdd; /* very light red background for stderr */ |
|
262 | background: #fdd; /* very light red background for stderr */ | |
263 | } |
|
263 | } | |
264 |
|
264 | |||
265 | div.output_latex { |
|
265 | div.output_latex { | |
266 | text-align: left; |
|
266 | text-align: left; | |
267 | color: black; |
|
267 | color: black; | |
268 | } |
|
268 | } | |
269 |
|
269 | |||
270 | div.output_html { |
|
270 | div.output_html { | |
271 | } |
|
271 | } | |
272 |
|
272 | |||
273 | div.output_png { |
|
273 | div.output_png { | |
274 | } |
|
274 | } | |
275 |
|
275 | |||
276 | div.output_jpeg { |
|
276 | div.output_jpeg { | |
277 | } |
|
277 | } | |
278 |
|
278 | |||
279 | div.text_cell { |
|
279 | div.text_cell { | |
280 | background-color: white; |
|
280 | background-color: white; | |
281 | padding: 5px 5px 5px 5px; |
|
281 | padding: 5px 5px 5px 5px; | |
282 | } |
|
282 | } | |
283 |
|
283 | |||
284 | div.text_cell_input { |
|
284 | div.text_cell_input { | |
285 | color: black; |
|
285 | color: black; | |
286 | border: 1px solid #ddd; |
|
286 | border: 1px solid #ddd; | |
287 | border-radius: 3px; |
|
287 | border-radius: 3px; | |
288 | background: #f7f7f7; |
|
288 | background: #f7f7f7; | |
289 | } |
|
289 | } | |
290 |
|
290 | |||
291 | div.text_cell_render { |
|
291 | div.text_cell_render { | |
292 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
292 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; | |
293 | outline: none; |
|
293 | outline: none; | |
294 | resize: none; |
|
294 | resize: none; | |
295 | width: inherit; |
|
295 | width: inherit; | |
296 | border-style: none; |
|
296 | border-style: none; | |
297 | padding: 5px; |
|
297 | padding: 5px; | |
298 | color: black; |
|
298 | color: black; | |
299 | } |
|
299 | } | |
300 |
|
300 | |||
301 | /* The following gets added to the <head> if it is detected that the user has a |
|
301 | /* The following gets added to the <head> if it is detected that the user has a | |
302 | * monospace font with inconsistent normal/bold/italic height. See |
|
302 | * monospace font with inconsistent normal/bold/italic height. See | |
303 | * notebookmain.js. Such fonts will have keywords vertically offset with |
|
303 | * notebookmain.js. Such fonts will have keywords vertically offset with | |
304 | * respect to the rest of the text. The user should select a better font. |
|
304 | * respect to the rest of the text. The user should select a better font. | |
305 | * See: https://github.com/ipython/ipython/issues/1503 |
|
305 | * See: https://github.com/ipython/ipython/issues/1503 | |
306 | * |
|
306 | * | |
307 | * .CodeMirror span { |
|
307 | * .CodeMirror span { | |
308 | * vertical-align: bottom; |
|
308 | * vertical-align: bottom; | |
309 | * } |
|
309 | * } | |
310 | */ |
|
310 | */ | |
311 |
|
311 | |||
312 | .CodeMirror { |
|
312 | .CodeMirror { | |
313 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
313 | line-height: 1.231; /* Changed from 1em to our global default */ | |
314 | } |
|
314 | } | |
315 |
|
315 | |||
316 | .CodeMirror-scroll { |
|
316 | .CodeMirror-scroll { | |
317 | height: auto; /* Changed to auto to autogrow */ |
|
317 | height: auto; /* Changed to auto to autogrow */ | |
318 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ |
|
318 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ | |
319 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ |
|
319 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ | |
320 | overflow-y: hidden; |
|
320 | overflow-y: hidden; | |
321 | overflow-x: auto; /* Changed from auto to remove scrollbar */ |
|
321 | overflow-x: auto; /* Changed from auto to remove scrollbar */ | |
322 | } |
|
322 | } | |
323 |
|
323 | |||
324 | /* CSS font colors for translated ANSI colors. */ |
|
324 | /* CSS font colors for translated ANSI colors. */ | |
325 |
|
325 | |||
326 |
|
326 | |||
327 | .ansiblack {color: black;} |
|
327 | .ansiblack {color: black;} | |
328 | .ansired {color: darkred;} |
|
328 | .ansired {color: darkred;} | |
329 | .ansigreen {color: darkgreen;} |
|
329 | .ansigreen {color: darkgreen;} | |
330 | .ansiyellow {color: brown;} |
|
330 | .ansiyellow {color: brown;} | |
331 | .ansiblue {color: darkblue;} |
|
331 | .ansiblue {color: darkblue;} | |
332 | .ansipurple {color: darkviolet;} |
|
332 | .ansipurple {color: darkviolet;} | |
333 | .ansicyan {color: steelblue;} |
|
333 | .ansicyan {color: steelblue;} | |
334 | .ansigrey {color: grey;} |
|
334 | .ansigrey {color: grey;} | |
335 | .ansibold {font-weight: bold;} |
|
335 | .ansibold {font-weight: bold;} | |
336 |
|
336 | |||
337 | .completions { |
|
337 | .completions { | |
338 | position: absolute; |
|
338 | position: absolute; | |
339 | z-index: 10; |
|
339 | z-index: 10; | |
340 | overflow: hidden; |
|
340 | overflow: hidden; | |
341 | border: 1px solid grey; |
|
341 | border: 1px solid grey; | |
342 | } |
|
342 | } | |
343 |
|
343 | |||
344 | .completions select { |
|
344 | .completions select { | |
345 | background: white; |
|
345 | background: white; | |
346 | outline: none; |
|
346 | outline: none; | |
347 | border: none; |
|
347 | border: none; | |
348 | padding: 0px; |
|
348 | padding: 0px; | |
349 | margin: 0px; |
|
349 | margin: 0px; | |
350 | overflow: auto; |
|
350 | overflow: auto; | |
351 | font-family: monospace; |
|
351 | font-family: monospace; | |
352 | } |
|
352 | } | |
353 |
|
353 | |||
354 | option.context { |
|
354 | option.context { | |
355 | background-color: #DEF7FF; |
|
355 | background-color: #DEF7FF; | |
356 | } |
|
356 | } | |
357 | option.introspection { |
|
357 | option.introspection { | |
358 | background-color: #EBF4EB; |
|
358 | background-color: #EBF4EB; | |
359 | } |
|
359 | } | |
360 |
|
360 | |||
361 | /*fixed part of the completion*/ |
|
361 | /*fixed part of the completion*/ | |
362 | .completions p b { |
|
362 | .completions p b { | |
363 | font-weight:bold; |
|
363 | font-weight:bold; | |
364 | } |
|
364 | } | |
365 |
|
365 | |||
366 | .completions p { |
|
366 | .completions p { | |
367 | background: #DDF; |
|
367 | background: #DDF; | |
368 | /*outline: none; |
|
368 | /*outline: none; | |
369 | padding: 0px;*/ |
|
369 | padding: 0px;*/ | |
370 | border-bottom: black solid 1px; |
|
370 | border-bottom: black solid 1px; | |
371 | padding: 1px; |
|
371 | padding: 1px; | |
372 | font-family: monospace; |
|
372 | font-family: monospace; | |
373 | } |
|
373 | } | |
374 |
|
374 | |||
375 | pre.dialog { |
|
375 | pre.dialog { | |
376 | background-color: #f7f7f7; |
|
376 | background-color: #f7f7f7; | |
377 | border: 1px solid #ddd; |
|
377 | border: 1px solid #ddd; | |
378 | border-radius: 3px; |
|
378 | border-radius: 3px; | |
379 | padding: 0.4em; |
|
379 | padding: 0.4em; | |
380 | padding-left: 2em; |
|
380 | padding-left: 2em; | |
381 | } |
|
381 | } | |
382 |
|
382 | |||
383 | p.dialog { |
|
383 | p.dialog { | |
384 | padding : 0.2em; |
|
384 | padding : 0.2em; | |
385 | } |
|
385 | } | |
386 |
|
386 | |||
387 | .shortcut_key { |
|
387 | .shortcut_key { | |
388 | display: inline-block; |
|
388 | display: inline-block; | |
389 | width: 15ex; |
|
389 | width: 15ex; | |
390 | text-align: right; |
|
390 | text-align: right; | |
391 | font-family: monospace; |
|
391 | font-family: monospace; | |
392 | } |
|
392 | } | |
393 |
|
393 | |||
394 | .shortcut_descr { |
|
394 | .shortcut_descr { | |
395 | } |
|
395 | } | |
396 |
|
396 | |||
397 | /* Word-wrap output correctly. This is the CSS3 spelling, though Firefox seems |
|
397 | /* Word-wrap output correctly. This is the CSS3 spelling, though Firefox seems | |
398 | to not honor it correctly. Webkit browsers (Chrome, rekonq, Safari) do. |
|
398 | to not honor it correctly. Webkit browsers (Chrome, rekonq, Safari) do. | |
399 | */ |
|
399 | */ | |
400 | pre, code, kbd, samp { white-space: pre-wrap; } |
|
400 | pre, code, kbd, samp { white-space: pre-wrap; } | |
401 |
|
401 | |||
402 | #fonttest { |
|
402 | #fonttest { | |
403 | font-family: monospace; |
|
403 | font-family: monospace; | |
404 | } |
|
404 | } | |
405 |
|
405 | |||
406 | .js-error { |
|
406 | .js-error { | |
407 | color: darkred; |
|
407 | color: darkred; | |
408 | } |
|
408 | } |
@@ -1,62 +1,62 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 | // Layout |
|
9 | // Layout | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 | var IPython = (function (IPython) { |
|
12 | var IPython = (function (IPython) { | |
13 |
|
13 | |||
14 | var LayoutManager = function () { |
|
14 | var LayoutManager = function () { | |
15 | this.bind_events(); |
|
15 | this.bind_events(); | |
16 | }; |
|
16 | }; | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | LayoutManager.prototype.bind_events = function () { |
|
19 | LayoutManager.prototype.bind_events = function () { | |
20 | $(window).resize($.proxy(this.do_resize,this)); |
|
20 | $(window).resize($.proxy(this.do_resize,this)); | |
21 | }; |
|
21 | }; | |
22 |
|
22 | |||
23 | LayoutManager.prototype.app_height = function() { |
|
23 | LayoutManager.prototype.app_height = function() { | |
24 | var win = $(window); |
|
24 | var win = $(window); | |
25 | var w = win.width(); |
|
25 | var w = win.width(); | |
26 | var h = win.height(); |
|
26 | var h = win.height(); | |
27 | var header_height; |
|
27 | var header_height; | |
28 | if ($('div#header').css('display') === 'none') { |
|
28 | if ($('div#header').css('display') === 'none') { | |
29 | header_height = 0; |
|
29 | header_height = 0; | |
30 | } else { |
|
30 | } else { | |
31 | header_height = $('div#header').outerHeight(true); |
|
31 | header_height = $('div#header').outerHeight(true); | |
32 | } |
|
32 | } | |
33 | var menubar_height = $('div#menubar').outerHeight(true); |
|
33 | var menubar_height = $('div#menubar').outerHeight(true); | |
34 | var toolbar_height; |
|
34 | var toolbar_height; | |
35 | if ($('div#toolbar').css('display') === 'none') { |
|
35 | if ($('div#maintoolbar').css('display') === 'none') { | |
36 | toolbar_height = 0; |
|
36 | toolbar_height = 0; | |
37 | } else { |
|
37 | } else { | |
38 | toolbar_height = $('div#toolbar').outerHeight(true); |
|
38 | toolbar_height = $('div#maintoolbar').outerHeight(true); | |
39 | } |
|
39 | } | |
40 | return h-header_height-menubar_height-toolbar_height; // content height |
|
40 | return h-header_height-menubar_height-toolbar_height; // content height | |
41 | } |
|
41 | } | |
42 |
|
42 | |||
43 | LayoutManager.prototype.do_resize = function () { |
|
43 | LayoutManager.prototype.do_resize = function () { | |
44 | var app_height = this.app_height() // content height |
|
44 | var app_height = this.app_height() // content height | |
45 |
|
45 | |||
46 | $('div#main_app').height(app_height); // content+padding+border height |
|
46 | $('div#main_app').height(app_height); // content+padding+border height | |
47 |
|
47 | |||
48 | var pager_height = IPython.pager.percentage_height*app_height; |
|
48 | var pager_height = IPython.pager.percentage_height*app_height; | |
49 | var pager_splitter_height = $('div#pager_splitter').outerHeight(true); |
|
49 | var pager_splitter_height = $('div#pager_splitter').outerHeight(true); | |
50 | $('div#pager').height(pager_height); |
|
50 | $('div#pager').height(pager_height); | |
51 | if (IPython.pager.expanded) { |
|
51 | if (IPython.pager.expanded) { | |
52 | $('div#notebook').height(app_height-pager_height-pager_splitter_height); |
|
52 | $('div#notebook').height(app_height-pager_height-pager_splitter_height); | |
53 | } else { |
|
53 | } else { | |
54 | $('div#notebook').height(app_height-pager_splitter_height); |
|
54 | $('div#notebook').height(app_height-pager_splitter_height); | |
55 | } |
|
55 | } | |
56 | }; |
|
56 | }; | |
57 |
|
57 | |||
58 | IPython.LayoutManager = LayoutManager; |
|
58 | IPython.LayoutManager = LayoutManager; | |
59 |
|
59 | |||
60 | return IPython; |
|
60 | return IPython; | |
61 |
|
61 | |||
62 | }(IPython)); |
|
62 | }(IPython)); |
@@ -1,87 +1,87 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 | // On document ready |
|
9 | // On document ready | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | $(document).ready(function () { |
|
13 | $(document).ready(function () { | |
14 |
|
14 | |||
15 | // monkey patch CM to be able to syntax highlight cell magics |
|
15 | // monkey patch CM to be able to syntax highlight cell magics | |
16 | // bug reported upstream, |
|
16 | // bug reported upstream, | |
17 | // see https://github.com/marijnh/CodeMirror2/issues/670 |
|
17 | // see https://github.com/marijnh/CodeMirror2/issues/670 | |
18 | if(CodeMirror.getMode(1,'text/plain').indent == undefined ){ |
|
18 | if(CodeMirror.getMode(1,'text/plain').indent == undefined ){ | |
19 | console.log('patching CM for undefined indent'); |
|
19 | console.log('patching CM for undefined indent'); | |
20 | CodeMirror.modes.null = function() { return {token: function(stream) {stream.skipToEnd();},indent : function(){return 0}}} |
|
20 | CodeMirror.modes.null = function() { return {token: function(stream) {stream.skipToEnd();},indent : function(){return 0}}} | |
21 | } |
|
21 | } | |
22 |
|
22 | |||
23 | CodeMirror.patchedGetMode = function(config, mode){ |
|
23 | CodeMirror.patchedGetMode = function(config, mode){ | |
24 | var cmmode = CodeMirror.getMode(config, mode); |
|
24 | var cmmode = CodeMirror.getMode(config, mode); | |
25 | if(cmmode.indent == null) |
|
25 | if(cmmode.indent == null) | |
26 | { |
|
26 | { | |
27 | console.log('patch mode "' , mode, '" on the fly'); |
|
27 | console.log('patch mode "' , mode, '" on the fly'); | |
28 | cmmode.indent = function(){return 0}; |
|
28 | cmmode.indent = function(){return 0}; | |
29 | } |
|
29 | } | |
30 | return cmmode; |
|
30 | return cmmode; | |
31 | } |
|
31 | } | |
32 | // end monkey patching CodeMirror |
|
32 | // end monkey patching CodeMirror | |
33 |
|
33 | |||
34 | IPython.init_mathjax(); |
|
34 | IPython.init_mathjax(); | |
35 |
|
35 | |||
36 | IPython.read_only = $('body').data('readOnly') === 'True'; |
|
36 | IPython.read_only = $('body').data('readOnly') === 'True'; | |
37 | $('div#main_app').addClass('border-box-sizing ui-widget'); |
|
37 | $('div#main_app').addClass('border-box-sizing ui-widget'); | |
38 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); |
|
38 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); | |
39 | // The header's bottom border is provided by the menu bar so we remove it. |
|
39 | // The header's bottom border is provided by the menu bar so we remove it. | |
40 | $('div#header').css('border-bottom-style','none'); |
|
40 | $('div#header').css('border-bottom-style','none'); | |
41 |
|
41 | |||
42 | IPython.page = new IPython.Page(); |
|
42 | IPython.page = new IPython.Page(); | |
43 | IPython.markdown_converter = new Markdown.Converter(); |
|
43 | IPython.markdown_converter = new Markdown.Converter(); | |
44 | IPython.layout_manager = new IPython.LayoutManager(); |
|
44 | IPython.layout_manager = new IPython.LayoutManager(); | |
45 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); |
|
45 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); | |
46 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); |
|
46 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); | |
47 | IPython.login_widget = new IPython.LoginWidget('span#login_widget'); |
|
47 | IPython.login_widget = new IPython.LoginWidget('span#login_widget'); | |
48 | IPython.notebook = new IPython.Notebook('div#notebook'); |
|
48 | IPython.notebook = new IPython.Notebook('div#notebook'); | |
49 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); |
|
49 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); | |
50 | IPython.menubar = new IPython.MenuBar('#menubar') |
|
50 | IPython.menubar = new IPython.MenuBar('#menubar') | |
51 | IPython.toolbar = new IPython.ToolBar('#toolbar') |
|
51 | IPython.toolbar = new IPython.MainToolBar('#maintoolbar') | |
52 | IPython.tooltip = new IPython.Tooltip() |
|
52 | IPython.tooltip = new IPython.Tooltip() | |
53 | IPython.notification_area = new IPython.NotificationArea('#notification_area') |
|
53 | IPython.notification_area = new IPython.NotificationArea('#notification_area') | |
54 | IPython.notification_area.init_notification_widgets(); |
|
54 | IPython.notification_area.init_notification_widgets(); | |
55 |
|
55 | |||
56 | IPython.layout_manager.do_resize(); |
|
56 | IPython.layout_manager.do_resize(); | |
57 |
|
57 | |||
58 | $('body').append('<div id="fonttest"><pre><span id="test1">x</span>'+ |
|
58 | $('body').append('<div id="fonttest"><pre><span id="test1">x</span>'+ | |
59 | '<span id="test2" style="font-weight: bold;">x</span>'+ |
|
59 | '<span id="test2" style="font-weight: bold;">x</span>'+ | |
60 | '<span id="test3" style="font-style: italic;">x</span></pre></div>') |
|
60 | '<span id="test3" style="font-style: italic;">x</span></pre></div>') | |
61 | var nh = $('#test1').innerHeight(); |
|
61 | var nh = $('#test1').innerHeight(); | |
62 | var bh = $('#test2').innerHeight(); |
|
62 | var bh = $('#test2').innerHeight(); | |
63 | var ih = $('#test3').innerHeight(); |
|
63 | var ih = $('#test3').innerHeight(); | |
64 | if(nh != bh || nh != ih) { |
|
64 | if(nh != bh || nh != ih) { | |
65 | $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>'); |
|
65 | $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>'); | |
66 | } |
|
66 | } | |
67 | $('#fonttest').remove(); |
|
67 | $('#fonttest').remove(); | |
68 |
|
68 | |||
69 | if(IPython.read_only){ |
|
69 | if(IPython.read_only){ | |
70 | // hide various elements from read-only view |
|
70 | // hide various elements from read-only view | |
71 | $('div#pager').remove(); |
|
71 | $('div#pager').remove(); | |
72 | $('div#pager_splitter').remove(); |
|
72 | $('div#pager_splitter').remove(); | |
73 |
|
73 | |||
74 | // set the notebook name field as not modifiable |
|
74 | // set the notebook name field as not modifiable | |
75 | $('#notebook_name').attr('disabled','disabled') |
|
75 | $('#notebook_name').attr('disabled','disabled') | |
76 | } |
|
76 | } | |
77 |
|
77 | |||
78 | IPython.page.show(); |
|
78 | IPython.page.show(); | |
79 |
|
79 | |||
80 | IPython.layout_manager.do_resize(); |
|
80 | IPython.layout_manager.do_resize(); | |
81 | $([IPython.events]).on('notebook_loaded.Notebook', function () { |
|
81 | $([IPython.events]).on('notebook_loaded.Notebook', function () { | |
82 | IPython.layout_manager.do_resize(); |
|
82 | IPython.layout_manager.do_resize(); | |
83 | }) |
|
83 | }) | |
84 | IPython.notebook.load_notebook($('body').data('notebookId')); |
|
84 | IPython.notebook.load_notebook($('body').data('notebookId')); | |
85 |
|
85 | |||
86 | }); |
|
86 | }); | |
87 |
|
87 |
@@ -1,152 +1,96 b'' | |||||
1 | //---------------------------------------------------------------------------- |
|
1 | //---------------------------------------------------------------------------- | |
2 |
// Copyright (C) 2008 |
|
2 | // Copyright (C) 2008 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 ToolBar = function (selector) { |
|
14 | var ToolBar = function (selector) { | |
15 | this.selector = selector; |
|
15 | this.selector = selector; | |
16 | if (this.selector !== undefined) { |
|
16 | if (this.selector !== undefined) { | |
17 | this.element = $(selector); |
|
17 | this.element = $(selector); | |
18 | this.style(); |
|
18 | this.style(); | |
19 | this.bind_events(); |
|
|||
20 | } |
|
19 | } | |
21 | }; |
|
20 | }; | |
22 |
|
21 | |||
|
22 | // add a group of button into the current toolbar. | |||
|
23 | // | |||
|
24 | // First argument : Mandatory | |||
|
25 | // list of dict as argument, each dict should contain | |||
|
26 | // 3 mandatory keys and values : | |||
|
27 | // label : string -- the text to show on hover | |||
|
28 | // icon : string -- the jQuery-ui icon to add on this button | |||
|
29 | // callback : function -- the callback to execute on a click | |||
|
30 | // | |||
|
31 | // and optionally an 'id' key that is assigned to the button element | |||
|
32 | // | |||
|
33 | // Second Argument, optional, | |||
|
34 | // string reprensenting the id to give to the button group. | |||
|
35 | // | |||
|
36 | // Example | |||
|
37 | // | |||
|
38 | // IPython.toolbar.add_button_group([ | |||
|
39 | // {label:'my button', | |||
|
40 | // icon:'ui-icon-disk', | |||
|
41 | // callback:function(){alert('hoho'), | |||
|
42 | // id : 'my_button_id', // this is optional | |||
|
43 | // } | |||
|
44 | // }, | |||
|
45 | // {label:'my second button', | |||
|
46 | // icon:'ui-icon-scissors', | |||
|
47 | // callback:function(){alert('be carefull I cut')} | |||
|
48 | // } | |||
|
49 | // ], | |||
|
50 | // "my_button_group_id" | |||
|
51 | // ) | |||
|
52 | // | |||
|
53 | ToolBar.prototype.add_buttons_group = function (list, group_id) { | |||
|
54 | var span_group = $('<span/>'); | |||
|
55 | if( group_id != undefined ) { | |||
|
56 | span_group.attr('id',group_id); | |||
|
57 | } | |||
|
58 | for(var el in list) { | |||
|
59 | var button = $('<button/>').button({ | |||
|
60 | icons : {primary : list[el].icon}, | |||
|
61 | text : false, | |||
|
62 | label : list[el].label | |||
|
63 | }); | |||
|
64 | var id = list[el].id; | |||
|
65 | if( id != undefined ) | |||
|
66 | button.attr('id',id); | |||
|
67 | var fun = list[el].callback; | |||
|
68 | button.click(fun); | |||
|
69 | span_group.append(button); | |||
|
70 | } | |||
|
71 | span_group.buttonset(); | |||
|
72 | $(this.selector).append(span_group); | |||
|
73 | }; | |||
23 |
|
74 | |||
24 | ToolBar.prototype.style = function () { |
|
75 | ToolBar.prototype.style = function () { | |
25 | this.element.addClass('border-box-sizing'). |
|
76 | this.element.addClass('border-box-sizing'). | |
26 | addClass('ui-widget ui-widget-content'). |
|
77 | addClass('ui-widget ui-widget-content toolbar'). | |
27 | css('border-top-style','none'). |
|
78 | css('border-top-style','none'). | |
28 | css('border-left-style','none'). |
|
79 | css('border-left-style','none'). | |
29 | css('border-right-style','none'); |
|
80 | css('border-right-style','none'); | |
30 | this.element.find('#cell_type').addClass('ui-widget ui-widget-content'); |
|
|||
31 | this.element.find('#save_b').button({ |
|
|||
32 | icons : {primary: 'ui-icon-disk'}, |
|
|||
33 | text : false |
|
|||
34 | }); |
|
|||
35 | this.element.find('#cut_b').button({ |
|
|||
36 | icons: {primary: 'ui-icon-scissors'}, |
|
|||
37 | text : false |
|
|||
38 | }); |
|
|||
39 | this.element.find('#copy_b').button({ |
|
|||
40 | icons: {primary: 'ui-icon-copy'}, |
|
|||
41 | text : false |
|
|||
42 | }); |
|
|||
43 | this.element.find('#paste_b').button({ |
|
|||
44 | icons: {primary: 'ui-icon-clipboard'}, |
|
|||
45 | text : false |
|
|||
46 | }); |
|
|||
47 | this.element.find('#cut_copy_paste').buttonset(); |
|
|||
48 | this.element.find('#move_up_b').button({ |
|
|||
49 | icons: {primary: 'ui-icon-arrowthick-1-n'}, |
|
|||
50 | text : false |
|
|||
51 | }); |
|
|||
52 | this.element.find('#move_down_b').button({ |
|
|||
53 | icons: {primary: 'ui-icon-arrowthick-1-s'}, |
|
|||
54 | text : false |
|
|||
55 | }); |
|
|||
56 | this.element.find('#move_up_down').buttonset(); |
|
|||
57 | this.element.find('#insert_above_b').button({ |
|
|||
58 | icons: {primary: 'ui-icon-arrowthickstop-1-n'}, |
|
|||
59 | text : false |
|
|||
60 | }); |
|
|||
61 | this.element.find('#insert_below_b').button({ |
|
|||
62 | icons: {primary: 'ui-icon-arrowthickstop-1-s'}, |
|
|||
63 | text : false |
|
|||
64 | }); |
|
|||
65 | this.element.find('#insert_above_below').buttonset(); |
|
|||
66 | this.element.find('#run_b').button({ |
|
|||
67 | icons: {primary: 'ui-icon-play'}, |
|
|||
68 | text : false |
|
|||
69 | }); |
|
|||
70 | this.element.find('#interrupt_b').button({ |
|
|||
71 | icons: {primary: 'ui-icon-stop'}, |
|
|||
72 | text : false |
|
|||
73 | }); |
|
|||
74 | this.element.find('#run_int').buttonset(); |
|
|||
75 | }; |
|
|||
76 |
|
||||
77 |
|
||||
78 | ToolBar.prototype.bind_events = function () { |
|
|||
79 | var that = this; |
|
|||
80 | this.element.find('#save_b').click(function () { |
|
|||
81 | IPython.notebook.save_notebook(); |
|
|||
82 | }); |
|
|||
83 | this.element.find('#cut_b').click(function () { |
|
|||
84 | IPython.notebook.cut_cell(); |
|
|||
85 | }); |
|
|||
86 | this.element.find('#copy_b').click(function () { |
|
|||
87 | IPython.notebook.copy_cell(); |
|
|||
88 | }); |
|
|||
89 | this.element.find('#paste_b').click(function () { |
|
|||
90 | IPython.notebook.paste_cell(); |
|
|||
91 | }); |
|
|||
92 | this.element.find('#move_up_b').click(function () { |
|
|||
93 | IPython.notebook.move_cell_up(); |
|
|||
94 | }); |
|
|||
95 | this.element.find('#move_down_b').click(function () { |
|
|||
96 | IPython.notebook.move_cell_down(); |
|
|||
97 | }); |
|
|||
98 | this.element.find('#insert_above_b').click(function () { |
|
|||
99 | IPython.notebook.insert_cell_above('code'); |
|
|||
100 | }); |
|
|||
101 | this.element.find('#insert_below_b').click(function () { |
|
|||
102 | IPython.notebook.insert_cell_below('code'); |
|
|||
103 | }); |
|
|||
104 | this.element.find('#run_b').click(function () { |
|
|||
105 | IPython.notebook.execute_selected_cell(); |
|
|||
106 | }); |
|
|||
107 | this.element.find('#interrupt_b').click(function () { |
|
|||
108 | IPython.notebook.kernel.interrupt(); |
|
|||
109 | }); |
|
|||
110 | this.element.find('#cell_type').change(function () { |
|
|||
111 | var cell_type = $(this).val(); |
|
|||
112 | if (cell_type === 'code') { |
|
|||
113 | IPython.notebook.to_code(); |
|
|||
114 | } else if (cell_type === 'markdown') { |
|
|||
115 | IPython.notebook.to_markdown(); |
|
|||
116 | } else if (cell_type === 'raw') { |
|
|||
117 | IPython.notebook.to_raw(); |
|
|||
118 | } else if (cell_type === 'heading1') { |
|
|||
119 | IPython.notebook.to_heading(undefined, 1); |
|
|||
120 | } else if (cell_type === 'heading2') { |
|
|||
121 | IPython.notebook.to_heading(undefined, 2); |
|
|||
122 | } else if (cell_type === 'heading3') { |
|
|||
123 | IPython.notebook.to_heading(undefined, 3); |
|
|||
124 | } else if (cell_type === 'heading4') { |
|
|||
125 | IPython.notebook.to_heading(undefined, 4); |
|
|||
126 | } else if (cell_type === 'heading5') { |
|
|||
127 | IPython.notebook.to_heading(undefined, 5); |
|
|||
128 | } else if (cell_type === 'heading6') { |
|
|||
129 | IPython.notebook.to_heading(undefined, 6); |
|
|||
130 | }; |
|
|||
131 | }); |
|
|||
132 | $([IPython.events]).on('selected_cell_type_changed.Notebook', function (event, data) { |
|
|||
133 | if (data.cell_type === 'heading') { |
|
|||
134 | that.element.find('#cell_type').val(data.cell_type+data.level); |
|
|||
135 | } else { |
|
|||
136 | that.element.find('#cell_type').val(data.cell_type); |
|
|||
137 | } |
|
|||
138 | }); |
|
|||
139 | }; |
|
81 | }; | |
140 |
|
82 | |||
141 |
|
83 | |||
142 | ToolBar.prototype.toggle = function () { |
|
84 | ToolBar.prototype.toggle = function () { | |
143 | this.element.toggle(); |
|
85 | this.element.toggle(); | |
144 |
IPython.layout_manager |
|
86 | if (IPython.layout_manager != undefined) { | |
|
87 | IPython.layout_manager.do_resize(); | |||
|
88 | } | |||
145 | }; |
|
89 | }; | |
146 |
|
90 | |||
147 |
|
91 | |||
148 | IPython.ToolBar = ToolBar; |
|
92 | IPython.ToolBar = ToolBar; | |
149 |
|
93 | |||
150 | return IPython; |
|
94 | return IPython; | |
151 |
|
95 | |||
152 | }(IPython)); |
|
96 | }(IPython)); |
@@ -1,259 +1,224 b'' | |||||
1 | {% extends page.html %} |
|
1 | {% extends page.html %} | |
2 | {% block stylesheet %} |
|
2 | {% block stylesheet %} | |
3 |
|
3 | |||
4 | {% if mathjax_url %} |
|
4 | {% if mathjax_url %} | |
5 | <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML" charset="utf-8"></script> |
|
5 | <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML" charset="utf-8"></script> | |
6 | {% end %} |
|
6 | {% end %} | |
7 | <script type="text/javascript"> |
|
7 | <script type="text/javascript"> | |
8 | // MathJax disabled, set as null to distingish from *missing* MathJax, |
|
8 | // MathJax disabled, set as null to distingish from *missing* MathJax, | |
9 | // where it will be undefined, and should prompt a dialog later. |
|
9 | // where it will be undefined, and should prompt a dialog later. | |
10 | window.mathjax_url = "{{mathjax_url}}"; |
|
10 | window.mathjax_url = "{{mathjax_url}}"; | |
11 | </script> |
|
11 | </script> | |
12 |
|
12 | |||
13 | <link rel="stylesheet" href="{{ static_url("codemirror/lib/codemirror.css") }}"> |
|
13 | <link rel="stylesheet" href="{{ static_url("codemirror/lib/codemirror.css") }}"> | |
14 | <link rel="stylesheet" href="{{ static_url("codemirror/theme/ipython.css") }}"> |
|
14 | <link rel="stylesheet" href="{{ static_url("codemirror/theme/ipython.css") }}"> | |
15 |
|
15 | |||
16 | <link rel="stylesheet" href="{{ static_url("prettify/prettify.css") }}"/> |
|
16 | <link rel="stylesheet" href="{{ static_url("prettify/prettify.css") }}"/> | |
17 |
|
17 | |||
18 | <link rel="stylesheet" href="{{ static_url("css/notebook.css") }}" type="text/css" /> |
|
18 | <link rel="stylesheet" href="{{ static_url("css/notebook.css") }}" type="text/css" /> | |
19 | <link rel="stylesheet" href="{{ static_url("css/tooltip.css") }}" type="text/css" /> |
|
19 | <link rel="stylesheet" href="{{ static_url("css/tooltip.css") }}" type="text/css" /> | |
20 | <link rel="stylesheet" href="{{ static_url("css/renderedhtml.css") }}" type="text/css" /> |
|
20 | <link rel="stylesheet" href="{{ static_url("css/renderedhtml.css") }}" type="text/css" /> | |
21 |
|
21 | |||
22 | <link rel="stylesheet" href="{{ static_url("css/printnotebook.css") }}" type="text/css" media="print"/> |
|
22 | <link rel="stylesheet" href="{{ static_url("css/printnotebook.css") }}" type="text/css" media="print"/> | |
23 |
|
23 | |||
24 | {% end %} |
|
24 | {% end %} | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | {% block params %} |
|
27 | {% block params %} | |
28 |
|
28 | |||
29 | data-project={{project}} |
|
29 | data-project={{project}} | |
30 | data-base-project-url={{base_project_url}} |
|
30 | data-base-project-url={{base_project_url}} | |
31 | data-base-kernel-url={{base_kernel_url}} |
|
31 | data-base-kernel-url={{base_kernel_url}} | |
32 | data-read-only={{read_only and not logged_in}} |
|
32 | data-read-only={{read_only and not logged_in}} | |
33 | data-notebook-id={{notebook_id}} |
|
33 | data-notebook-id={{notebook_id}} | |
34 |
|
34 | |||
35 | {% end %} |
|
35 | {% end %} | |
36 |
|
36 | |||
37 |
|
37 | |||
38 | {% block header %} |
|
38 | {% block header %} | |
39 |
|
39 | |||
40 | <span id="save_widget"> |
|
40 | <span id="save_widget"> | |
41 | <span id="notebook_name"></span> |
|
41 | <span id="notebook_name"></span> | |
42 | <span id="save_status"></span> |
|
42 | <span id="save_status"></span> | |
43 | </span> |
|
43 | </span> | |
44 |
|
44 | |||
45 | {% end %} |
|
45 | {% end %} | |
46 |
|
46 | |||
47 |
|
47 | |||
48 | {% block site %} |
|
48 | {% block site %} | |
49 |
|
49 | |||
50 | <div id="menubar_container"> |
|
50 | <div id="menubar_container"> | |
51 | <div id="menubar"> |
|
51 | <div id="menubar"> | |
52 | <ul id="menus"> |
|
52 | <ul id="menus"> | |
53 | <li><a href="#">File</a> |
|
53 | <li><a href="#">File</a> | |
54 | <ul> |
|
54 | <ul> | |
55 | <li id="new_notebook"><a href="#">New</a></li> |
|
55 | <li id="new_notebook"><a href="#">New</a></li> | |
56 | <li id="open_notebook"><a href="#">Open...</a></li> |
|
56 | <li id="open_notebook"><a href="#">Open...</a></li> | |
57 | <hr/> |
|
57 | <hr/> | |
58 | <li id="copy_notebook"><a href="#">Make a Copy...</a></li> |
|
58 | <li id="copy_notebook"><a href="#">Make a Copy...</a></li> | |
59 | <li id="rename_notebook"><a href="#">Rename...</a></li> |
|
59 | <li id="rename_notebook"><a href="#">Rename...</a></li> | |
60 | <li id="save_notebook"><a href="#">Save</a></li> |
|
60 | <li id="save_notebook"><a href="#">Save</a></li> | |
61 | <hr/> |
|
61 | <hr/> | |
62 | <li><a href="#">Download as</a> |
|
62 | <li><a href="#">Download as</a> | |
63 | <ul> |
|
63 | <ul> | |
64 | <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li> |
|
64 | <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li> | |
65 | <li id="download_py"><a href="#">Python (.py)</a></li> |
|
65 | <li id="download_py"><a href="#">Python (.py)</a></li> | |
66 | </ul> |
|
66 | </ul> | |
67 | </li> |
|
67 | </li> | |
68 | <hr/> |
|
68 | <hr/> | |
69 | <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li> |
|
69 | <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li> | |
70 | <hr/> |
|
70 | <hr/> | |
71 | <li id="kill_and_exit"><a href="#" >Close and halt</a></li> |
|
71 | <li id="kill_and_exit"><a href="#" >Close and halt</a></li> | |
72 | </ul> |
|
72 | </ul> | |
73 | </li> |
|
73 | </li> | |
74 | <li><a href="#">Edit</a> |
|
74 | <li><a href="#">Edit</a> | |
75 | <ul> |
|
75 | <ul> | |
76 | <li id="cut_cell"><a href="#">Cut Cell</a></li> |
|
76 | <li id="cut_cell"><a href="#">Cut Cell</a></li> | |
77 | <li id="copy_cell"><a href="#">Copy Cell</a></li> |
|
77 | <li id="copy_cell"><a href="#">Copy Cell</a></li> | |
78 | <li id="paste_cell" class="ui-state-disabled"><a href="#">Paste Cell</a></li> |
|
78 | <li id="paste_cell" class="ui-state-disabled"><a href="#">Paste Cell</a></li> | |
79 | <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> | |
80 | <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> | |
81 | <li id="delete_cell"><a href="#">Delete</a></li> |
|
81 | <li id="delete_cell"><a href="#">Delete</a></li> | |
82 | <hr/> |
|
82 | <hr/> | |
83 | <li id="split_cell"><a href="#">Split Cell</a></li> |
|
83 | <li id="split_cell"><a href="#">Split Cell</a></li> | |
84 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> |
|
84 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> | |
85 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> |
|
85 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> | |
86 | <hr/> |
|
86 | <hr/> | |
87 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> |
|
87 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> | |
88 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> |
|
88 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> | |
89 | <hr/> |
|
89 | <hr/> | |
90 | <li id="select_previous"><a href="#">Select Previous Cell</a></li> |
|
90 | <li id="select_previous"><a href="#">Select Previous Cell</a></li> | |
91 | <li id="select_next"><a href="#">Select Next Cell</a></li> |
|
91 | <li id="select_next"><a href="#">Select Next Cell</a></li> | |
92 | </ul> |
|
92 | </ul> | |
93 | </li> |
|
93 | </li> | |
94 | <li><a href="#">View</a> |
|
94 | <li><a href="#">View</a> | |
95 | <ul> |
|
95 | <ul> | |
96 | <li id="toggle_header"><a href="#">Toggle Header</a></li> |
|
96 | <li id="toggle_header"><a href="#">Toggle Header</a></li> | |
97 | <li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li> |
|
97 | <li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li> | |
98 | </ul> |
|
98 | </ul> | |
99 | </li> |
|
99 | </li> | |
100 | <li><a href="#">Insert</a> |
|
100 | <li><a href="#">Insert</a> | |
101 | <ul> |
|
101 | <ul> | |
102 | <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li> |
|
102 | <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li> | |
103 | <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li> |
|
103 | <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li> | |
104 | </ul> |
|
104 | </ul> | |
105 | </li> |
|
105 | </li> | |
106 | <li><a href="#">Cell</a> |
|
106 | <li><a href="#">Cell</a> | |
107 | <ul> |
|
107 | <ul> | |
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 | <hr/> |
|
111 | <hr/> | |
112 | <li id="to_code"><a href="#">Code</a></li> |
|
112 | <li id="to_code"><a href="#">Code</a></li> | |
113 | <li id="to_markdown"><a href="#">Markdown </a></li> |
|
113 | <li id="to_markdown"><a href="#">Markdown </a></li> | |
114 | <li id="to_raw"><a href="#">Raw Text</a></li> |
|
114 | <li id="to_raw"><a href="#">Raw Text</a></li> | |
115 | <li id="to_heading1"><a href="#">Heading 1</a></li> |
|
115 | <li id="to_heading1"><a href="#">Heading 1</a></li> | |
116 | <li id="to_heading2"><a href="#">Heading 2</a></li> |
|
116 | <li id="to_heading2"><a href="#">Heading 2</a></li> | |
117 | <li id="to_heading3"><a href="#">Heading 3</a></li> |
|
117 | <li id="to_heading3"><a href="#">Heading 3</a></li> | |
118 | <li id="to_heading4"><a href="#">Heading 4</a></li> |
|
118 | <li id="to_heading4"><a href="#">Heading 4</a></li> | |
119 | <li id="to_heading5"><a href="#">Heading 5</a></li> |
|
119 | <li id="to_heading5"><a href="#">Heading 5</a></li> | |
120 | <li id="to_heading6"><a href="#">Heading 6</a></li> |
|
120 | <li id="to_heading6"><a href="#">Heading 6</a></li> | |
121 | <hr/> |
|
121 | <hr/> | |
122 | <li id="toggle_output"><a href="#">Toggle Current Output</a></li> |
|
122 | <li id="toggle_output"><a href="#">Toggle Current Output</a></li> | |
123 | <li id="all_outputs"><a href="#">All Output</a> |
|
123 | <li id="all_outputs"><a href="#">All Output</a> | |
124 | <ul> |
|
124 | <ul> | |
125 | <li id="expand_all_output"><a href="#">Expand</a></li> |
|
125 | <li id="expand_all_output"><a href="#">Expand</a></li> | |
126 | <li id="scroll_all_output"><a href="#">Scroll Long</a></li> |
|
126 | <li id="scroll_all_output"><a href="#">Scroll Long</a></li> | |
127 | <li id="collapse_all_output"><a href="#">Collapse</a></li> |
|
127 | <li id="collapse_all_output"><a href="#">Collapse</a></li> | |
128 | <li id="clear_all_output"><a href="#">Clear</a></li> |
|
128 | <li id="clear_all_output"><a href="#">Clear</a></li> | |
129 | </ul> |
|
129 | </ul> | |
130 | </li> |
|
130 | </li> | |
131 | </ul> |
|
131 | </ul> | |
132 | </li> |
|
132 | </li> | |
133 | <li><a href="#">Kernel</a> |
|
133 | <li><a href="#">Kernel</a> | |
134 | <ul> |
|
134 | <ul> | |
135 | <li id="int_kernel"><a href="#">Interrupt</a></li> |
|
135 | <li id="int_kernel"><a href="#">Interrupt</a></li> | |
136 | <li id="restart_kernel"><a href="#">Restart</a></li> |
|
136 | <li id="restart_kernel"><a href="#">Restart</a></li> | |
137 | </ul> |
|
137 | </ul> | |
138 | </li> |
|
138 | </li> | |
139 | <li><a href="#">Help</a> |
|
139 | <li><a href="#">Help</a> | |
140 | <ul> |
|
140 | <ul> | |
141 | <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li> |
|
141 | <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li> | |
142 | <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li> |
|
142 | <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li> | |
143 | <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li> |
|
143 | <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li> | |
144 | <hr/> |
|
144 | <hr/> | |
145 | <li><a href="http://docs.python.org" target="_blank">Python</a></li> |
|
145 | <li><a href="http://docs.python.org" target="_blank">Python</a></li> | |
146 | <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li> |
|
146 | <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li> | |
147 | <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li> |
|
147 | <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li> | |
148 | <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li> |
|
148 | <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li> | |
149 | <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li> |
|
149 | <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li> | |
150 | </ul> |
|
150 | </ul> | |
151 | </li> |
|
151 | </li> | |
152 | </ul> |
|
152 | </ul> | |
153 |
|
153 | |||
154 | </div> |
|
154 | </div> | |
155 | <div id="notification_area"> |
|
155 | <div id="notification_area"> | |
156 | </div> |
|
156 | </div> | |
157 | </div> |
|
157 | </div> | |
158 |
|
158 | |||
159 |
|
159 | |||
160 | <div id="toolbar"> |
|
160 | <div id="maintoolbar"></div> | |
161 |
|
||||
162 | <span> |
|
|||
163 | <button id="save_b">Save</button> |
|
|||
164 | </span> |
|
|||
165 | <span id="cut_copy_paste"> |
|
|||
166 | <button id="cut_b" title="Cut Cell">Cut Cell</button> |
|
|||
167 | <button id="copy_b" title="Copy Cell">Copy Cell</button> |
|
|||
168 | <button id="paste_b" title="Paste Cell">Paste Cell</button> |
|
|||
169 | </span> |
|
|||
170 | <span id="move_up_down"> |
|
|||
171 | <button id="move_up_b" title="Move Cell Up">Move Cell Up</button> |
|
|||
172 | <button id="move_down_b" title="Move Cell Down">Move Down</button> |
|
|||
173 | </span> |
|
|||
174 | <span id="insert_above_below"> |
|
|||
175 | <button id="insert_above_b" title="Insert Cell Above">Insert Cell Above</button> |
|
|||
176 | <button id="insert_below_b" title="Insert Cell Below">Insert Cell Below</button> |
|
|||
177 | </span> |
|
|||
178 | <span id="run_int"> |
|
|||
179 | <button id="run_b" title="Run Cell">Run Cell</button> |
|
|||
180 | <button id="interrupt_b" title="Interrupt">Interrupt</button> |
|
|||
181 | </span> |
|
|||
182 | <span> |
|
|||
183 | <select id="cell_type"> |
|
|||
184 | <option value="code">Code</option> |
|
|||
185 | <option value="markdown">Markdown</option> |
|
|||
186 | <option value="raw">Raw Text</option> |
|
|||
187 | <option value="heading1">Heading 1</option> |
|
|||
188 | <option value="heading2">Heading 2</option> |
|
|||
189 | <option value="heading3">Heading 3</option> |
|
|||
190 | <option value="heading4">Heading 4</option> |
|
|||
191 | <option value="heading5">Heading 5</option> |
|
|||
192 | <option value="heading6">Heading 6</option> |
|
|||
193 | </select> |
|
|||
194 | </span> |
|
|||
195 |
|
||||
196 | </div> |
|
|||
197 |
|
161 | |||
198 | <div id="main_app"> |
|
162 | <div id="main_app"> | |
199 |
|
163 | |||
200 | <div id="notebook_panel"> |
|
164 | <div id="notebook_panel"> | |
201 | <div id="notebook"></div> |
|
165 | <div id="notebook"></div> | |
202 | <div id="pager_splitter"></div> |
|
166 | <div id="pager_splitter"></div> | |
203 | <div id="pager_container"> |
|
167 | <div id="pager_container"> | |
204 | <div id='pager_button_area'> |
|
168 | <div id='pager_button_area'> | |
205 | </div> |
|
169 | </div> | |
206 | <div id="pager"></div> |
|
170 | <div id="pager"></div> | |
207 | </div> |
|
171 | </div> | |
208 | </div> |
|
172 | </div> | |
209 |
|
173 | |||
210 | </div> |
|
174 | </div> | |
211 | <div id='tooltip' class='tooltip ui-corner-all' style='display:none'></div> |
|
175 | <div id='tooltip' class='tooltip ui-corner-all' style='display:none'></div> | |
212 |
|
176 | |||
213 |
|
177 | |||
214 | {% end %} |
|
178 | {% end %} | |
215 |
|
179 | |||
216 |
|
180 | |||
217 | {% block script %} |
|
181 | {% block script %} | |
218 |
|
182 | |||
219 | <script src="{{ static_url("codemirror/lib/codemirror.js") }}" charset="utf-8"></script> |
|
183 | <script src="{{ static_url("codemirror/lib/codemirror.js") }}" charset="utf-8"></script> | |
220 | <script src="{{ static_url("codemirror/lib/util/loadmode.js") }}" charset="utf-8"></script> |
|
184 | <script src="{{ static_url("codemirror/lib/util/loadmode.js") }}" charset="utf-8"></script> | |
221 | <script src="{{ static_url("codemirror/lib/util/multiplex.js") }}" charset="utf-8"></script> |
|
185 | <script src="{{ static_url("codemirror/lib/util/multiplex.js") }}" charset="utf-8"></script> | |
222 | <script src="{{ static_url("codemirror/mode/python/python.js") }}" charset="utf-8"></script> |
|
186 | <script src="{{ static_url("codemirror/mode/python/python.js") }}" charset="utf-8"></script> | |
223 | <script src="{{ static_url("codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> |
|
187 | <script src="{{ static_url("codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> | |
224 | <script src="{{ static_url("codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> |
|
188 | <script src="{{ static_url("codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> | |
225 | <script src="{{ static_url("codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> |
|
189 | <script src="{{ static_url("codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> | |
226 | <script src="{{ static_url("codemirror/mode/css/css.js") }}" charset="utf-8"></script> |
|
190 | <script src="{{ static_url("codemirror/mode/css/css.js") }}" charset="utf-8"></script> | |
227 | <script src="{{ static_url("codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> |
|
191 | <script src="{{ static_url("codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> | |
228 | <script src="{{ static_url("codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> |
|
192 | <script src="{{ static_url("codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> | |
229 |
|
193 | |||
230 | <script src="{{ static_url("pagedown/Markdown.Converter.js") }}" charset="utf-8"></script> |
|
194 | <script src="{{ static_url("pagedown/Markdown.Converter.js") }}" charset="utf-8"></script> | |
231 |
|
195 | |||
232 | <script src="{{ static_url("prettify/prettify.js") }}" charset="utf-8"></script> |
|
196 | <script src="{{ static_url("prettify/prettify.js") }}" charset="utf-8"></script> | |
233 | <script src="{{ static_url("dateformat/date.format.js") }}" charset="utf-8"></script> |
|
197 | <script src="{{ static_url("dateformat/date.format.js") }}" charset="utf-8"></script> | |
234 |
|
198 | |||
235 | <script src="{{ static_url("js/events.js") }}" type="text/javascript" charset="utf-8"></script> |
|
199 | <script src="{{ static_url("js/events.js") }}" type="text/javascript" charset="utf-8"></script> | |
236 | <script src="{{ static_url("js/utils.js") }}" type="text/javascript" charset="utf-8"></script> |
|
200 | <script src="{{ static_url("js/utils.js") }}" type="text/javascript" charset="utf-8"></script> | |
237 | <script src="{{ static_url("js/layoutmanager.js") }}" type="text/javascript" charset="utf-8"></script> |
|
201 | <script src="{{ static_url("js/layoutmanager.js") }}" type="text/javascript" charset="utf-8"></script> | |
238 | <script src="{{ static_url("js/initmathjax.js") }}" type="text/javascript" charset="utf-8"></script> |
|
202 | <script src="{{ static_url("js/initmathjax.js") }}" type="text/javascript" charset="utf-8"></script> | |
239 | <script src="{{ static_url("js/outputarea.js") }}" type="text/javascript" charset="utf-8"></script> |
|
203 | <script src="{{ static_url("js/outputarea.js") }}" type="text/javascript" charset="utf-8"></script> | |
240 | <script src="{{ static_url("js/cell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
204 | <script src="{{ static_url("js/cell.js") }}" type="text/javascript" charset="utf-8"></script> | |
241 | <script src="{{ static_url("js/codecell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
205 | <script src="{{ static_url("js/codecell.js") }}" type="text/javascript" charset="utf-8"></script> | |
242 | <script src="{{ static_url("js/completer.js") }}" type="text/javascript" charset="utf-8"></script> |
|
206 | <script src="{{ static_url("js/completer.js") }}" type="text/javascript" charset="utf-8"></script> | |
243 | <script src="{{ static_url("js/textcell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
207 | <script src="{{ static_url("js/textcell.js") }}" type="text/javascript" charset="utf-8"></script> | |
244 | <script src="{{ static_url("js/kernel.js") }}" type="text/javascript" charset="utf-8"></script> |
|
208 | <script src="{{ static_url("js/kernel.js") }}" type="text/javascript" charset="utf-8"></script> | |
245 | <script src="{{ static_url("js/savewidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
209 | <script src="{{ static_url("js/savewidget.js") }}" type="text/javascript" charset="utf-8"></script> | |
246 | <script src="{{ static_url("js/quickhelp.js") }}" type="text/javascript" charset="utf-8"></script> |
|
210 | <script src="{{ static_url("js/quickhelp.js") }}" type="text/javascript" charset="utf-8"></script> | |
247 | <script src="{{ static_url("js/pager.js") }}" type="text/javascript" charset="utf-8"></script> |
|
211 | <script src="{{ static_url("js/pager.js") }}" type="text/javascript" charset="utf-8"></script> | |
248 | <script src="{{ static_url("js/menubar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
212 | <script src="{{ static_url("js/menubar.js") }}" type="text/javascript" charset="utf-8"></script> | |
249 | <script src="{{ static_url("js/toolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
213 | <script src="{{ static_url("js/toolbar.js") }}" type="text/javascript" charset="utf-8"></script> | |
|
214 | <script src="{{ static_url("js/maintoolbar.js") }}" type="text/javascript" charset="utf-8"></script> | |||
250 | <script src="{{ static_url("js/notebook.js") }}" type="text/javascript" charset="utf-8"></script> |
|
215 | <script src="{{ static_url("js/notebook.js") }}" type="text/javascript" charset="utf-8"></script> | |
251 | <script src="{{ static_url("js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
216 | <script src="{{ static_url("js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script> | |
252 | <script src="{{ static_url("js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script> |
|
217 | <script src="{{ static_url("js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script> | |
253 | <script src="{{ static_url("js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script> |
|
218 | <script src="{{ static_url("js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script> | |
254 | <script src="{{ static_url("js/config.js") }}" type="text/javascript" charset="utf-8"></script> |
|
219 | <script src="{{ static_url("js/config.js") }}" type="text/javascript" charset="utf-8"></script> | |
255 | <script src="{{ static_url("js/notebookmain.js") }}" type="text/javascript" charset="utf-8"></script> |
|
220 | <script src="{{ static_url("js/notebookmain.js") }}" type="text/javascript" charset="utf-8"></script> | |
256 |
|
221 | |||
257 | <script src="{{ static_url("js/contexthint.js") }}" charset="utf-8"></script> |
|
222 | <script src="{{ static_url("js/contexthint.js") }}" charset="utf-8"></script> | |
258 |
|
223 | |||
259 | {% end %} |
|
224 | {% end %} |
General Comments 0
You need to be logged in to leave comments.
Login now