Show More
@@ -1,345 +1,348 b'' | |||
|
1 | 1 | /** |
|
2 | 2 | * Primary styles |
|
3 | 3 | * |
|
4 | 4 | * Author: IPython Development Team |
|
5 | 5 | */ |
|
6 | 6 | |
|
7 | 7 | |
|
8 | 8 | body { |
|
9 | 9 | background-color: white; |
|
10 | 10 | /* This makes sure that the body covers the entire window and needs to |
|
11 | 11 | be in a different element than the display: box in wrapper below */ |
|
12 | 12 | position: absolute; |
|
13 | 13 | left: 0px; |
|
14 | 14 | right: 0px; |
|
15 | 15 | top: 0px; |
|
16 | 16 | bottom: 0px; |
|
17 | 17 | overflow: hidden; |
|
18 | 18 | } |
|
19 | 19 | |
|
20 | 20 | span#save_widget { |
|
21 | 21 | position: static; |
|
22 | 22 | left: 0px; |
|
23 | 23 | padding: 5px 0px; |
|
24 | 24 | margin: 0px 0px 0px 0px; |
|
25 | 25 | } |
|
26 | 26 | |
|
27 | 27 | span#quick_help_area { |
|
28 | 28 | position: static; |
|
29 | 29 | padding: 5px 0px; |
|
30 | 30 | margin: 0px 0px 0px 0px; |
|
31 | 31 | } |
|
32 | 32 | |
|
33 | 33 | input#notebook_name { |
|
34 | 34 | height: 1em; |
|
35 | 35 | line-height: 1em; |
|
36 | 36 | padding: 5px; |
|
37 | 37 | } |
|
38 | 38 | |
|
39 | 39 | span#kernel_status { |
|
40 | position: absolute; | |
|
41 |
padding: |
|
|
42 | right: 10px; | |
|
40 | float: right; | |
|
41 | padding: 0px 5px; | |
|
43 | 42 | font-weight: bold; |
|
44 | 43 | } |
|
45 | 44 | |
|
46 | 45 | |
|
47 | 46 | .status_idle { |
|
48 | 47 | color: gray; |
|
49 | 48 | } |
|
50 | 49 | |
|
51 | 50 | .status_busy { |
|
52 | 51 | color: red; |
|
53 | 52 | } |
|
54 | 53 | |
|
55 | 54 | .status_restarting { |
|
56 | 55 | color: black; |
|
57 | 56 | } |
|
58 | 57 | |
|
59 | 58 | div#left_panel { |
|
60 | 59 | overflow-y: auto; |
|
61 | 60 | top: 0px; |
|
62 | 61 | left: 0px; |
|
63 | 62 | margin: 0px; |
|
64 | 63 | padding: 0px; |
|
65 | 64 | position: absolute; |
|
66 | 65 | } |
|
67 | 66 | |
|
68 |
|
|
|
67 | div.section_header { | |
|
69 | 68 | padding: 5px; |
|
70 | 69 | } |
|
71 | 70 | |
|
71 | div.section_header h3 { | |
|
72 | display: inline; | |
|
73 | } | |
|
74 | ||
|
72 | 75 | div.section_content { |
|
73 | 76 | padding: 5px; |
|
74 | 77 | } |
|
75 | 78 | |
|
76 | 79 | span.section_row_buttons button { |
|
77 | 80 | width: 70px; |
|
78 | 81 | } |
|
79 | 82 | |
|
80 | 83 | span.section_row_buttons a { |
|
81 | 84 | width: 70px; |
|
82 | 85 | } |
|
83 | 86 | |
|
84 | 87 | .section_row { |
|
85 | 88 | margin: 5px 0px; |
|
86 | 89 | } |
|
87 | 90 | |
|
88 | 91 | .section_row_buttons { |
|
89 | 92 | float: right; |
|
90 | 93 | } |
|
91 | 94 | |
|
92 | 95 | #kernel_persist { |
|
93 | 96 | float: right; |
|
94 | 97 | } |
|
95 | 98 | |
|
96 | 99 | .help_string { |
|
97 | 100 | float: right; |
|
98 | 101 | width: 170px; |
|
99 | 102 | padding: 0px 5px; |
|
100 | 103 | text-align: left; |
|
101 | 104 | font-size: 85%; |
|
102 | 105 | } |
|
103 | 106 | |
|
104 | 107 | .help_string_label { |
|
105 | 108 | float: right; |
|
106 | 109 | font-size: 85%; |
|
107 | 110 | } |
|
108 | 111 | |
|
109 | 112 | #autoindent_span { |
|
110 | 113 | float: right; |
|
111 | 114 | } |
|
112 | 115 | |
|
113 | 116 | .checkbox_label { |
|
114 | 117 | font-size: 85%; |
|
115 | 118 | float: right; |
|
116 | 119 | padding: 0.3em; |
|
117 | 120 | } |
|
118 | 121 | |
|
119 | 122 | .section_row_header { |
|
120 | 123 | float: left; |
|
121 | 124 | font-size: 85%; |
|
122 | 125 | padding: 0.4em 0em; |
|
123 | 126 | font-weight: bold; |
|
124 | 127 | } |
|
125 | 128 | |
|
126 | 129 | span.button_label { |
|
127 | 130 | padding: 0.2em 1em; |
|
128 | 131 | font-size: 77%; |
|
129 | 132 | float: right; |
|
130 | 133 | } |
|
131 | 134 | |
|
132 | 135 | /* This is needed because FF was adding a 2px margin top and bottom. */ |
|
133 | 136 | .section_row .ui-button { |
|
134 | 137 | margin-top: 0px; |
|
135 | 138 | margin-bottom: 0px; |
|
136 | 139 | } |
|
137 | 140 | |
|
138 | 141 | #download_format { |
|
139 | 142 | float: right; |
|
140 | 143 | font-size: 85%; |
|
141 | 144 | width: 62px; |
|
142 | 145 | margin: 1px 5px; |
|
143 | 146 | } |
|
144 | 147 | |
|
145 | 148 | div#left_panel_splitter { |
|
146 | 149 | width: 8px; |
|
147 | 150 | top: 0px; |
|
148 | 151 | left: 202px; |
|
149 | 152 | margin: 0px; |
|
150 | 153 | padding: 0px; |
|
151 | 154 | position: absolute; |
|
152 | 155 | } |
|
153 | 156 | |
|
154 | 157 | div#notebook_panel { |
|
155 | 158 | /* The L margin will be set in the Javascript code*/ |
|
156 | 159 | margin: 0px 0px 0px 0px; |
|
157 | 160 | padding: 0px; |
|
158 | 161 | } |
|
159 | 162 | |
|
160 | 163 | div#notebook { |
|
161 | 164 | overflow-y: scroll; |
|
162 | 165 | overflow-x: auto; |
|
163 | 166 | width: 100%; |
|
164 | 167 | /* This spaces the cell away from the edge of the notebook area */ |
|
165 | 168 | padding: 5px 5px 15px 5px; |
|
166 | 169 | margin: 0px |
|
167 | 170 | background-color: white; |
|
168 | 171 | } |
|
169 | 172 | |
|
170 | 173 | div#pager_splitter { |
|
171 | 174 | height: 8px; |
|
172 | 175 | } |
|
173 | 176 | |
|
174 | 177 | div#pager { |
|
175 | 178 | padding: 15px; |
|
176 | 179 | overflow: auto; |
|
177 | 180 | } |
|
178 | 181 | |
|
179 | 182 | div.cell { |
|
180 | 183 | width: 100%; |
|
181 | 184 | padding: 5px 5px 5px 0px; |
|
182 | 185 | /* This acts as a spacer between cells, that is outside the border */ |
|
183 | 186 | margin: 2px 0px 2px 0px; |
|
184 | 187 | } |
|
185 | 188 | |
|
186 | 189 | div.code_cell { |
|
187 | 190 | background-color: white; |
|
188 | 191 | } |
|
189 | 192 | |
|
190 | 193 | div.prompt { |
|
191 | 194 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ |
|
192 | 195 | width: 11ex; |
|
193 | 196 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ |
|
194 | 197 | padding: 0.4em; |
|
195 | 198 | margin: 0px; |
|
196 | 199 | font-family: monospace; |
|
197 | 200 | text-align:right; |
|
198 | 201 | } |
|
199 | 202 | |
|
200 | 203 | div.input { |
|
201 | 204 | page-break-inside: avoid; |
|
202 | 205 | } |
|
203 | 206 | |
|
204 | 207 | /* input_area and input_prompt must match in top border and margin for alignment */ |
|
205 | 208 | div.input_area { |
|
206 | 209 | color: black; |
|
207 | 210 | border: 1px solid #ddd; |
|
208 | 211 | border-radius: 3px; |
|
209 | 212 | background: #f7f7f7; |
|
210 | 213 | } |
|
211 | 214 | |
|
212 | 215 | div.input_prompt { |
|
213 | 216 | color: navy; |
|
214 | 217 | border-top: 1px solid transparent; |
|
215 | 218 | } |
|
216 | 219 | |
|
217 | 220 | div.output { |
|
218 | 221 | /* This is a spacer between the input and output of each cell */ |
|
219 | 222 | margin-top: 5px; |
|
220 | 223 | } |
|
221 | 224 | |
|
222 | 225 | div.output_prompt { |
|
223 | 226 | color: darkred; |
|
224 | 227 | } |
|
225 | 228 | |
|
226 | 229 | /* This class is the outer container of all output sections. */ |
|
227 | 230 | div.output_area { |
|
228 | 231 | padding: 0px; |
|
229 | 232 | page-break-inside: avoid; |
|
230 | 233 | } |
|
231 | 234 | |
|
232 | 235 | /* This class is for the output subarea inside the output_area and after |
|
233 | 236 | the prompt div. */ |
|
234 | 237 | div.output_subarea { |
|
235 | 238 | padding: 0.4em; |
|
236 | 239 | } |
|
237 | 240 | |
|
238 | 241 | /* The rest of the output_* classes are for special styling of the different |
|
239 | 242 | output types */ |
|
240 | 243 | |
|
241 | 244 | /* all text output has this class: */ |
|
242 | 245 | div.output_text { |
|
243 | 246 | text-align: left; |
|
244 | 247 | color: black; |
|
245 | 248 | font-family: monospace; |
|
246 | 249 | } |
|
247 | 250 | |
|
248 | 251 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ |
|
249 | 252 | div.output_stream { |
|
250 | 253 | padding-top: 0.0em; |
|
251 | 254 | padding-bottom: 0.0em; |
|
252 | 255 | } |
|
253 | 256 | div.output_stdout { |
|
254 | 257 | } |
|
255 | 258 | div.output_stderr { |
|
256 | 259 | background: #fdd; /* very light red background for stderr */ |
|
257 | 260 | } |
|
258 | 261 | |
|
259 | 262 | div.output_latex { |
|
260 | 263 | text-align: left; |
|
261 | 264 | color: black; |
|
262 | 265 | } |
|
263 | 266 | |
|
264 | 267 | div.output_html { |
|
265 | 268 | } |
|
266 | 269 | |
|
267 | 270 | div.output_png { |
|
268 | 271 | } |
|
269 | 272 | |
|
270 | 273 | div.output_jpeg { |
|
271 | 274 | } |
|
272 | 275 | |
|
273 | 276 | div.text_cell { |
|
274 | 277 | background-color: white; |
|
275 | 278 | } |
|
276 | 279 | |
|
277 | 280 | div.text_cell_input { |
|
278 | 281 | color: black; |
|
279 | 282 | } |
|
280 | 283 | |
|
281 | 284 | div.text_cell_render { |
|
282 | 285 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
283 | 286 | outline: none; |
|
284 | 287 | resize: none; |
|
285 | 288 | width: inherit; |
|
286 | 289 | border-style: none; |
|
287 | 290 | padding: 5px; |
|
288 | 291 | color: black; |
|
289 | 292 | } |
|
290 | 293 | |
|
291 | 294 | .CodeMirror { |
|
292 | 295 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
293 | 296 | } |
|
294 | 297 | |
|
295 | 298 | .CodeMirror-scroll { |
|
296 | 299 | height: auto; /* Changed to auto to autogrow */ |
|
297 | 300 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ |
|
298 | 301 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ |
|
299 | 302 | overflow-y: hidden; |
|
300 | 303 | overflow-x: auto; /* Changed from auto to remove scrollbar */ |
|
301 | 304 | } |
|
302 | 305 | |
|
303 | 306 | /* CSS font colors for translated ANSI colors. */ |
|
304 | 307 | |
|
305 | 308 | |
|
306 | 309 | .ansiblack {color: black;} |
|
307 | 310 | .ansired {color: darkred;} |
|
308 | 311 | .ansigreen {color: darkgreen;} |
|
309 | 312 | .ansiyellow {color: brown;} |
|
310 | 313 | .ansiblue {color: darkblue;} |
|
311 | 314 | .ansipurple {color: darkviolet;} |
|
312 | 315 | .ansicyan {color: steelblue;} |
|
313 | 316 | .ansigrey {color: grey;} |
|
314 | 317 | .ansibold {font-weight: bold;} |
|
315 | 318 | |
|
316 | 319 | .completions { |
|
317 | 320 | position: absolute; |
|
318 | 321 | z-index: 10; |
|
319 | 322 | overflow: auto; |
|
320 | 323 | border: 1px solid black; |
|
321 | 324 | } |
|
322 | 325 | |
|
323 | 326 | .completions select { |
|
324 | 327 | background: white; |
|
325 | 328 | outline: none; |
|
326 | 329 | border: none; |
|
327 | 330 | padding: 0px; |
|
328 | 331 | margin: 0px; |
|
329 | 332 | font-family: monospace; |
|
330 | 333 | } |
|
331 | 334 | |
|
332 | 335 | @media print { |
|
333 | 336 | body { overflow: visible !important; } |
|
334 | 337 | .ui-widget-content { border: 0px; } |
|
335 | 338 | } |
|
336 | 339 | |
|
337 | 340 | .shortcut_key { |
|
338 | 341 | display: inline-block; |
|
339 | 342 | width: 13ex; |
|
340 | 343 | text-align: right; |
|
341 | 344 | font-family: monospace; |
|
342 | 345 | } |
|
343 | 346 | |
|
344 | 347 | .shortcut_descr { |
|
345 | 348 | } |
@@ -1,287 +1,287 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // PanelSection |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | |
|
14 | 14 | var utils = IPython.utils; |
|
15 | 15 | |
|
16 | 16 | // Base PanelSection class |
|
17 | 17 | |
|
18 | 18 | var PanelSection = function (selector) { |
|
19 | 19 | this.selector = selector; |
|
20 | 20 | if (this.selector !== undefined) { |
|
21 | 21 | this.element = $(selector); |
|
22 |
this.header = this.element.find(' |
|
|
22 | this.header = this.element.find('div.section_header'); | |
|
23 | 23 | this.content = this.element.find('div.section_content'); |
|
24 | 24 | this.style(); |
|
25 | 25 | this.bind_events(); |
|
26 | 26 | } |
|
27 | 27 | this.expanded = true; |
|
28 | 28 | }; |
|
29 | 29 | |
|
30 | 30 | |
|
31 | 31 | PanelSection.prototype.style = function () { |
|
32 | this.header.addClass('ui-widget ui-state-default'); | |
|
32 | this.header.addClass('ui-widget ui-state-default ui-helper-clearfix'); | |
|
33 | 33 | this.header.attr('title', "Click to Show/Hide Section"); |
|
34 | 34 | this.content.addClass('ui-widget section_content'); |
|
35 | 35 | }; |
|
36 | 36 | |
|
37 | 37 | |
|
38 | 38 | PanelSection.prototype.bind_events = function () { |
|
39 | 39 | var that = this; |
|
40 | 40 | this.header.click(function () { |
|
41 | 41 | that.toggle(); |
|
42 | 42 | }); |
|
43 | 43 | this.header.hover(function () { |
|
44 | 44 | that.header.toggleClass('ui-state-hover'); |
|
45 | 45 | }); |
|
46 | 46 | }; |
|
47 | 47 | |
|
48 | 48 | |
|
49 | 49 | PanelSection.prototype.expand = function () { |
|
50 | 50 | if (!this.expanded) { |
|
51 | 51 | this.content.slideDown('fast'); |
|
52 | 52 | this.expanded = true; |
|
53 | 53 | }; |
|
54 | 54 | }; |
|
55 | 55 | |
|
56 | 56 | |
|
57 | 57 | PanelSection.prototype.collapse = function () { |
|
58 | 58 | if (this.expanded) { |
|
59 | 59 | this.content.slideUp('fast'); |
|
60 | 60 | this.expanded = false; |
|
61 | 61 | }; |
|
62 | 62 | }; |
|
63 | 63 | |
|
64 | 64 | |
|
65 | 65 | PanelSection.prototype.toggle = function () { |
|
66 | 66 | if (this.expanded === true) { |
|
67 | 67 | this.collapse(); |
|
68 | 68 | } else { |
|
69 | 69 | this.expand(); |
|
70 | 70 | }; |
|
71 | 71 | }; |
|
72 | 72 | |
|
73 | 73 | |
|
74 | 74 | PanelSection.prototype.create_children = function () {}; |
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | // NotebookSection |
|
78 | 78 | |
|
79 | 79 | var NotebookSection = function () { |
|
80 | 80 | PanelSection.apply(this, arguments); |
|
81 | 81 | }; |
|
82 | 82 | |
|
83 | 83 | |
|
84 | 84 | NotebookSection.prototype = new PanelSection(); |
|
85 | 85 | |
|
86 | 86 | |
|
87 | 87 | NotebookSection.prototype.style = function () { |
|
88 | 88 | PanelSection.prototype.style.apply(this); |
|
89 | 89 | this.content.addClass('ui-helper-clearfix'); |
|
90 | 90 | this.content.find('div.section_row').addClass('ui-helper-clearfix'); |
|
91 | 91 | this.content.find('#new_open').buttonset(); |
|
92 | 92 | this.content.find('#new_notebook').attr('title', "Create a new notebook"); |
|
93 | 93 | this.content.find('#open_notebook').attr('title', "Open an existing notebook"); |
|
94 | 94 | this.content.find('#download_notebook').button(); |
|
95 | 95 | this.content.find('#download_notebook').attr('title', |
|
96 | 96 | "Download the notebook in the specified format," + |
|
97 | 97 | " either full ipynb notebook or as a Python script."); |
|
98 | 98 | // upload notebook doesn't exist: |
|
99 | 99 | this.content.find('#upload_notebook').button(); |
|
100 | 100 | this.content.find('#download_format').addClass('ui-widget ui-widget-content'); |
|
101 | 101 | this.content.find('#download_format option').addClass('ui-widget ui-widget-content'); |
|
102 | 102 | }; |
|
103 | 103 | |
|
104 | 104 | |
|
105 | 105 | NotebookSection.prototype.bind_events = function () { |
|
106 | 106 | PanelSection.prototype.bind_events.apply(this); |
|
107 | 107 | var that = this; |
|
108 | 108 | this.content.find('#new_notebook').click(function () { |
|
109 | 109 | window.open($('body').data('baseProjectUrl')+'new'); |
|
110 | 110 | }); |
|
111 | 111 | this.content.find('#open_notebook').click(function () { |
|
112 | 112 | window.open($('body').data('baseProjectUrl')); |
|
113 | 113 | }); |
|
114 | 114 | this.content.find('#download_notebook').click(function () { |
|
115 | 115 | var format = that.content.find('#download_format').val(); |
|
116 | 116 | var notebook_id = IPython.save_widget.get_notebook_id(); |
|
117 | 117 | var url = $('body').data('baseProjectUrl') + 'notebooks/' + notebook_id + '?format=' + format; |
|
118 | 118 | window.open(url,'_newtab'); |
|
119 | 119 | }); |
|
120 | 120 | }; |
|
121 | 121 | |
|
122 | 122 | // CellSection |
|
123 | 123 | |
|
124 | 124 | var CellSection = function () { |
|
125 | 125 | PanelSection.apply(this, arguments); |
|
126 | 126 | }; |
|
127 | 127 | |
|
128 | 128 | |
|
129 | 129 | CellSection.prototype = new PanelSection(); |
|
130 | 130 | |
|
131 | 131 | |
|
132 | 132 | CellSection.prototype.style = function () { |
|
133 | 133 | PanelSection.prototype.style.apply(this); |
|
134 | 134 | this.content.addClass('ui-helper-clearfix'); |
|
135 | 135 | this.content.find('div.section_row').addClass('ui-helper-clearfix'); |
|
136 | 136 | this.content.find('#delete_cell').button(); |
|
137 | 137 | this.content.find('#delete_cell').attr('title', "Delete the selected cell"); |
|
138 | 138 | |
|
139 | 139 | this.content.find('#insert').buttonset(); |
|
140 | 140 | this.content.find('#insert_cell_above').attr('title', "Insert new cell above selected"); |
|
141 | 141 | this.content.find('#insert_cell_below').attr('title', "Insert new cell below selected"); |
|
142 | 142 | |
|
143 | 143 | this.content.find('#move').buttonset(); |
|
144 | 144 | this.content.find('#move_cell_up').attr('title', "Move selected cell up one in the Notebook"); |
|
145 | 145 | this.content.find('#move_cell_down').attr('title', "Move selected cell down one in the Notebook"); |
|
146 | 146 | |
|
147 | 147 | this.content.find('#cell_type').buttonset(); |
|
148 | 148 | this.content.find('#to_markdown').attr('title', 'Change selected cell to markdown (for text)') |
|
149 | 149 | this.content.find('#to_code').attr('title', 'Change selected cell to code (for execution)') |
|
150 | 150 | |
|
151 | 151 | this.content.find('#cell_output').buttonset(); |
|
152 | 152 | this.content.find('#toggle_output').attr('title', 'Toggle visibility of the output of code cells') |
|
153 | 153 | this.content.find('#clear_all_output').attr('title', 'Clear output of all code cells (actually removes the data, unlike toggle)') |
|
154 | 154 | |
|
155 | 155 | this.content.find('#run_cells').buttonset(); |
|
156 | 156 | this.content.find('#run_selected_cell').attr('title', 'Submit the selected cell for execution') |
|
157 | 157 | this.content.find('#run_all_cells').attr('title', 'Run *all* code cells in the notebook in order') |
|
158 | 158 | this.content.find('#autoindent').attr('title', 'Autoindent code as-you-type') |
|
159 | 159 | this.content.find('#autoindent_label').attr('title', 'Autoindent code as-you-type') |
|
160 | 160 | }; |
|
161 | 161 | |
|
162 | 162 | |
|
163 | 163 | CellSection.prototype.bind_events = function () { |
|
164 | 164 | PanelSection.prototype.bind_events.apply(this); |
|
165 | 165 | this.content.find('#toggle_output').click(function () { |
|
166 | 166 | IPython.notebook.toggle_output(); |
|
167 | 167 | }); |
|
168 | 168 | this.content.find('#clear_all_output').click(function () { |
|
169 | 169 | IPython.notebook.clear_all_output(); |
|
170 | 170 | }); |
|
171 | 171 | this.content.find('#delete_cell').click(function () { |
|
172 | 172 | IPython.notebook.delete_cell(); |
|
173 | 173 | }); |
|
174 | 174 | this.content.find('#insert_cell_above').click(function () { |
|
175 | 175 | IPython.notebook.insert_code_cell_above(); |
|
176 | 176 | }); |
|
177 | 177 | this.content.find('#insert_cell_below').click(function () { |
|
178 | 178 | IPython.notebook.insert_code_cell_below(); |
|
179 | 179 | }); |
|
180 | 180 | this.content.find('#move_cell_up').click(function () { |
|
181 | 181 | IPython.notebook.move_cell_up(); |
|
182 | 182 | }); |
|
183 | 183 | this.content.find('#move_cell_down').click(function () { |
|
184 | 184 | IPython.notebook.move_cell_down(); |
|
185 | 185 | }); |
|
186 | 186 | this.content.find('#to_code').click(function () { |
|
187 | 187 | IPython.notebook.to_code(); |
|
188 | 188 | }); |
|
189 | 189 | this.content.find('#to_markdown').click(function () { |
|
190 | 190 | IPython.notebook.to_markdown(); |
|
191 | 191 | }); |
|
192 | 192 | this.content.find('#run_selected_cell').click(function () { |
|
193 | 193 | IPython.notebook.execute_selected_cell(); |
|
194 | 194 | }); |
|
195 | 195 | this.content.find('#run_all_cells').click(function () { |
|
196 | 196 | IPython.notebook.execute_all_cells(); |
|
197 | 197 | }); |
|
198 | 198 | this.content.find('#autoindent').change(function () { |
|
199 | 199 | var state = $('#autoindent').prop('checked'); |
|
200 | 200 | IPython.notebook.set_autoindent(state); |
|
201 | 201 | }); |
|
202 | 202 | }; |
|
203 | 203 | |
|
204 | 204 | |
|
205 | 205 | // KernelSection |
|
206 | 206 | |
|
207 | 207 | var KernelSection = function () { |
|
208 | 208 | PanelSection.apply(this, arguments); |
|
209 | 209 | }; |
|
210 | 210 | |
|
211 | 211 | |
|
212 | 212 | KernelSection.prototype = new PanelSection(); |
|
213 | 213 | |
|
214 | 214 | |
|
215 | 215 | KernelSection.prototype.style = function () { |
|
216 | 216 | PanelSection.prototype.style.apply(this); |
|
217 | 217 | this.content.addClass('ui-helper-clearfix'); |
|
218 | 218 | this.content.find('div.section_row').addClass('ui-helper-clearfix'); |
|
219 | 219 | this.content.find('#int_restart').buttonset(); |
|
220 | 220 | this.content.find("#int_kernel").attr('title', "Interrupt the kernel with SIGINT/Ctrl-C"); |
|
221 | 221 | this.content.find("#restart_kernel").attr('title', |
|
222 | 222 | "Restart the kernel. This will shutdown the current kernel," + |
|
223 | 223 | " and start a new, clean kernel in its place, connected to this Notebook." + |
|
224 | 224 | " This may break the connection of other clients connected to this kernel." ); |
|
225 | 225 | var kill_tip = "Kill the kernel on exit. If unchecked, the kernel will remain" + |
|
226 | 226 | " active after closing the session, allowing you to reconnect and resume later."; |
|
227 | 227 | this.content.find('#kill_kernel').attr('title', kill_tip); |
|
228 | 228 | this.content.find('#kill_kernel_label').attr('title', kill_tip); |
|
229 | 229 | |
|
230 | 230 | }; |
|
231 | 231 | |
|
232 | 232 | |
|
233 | 233 | KernelSection.prototype.bind_events = function () { |
|
234 | 234 | PanelSection.prototype.bind_events.apply(this); |
|
235 | 235 | this.content.find('#restart_kernel').click(function () { |
|
236 | 236 | IPython.notebook.restart_kernel(); |
|
237 | 237 | }); |
|
238 | 238 | this.content.find('#int_kernel').click(function () { |
|
239 | 239 | IPython.notebook.kernel.interrupt(); |
|
240 | 240 | }); |
|
241 | 241 | }; |
|
242 | 242 | |
|
243 | 243 | |
|
244 | 244 | // HelpSection |
|
245 | 245 | |
|
246 | 246 | var HelpSection = function () { |
|
247 | 247 | PanelSection.apply(this, arguments); |
|
248 | 248 | }; |
|
249 | 249 | |
|
250 | 250 | |
|
251 | 251 | HelpSection.prototype = new PanelSection(); |
|
252 | 252 | |
|
253 | 253 | |
|
254 | 254 | HelpSection.prototype.style = function () { |
|
255 | 255 | PanelSection.prototype.style.apply(this); |
|
256 | 256 | PanelSection.prototype.style.apply(this); |
|
257 | 257 | this.content.addClass('ui-helper-clearfix'); |
|
258 | 258 | this.content.find('div.section_row').addClass('ui-helper-clearfix'); |
|
259 | 259 | this.content.find('#help_buttons0').buttonset(); |
|
260 | 260 | this.content.find('#help_buttons1').buttonset(); |
|
261 | 261 | this.content.find('#help_buttons2').buttonset(); |
|
262 | 262 | this.content.find('#python_help').attr('title', "Open the online Python documentation in a new tab") |
|
263 | 263 | this.content.find('#ipython_help').attr('title', "Open the online IPython documentation in a new tab") |
|
264 | 264 | this.content.find('#numpy_help').attr('title', "Open the online NumPy documentation in a new tab") |
|
265 | 265 | this.content.find('#scipy_help').attr('title', "Open the online SciPy documentation in a new tab") |
|
266 | 266 | this.content.find('#matplotlib_help').attr('title', "Open the online Matplotlib documentation in a new tab") |
|
267 | 267 | this.content.find('#sympy_help').attr('title', "Open the online SymPy documentation in a new tab") |
|
268 | 268 | }; |
|
269 | 269 | |
|
270 | 270 | |
|
271 | 271 | HelpSection.prototype.bind_events = function () { |
|
272 | 272 | PanelSection.prototype.bind_events.apply(this); |
|
273 | 273 | }; |
|
274 | 274 | |
|
275 | 275 | |
|
276 | 276 | // Set module variables |
|
277 | 277 | |
|
278 | 278 | IPython.PanelSection = PanelSection; |
|
279 | 279 | IPython.NotebookSection = NotebookSection; |
|
280 | 280 | IPython.CellSection = CellSection; |
|
281 | 281 | IPython.KernelSection = KernelSection; |
|
282 | 282 | IPython.HelpSection = HelpSection; |
|
283 | 283 | |
|
284 | 284 | return IPython; |
|
285 | 285 | |
|
286 | 286 | }(IPython)); |
|
287 | 287 |
@@ -1,278 +1,286 b'' | |||
|
1 | 1 | <!DOCTYPE HTML> |
|
2 | 2 | <html> |
|
3 | 3 | |
|
4 | 4 | <head> |
|
5 | 5 | <meta charset="utf-8"> |
|
6 | 6 | |
|
7 | 7 | <title>IPython Notebook</title> |
|
8 | 8 | |
|
9 | 9 | <!-- <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script> --> |
|
10 | 10 | <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script> |
|
11 | 11 | <script type="text/javascript"> |
|
12 | 12 | function CheckMathJax(){ |
|
13 | 13 | var div=document.getElementById("MathJaxFetchingWarning") |
|
14 | 14 | if(window.MathJax){ |
|
15 | 15 | document.body.removeChild(div) |
|
16 | 16 | } |
|
17 | 17 | else{ |
|
18 | 18 | div.style.display = "block"; |
|
19 | 19 | } |
|
20 | 20 | } |
|
21 | 21 | if (typeof MathJax == 'undefined') { |
|
22 | 22 | console.log("No local MathJax, loading from CDN"); |
|
23 | 23 | document.write(unescape("%3Cscript type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E")); |
|
24 | 24 | }else{ |
|
25 | 25 | console.log("Using local MathJax"); |
|
26 | 26 | } |
|
27 | 27 | </script> |
|
28 | 28 | |
|
29 | 29 | <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> |
|
30 | 30 | <link rel="stylesheet" href="static/codemirror/lib/codemirror.css"> |
|
31 | 31 | <link rel="stylesheet" href="static/codemirror/mode/markdown/markdown.css"> |
|
32 | 32 | <link rel="stylesheet" href="static/codemirror/mode/rst/rst.css"> |
|
33 | 33 | <link rel="stylesheet" href="static/codemirror/theme/ipython.css"> |
|
34 | 34 | <link rel="stylesheet" href="static/codemirror/theme/default.css"> |
|
35 | 35 | |
|
36 | 36 | <link rel="stylesheet" href="static/prettify/prettify.css"/> |
|
37 | 37 | |
|
38 | 38 | <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" /> |
|
39 | 39 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> |
|
40 | 40 | <link rel="stylesheet" href="static/css/base.css" type="text/css" /> |
|
41 | 41 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> |
|
42 | 42 | <link rel="stylesheet" href="static/css/renderedhtml.css" type="text/css" /> |
|
43 | 43 | |
|
44 | 44 | |
|
45 | 45 | </head> |
|
46 | 46 | |
|
47 | 47 | <body onload='CheckMathJax();' |
|
48 | 48 | data-project={{project}} data-notebook-id={{notebook_id}} |
|
49 | 49 | data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}} |
|
50 | 50 | > |
|
51 | 51 | |
|
52 | 52 | <div id="header"> |
|
53 | 53 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> |
|
54 | 54 | <span id="save_widget"> |
|
55 | 55 | <input type="text" id="notebook_name" size="20"></textarea> |
|
56 | 56 | <button id="save_notebook"><u>S</u>ave</button> |
|
57 | 57 | </span> |
|
58 | 58 | <span id="quick_help_area"> |
|
59 | 59 | <button id="quick_help">Quick<u>H</u>elp</button> |
|
60 | 60 | </span> |
|
61 | <span id="kernel_status">Idle</span> | |
|
62 | 61 | </div> |
|
63 | 62 | |
|
64 | 63 | <div id="MathJaxFetchingWarning" |
|
65 | 64 | style="width:80%; margin:auto;padding-top:20%;text-align: justify; display:none"> |
|
66 | 65 | <p style="font-size:26px;">There was an issue trying to fetch MathJax.js |
|
67 | 66 | from the internet.</p> |
|
68 | 67 | |
|
69 | 68 | <p style="padding:0.2em"> With a working internet connection, you can run |
|
70 | 69 | the following at a Python or IPython prompt, which will install a local |
|
71 | 70 | copy of MathJax:</p> |
|
72 | 71 | |
|
73 | 72 | <pre style="background-color:lightblue;border:thin silver solid;padding:0.4em"> |
|
74 | 73 | from IPython.external import mathjax; mathjax.install_mathjax() |
|
75 | 74 | </pre> |
|
76 | 75 | This will try to install MathJax into the directory where you installed |
|
77 | 76 | IPython. If you installed IPython to a location that requires |
|
78 | 77 | administrative privileges to write, you will need to make this call as |
|
79 | 78 | an administrator. On OSX/Linux/Unix, this can be done at the |
|
80 | 79 | command-line via: |
|
81 | 80 | <pre style="background-color:lightblue;border:thin silver solid;padding:0.4em"> |
|
82 | 81 | sudo python -c "from IPython.external import mathjax; mathjax.install_mathjax()" |
|
83 | 82 | </pre> |
|
84 | 83 | </p> |
|
85 | 84 | </div> |
|
86 | 85 | |
|
87 | 86 | <div id="main_app"> |
|
88 | 87 | |
|
89 | 88 | <div id="left_panel"> |
|
90 | 89 | |
|
91 | 90 | <div id="notebook_section"> |
|
92 |
< |
|
|
91 | <div class="section_header"> | |
|
92 | <h3>Notebook</h3> | |
|
93 | </div> | |
|
93 | 94 | <div class="section_content"> |
|
94 | 95 | <div class="section_row"> |
|
95 | 96 | <span id="new_open" class="section_row_buttons"> |
|
96 | 97 | <button id="new_notebook">New</button> |
|
97 | 98 | <button id="open_notebook">Open</button> |
|
98 | 99 | </span> |
|
99 | 100 | <span class="section_row_header">Actions</span> |
|
100 | 101 | </div> |
|
101 | 102 | <div class="section_row"> |
|
102 | 103 | <span> |
|
103 | 104 | <select id="download_format"> |
|
104 | 105 | <option value="json">ipynb</option> |
|
105 | 106 | <option value="py">py</option> |
|
106 | 107 | </select> |
|
107 | 108 | </span> |
|
108 | 109 | <span class="section_row_buttons"> |
|
109 | 110 | <button id="download_notebook">Download</button> |
|
110 | 111 | </span> |
|
111 | 112 | </div> |
|
112 | 113 | <div class="section_row"> |
|
113 | 114 | <span class="section_row_buttons"> |
|
114 | 115 | <span id="print_widget"> |
|
115 | 116 | <button id="print_notebook">Print</button> |
|
116 | 117 | </span> |
|
117 | 118 | </span> |
|
118 | 119 | </div> |
|
119 | 120 | </div> |
|
120 | 121 | </div> |
|
121 | 122 | |
|
122 | 123 | <div id="cell_section"> |
|
123 |
< |
|
|
124 | <div class="section_header"> | |
|
125 | <h3>Cell</h3> | |
|
126 | </div> | |
|
124 | 127 | <div class="section_content"> |
|
125 | 128 | <div class="section_row"> |
|
126 | 129 | <span class="section_row_buttons"> |
|
127 | 130 | <button id="delete_cell"><u>D</u>elete</button> |
|
128 | 131 | </span> |
|
129 | 132 | <span class="section_row_header">Actions</span> |
|
130 | 133 | </div> |
|
131 | 134 | <div class="section_row"> |
|
132 | 135 | <span id="cell_type" class="section_row_buttons"> |
|
133 | 136 | <button id="to_code"><u>C</u>ode</button> |
|
134 | 137 | <!-- <button id="to_html">HTML</button>--> |
|
135 | 138 | <button id="to_markdown"><u>M</u>arkdown</button> |
|
136 | 139 | </span> |
|
137 | 140 | <span class="button_label">Format</span> |
|
138 | 141 | </div> |
|
139 | 142 | <div class="section_row"> |
|
140 | 143 | <span id="cell_output" class="section_row_buttons"> |
|
141 | 144 | <button id="toggle_output"><u>T</u>oggle</button> |
|
142 | 145 | <button id="clear_all_output">ClearAll</button> |
|
143 | 146 | </span> |
|
144 | 147 | <span class="button_label">Output</span> |
|
145 | 148 | </div> |
|
146 | 149 | <div class="section_row"> |
|
147 | 150 | <span id="insert" class="section_row_buttons"> |
|
148 | 151 | <button id="insert_cell_above"><u>A</u>bove</button> |
|
149 | 152 | <button id="insert_cell_below"><u>B</u>elow</button> |
|
150 | 153 | </span> |
|
151 | 154 | <span class="button_label">Insert</span> |
|
152 | 155 | </div> |
|
153 | 156 | <div class="section_row"> |
|
154 | 157 | <span id="move" class="section_row_buttons"> |
|
155 | 158 | <button id="move_cell_up">Up</button> |
|
156 | 159 | <button id="move_cell_down">Down</button> |
|
157 | 160 | </span> |
|
158 | 161 | <span class="button_label">Move</span> |
|
159 | 162 | </div> |
|
160 | 163 | <div class="section_row"> |
|
161 | 164 | <span id="run_cells" class="section_row_buttons"> |
|
162 | 165 | <button id="run_selected_cell">Selected</button> |
|
163 | 166 | <button id="run_all_cells">All</button> |
|
164 | 167 | </span> |
|
165 | 168 | <span class="button_label">Run</span> |
|
166 | 169 | </div> |
|
167 | 170 | <div class="section_row"> |
|
168 | 171 | <span id="autoindent_span"> |
|
169 | 172 | <input type="checkbox" id="autoindent" checked="true"></input> |
|
170 | 173 | </span> |
|
171 | 174 | <span class="checkbox_label" id="autoindent_label">Autoindent:</span> |
|
172 | 175 | </div> |
|
173 | 176 | </div> |
|
174 | 177 | </div> |
|
175 | 178 | |
|
176 | 179 | <div id="kernel_section"> |
|
177 |
< |
|
|
180 | <div class="section_header"> | |
|
181 | <h3>Kernel</h3> | |
|
182 | <span id="kernel_status">Idle</span> | |
|
183 | </div> | |
|
178 | 184 | <div class="section_content"> |
|
179 | 185 | <div class="section_row"> |
|
180 | 186 | <span id="int_restart" class="section_row_buttons"> |
|
181 | 187 | <button id="int_kernel"><u>I</u>nterrupt</button> |
|
182 | 188 | <button id="restart_kernel">Restart</button> |
|
183 | 189 | </span> |
|
184 | 190 | <span class="section_row_header">Actions</span> |
|
185 | 191 | </div> |
|
186 | 192 | <div class="section_row"> |
|
187 | 193 | <span id="kernel_persist"> |
|
188 | 194 | <input type="checkbox" id="kill_kernel"></input> |
|
189 | 195 | </span> |
|
190 | 196 | <span class="checkbox_label" id="kill_kernel_label">Kill kernel upon exit:</span> |
|
191 | 197 | </div> |
|
192 | 198 | </div> |
|
193 | 199 | </div> |
|
194 | 200 | |
|
195 | 201 | <div id="help_section"> |
|
196 |
< |
|
|
202 | <div class="section_header"> | |
|
203 | <h3>Cell</h3> | |
|
204 | </div> | |
|
197 | 205 | <div class="section_content"> |
|
198 | 206 | <div class="section_row"> |
|
199 | 207 | <span id="help_buttons0" class="section_row_buttons"> |
|
200 | 208 | <a id="python_help" href="http://docs.python.org" target="_blank">Python</a> |
|
201 | 209 | <a id="ipython_help" href="http://ipython.org/documentation.html" target="_blank">IPython</a> |
|
202 | 210 | </span> |
|
203 | 211 | <span class="section_row_header">Links</span> |
|
204 | 212 | </div> |
|
205 | 213 | <div class="section_row"> |
|
206 | 214 | <span id="help_buttons1" class="section_row_buttons"> |
|
207 | 215 | <a id="numpy_help" href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a> |
|
208 | 216 | <a id="scipy_help" href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a> |
|
209 | 217 | </span> |
|
210 | 218 | </div> |
|
211 | 219 | <div class="section_row"> |
|
212 | 220 | <span id="help_buttons2" class="section_row_buttons"> |
|
213 | 221 | <a id="matplotlib_help" href="http://matplotlib.sourceforge.net/" target="_blank">MPL</a> |
|
214 | 222 | <a id="sympy_help" href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a> |
|
215 | 223 | </span> |
|
216 | 224 | </div> |
|
217 | 225 | <div class="section_row"> |
|
218 | 226 | <span class="help_string">run selected cell</span> |
|
219 | 227 | <span class="help_string_label">Shift-Enter :</span> |
|
220 | 228 | </div> |
|
221 | 229 | <div class="section_row"> |
|
222 | 230 | <span class="help_string">run selected cell in-place</span> |
|
223 | 231 | <span class="help_string_label">Ctrl-Enter :</span> |
|
224 | 232 | </div> |
|
225 | 233 | <div class="section_row"> |
|
226 | 234 | <span class="help_string">show keyboard shortcuts</span> |
|
227 | 235 | <span class="help_string_label">Ctrl-m h :</span> |
|
228 | 236 | </div> |
|
229 | 237 | </div> |
|
230 | 238 | </div> |
|
231 | 239 | |
|
232 | 240 | </div> |
|
233 | 241 | <div id="left_panel_splitter"></div> |
|
234 | 242 | <div id="notebook_panel"> |
|
235 | 243 | <div id="notebook"></div> |
|
236 | 244 | <div id="pager_splitter"></div> |
|
237 | 245 | <div id="pager"></div> |
|
238 | 246 | </div> |
|
239 | 247 | |
|
240 | 248 | </div> |
|
241 | 249 | |
|
242 | 250 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> |
|
243 | 251 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> |
|
244 | 252 | <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script> |
|
245 | 253 | |
|
246 | 254 | <script src="static/codemirror/lib/codemirror.js" charset="utf-8"></script> |
|
247 | 255 | <script src="static/codemirror/mode/python/python.js" charset="utf-8"></script> |
|
248 | 256 | <script src="static/codemirror/mode/htmlmixed/htmlmixed.js" charset="utf-8"></script> |
|
249 | 257 | <script src="static/codemirror/mode/xml/xml.js" charset="utf-8"></script> |
|
250 | 258 | <script src="static/codemirror/mode/javascript/javascript.js" charset="utf-8"></script> |
|
251 | 259 | <script src="static/codemirror/mode/css/css.js" charset="utf-8"></script> |
|
252 | 260 | <script src="static/codemirror/mode/rst/rst.js" charset="utf-8"></script> |
|
253 | 261 | <script src="static/codemirror/mode/markdown/markdown.js" charset="utf-8"></script> |
|
254 | 262 | |
|
255 | 263 | <script src="static/pagedown/Markdown.Converter.js" charset="utf-8"></script> |
|
256 | 264 | |
|
257 | 265 | <script src="static/prettify/prettify.js" charset="utf-8"></script> |
|
258 | 266 | |
|
259 | 267 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> |
|
260 | 268 | <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script> |
|
261 | 269 | <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script> |
|
262 | 270 | <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script> |
|
263 | 271 | <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script> |
|
264 | 272 | <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script> |
|
265 | 273 | <script src="static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script> |
|
266 | 274 | <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script> |
|
267 | 275 | <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script> |
|
268 | 276 | <script src="static/js/quickhelp.js" type="text/javascript" charset="utf-8"></script> |
|
269 | 277 | <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script> |
|
270 | 278 | <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script> |
|
271 | 279 | <script src="static/js/printwidget.js" type="text/javascript" charset="utf-8"></script> |
|
272 | 280 | <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script> |
|
273 | 281 | <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script> |
|
274 | 282 | <script src="static/js/notebookmain.js" type="text/javascript" charset="utf-8"></script> |
|
275 | 283 | |
|
276 | 284 | </body> |
|
277 | 285 | |
|
278 | 286 | </html> |
General Comments 0
You need to be logged in to leave comments.
Login now