Show More
@@ -0,0 +1,82 b'' | |||
|
1 | //---------------------------------------------------------------------------- | |
|
2 | // Copyright (C) 2008-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 ToolBar = function (selector) { | |
|
15 | this.selector = selector; | |
|
16 | if (this.selector !== undefined) { | |
|
17 | this.element = $(selector); | |
|
18 | this.style(); | |
|
19 | this.bind_events(); | |
|
20 | } | |
|
21 | }; | |
|
22 | ||
|
23 | ||
|
24 | ToolBar.prototype.style = function () { | |
|
25 | this.element.addClass('border-box-sizing'); | |
|
26 | this.element.find('#save_b').button({ | |
|
27 | icons : {primary: 'ui-icon-disk'}, | |
|
28 | text : false | |
|
29 | }); | |
|
30 | this.element.find('#cut_b').button({ | |
|
31 | icons: {primary: 'ui-icon-scissors'}, | |
|
32 | text : false | |
|
33 | }); | |
|
34 | this.element.find('#copy_b').button({ | |
|
35 | icons: {primary: 'ui-icon-copy'}, | |
|
36 | text : false | |
|
37 | }); | |
|
38 | this.element.find('#paste_b').button({ | |
|
39 | icons: {primary: 'ui-icon-clipboard'}, | |
|
40 | text : false | |
|
41 | }); | |
|
42 | this.element.find('#cut_copy_paste').buttonset(); | |
|
43 | this.element.find('#move_up_b').button({ | |
|
44 | icons: {primary: 'ui-icon-arrowthick-1-n'}, | |
|
45 | text : false | |
|
46 | }); | |
|
47 | this.element.find('#move_down_b').button({ | |
|
48 | icons: {primary: 'ui-icon-arrowthick-1-s'}, | |
|
49 | text : false | |
|
50 | }); | |
|
51 | this.element.find('#move_up_down').buttonset(); | |
|
52 | this.element.find('#insert_above_b').button({ | |
|
53 | icons: {primary: 'ui-icon-arrowthickstop-1-n'}, | |
|
54 | text : false | |
|
55 | }); | |
|
56 | this.element.find('#insert_below_b').button({ | |
|
57 | icons: {primary: 'ui-icon-arrowthickstop-1-s'}, | |
|
58 | text : false | |
|
59 | }); | |
|
60 | this.element.find('#insert_above_below').buttonset(); | |
|
61 | this.element.find('#run_b').button({ | |
|
62 | icons: {primary: 'ui-icon-play'}, | |
|
63 | text : false | |
|
64 | }); | |
|
65 | this.element.find('#interrupt_b').button({ | |
|
66 | icons: {primary: 'ui-icon-stop'}, | |
|
67 | text : false | |
|
68 | }); | |
|
69 | this.element.find('#run_int').buttonset(); | |
|
70 | }; | |
|
71 | ||
|
72 | ||
|
73 | ToolBar.prototype.bind_events = function () { | |
|
74 | ||
|
75 | }; | |
|
76 | ||
|
77 | ||
|
78 | IPython.ToolBar = ToolBar; | |
|
79 | ||
|
80 | return IPython; | |
|
81 | ||
|
82 | }(IPython)); |
@@ -1,383 +1,389 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 | padding: 5px; |
|
22 | 22 | margin: 0px 0px 0px 300px; |
|
23 | 23 | display:inline-block; |
|
24 | 24 | } |
|
25 | 25 | |
|
26 | 26 | span#notebook_name { |
|
27 | 27 | height: 1em; |
|
28 | 28 | line-height: 1em; |
|
29 | 29 | padding: 3px; |
|
30 | 30 | border: none; |
|
31 | 31 | font-size: 146.5%; |
|
32 | 32 | } |
|
33 | 33 | |
|
34 | 34 | #menubar { |
|
35 | 35 | /* Initially hidden to prevent FLOUC */ |
|
36 | 36 | display: none; |
|
37 | 37 | } |
|
38 | 38 | |
|
39 | 39 | .ui-menubar-item .ui-button .ui-button-text { |
|
40 | 40 | padding: 0.4em 1.0em; |
|
41 | 41 | font-size: 100%; |
|
42 | 42 | } |
|
43 | 43 | |
|
44 | 44 | .ui-menu { |
|
45 | 45 | -moz-box-shadow: 0px 6px 10px -1px #adadad; |
|
46 | 46 | -webkit-box-shadow: 0px 6px 10px -1px #adadad; |
|
47 | 47 | box-shadow: 0px 6px 10px -1px #adadad; |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | .ui-menu .ui-menu-item a { |
|
51 | 51 | padding: 2px 1.6em; |
|
52 | 52 | } |
|
53 | 53 | |
|
54 | 54 | .ui-menu hr { |
|
55 | 55 | margin: 0.3em 0; |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | #toolbar { | |
|
59 | /* Initially hidden to prevent FLOUC */ | |
|
60 | display: none; | |
|
61 | padding: 3px 15px; | |
|
62 | } | |
|
63 | ||
|
58 | 64 | span#quick_help_area { |
|
59 | 65 | position: static; |
|
60 | 66 | padding: 5px 0px; |
|
61 | 67 | margin: 0px 0px 0px 0px; |
|
62 | 68 | } |
|
63 | 69 | |
|
64 | 70 | span#kernel_status { |
|
65 | 71 | position: absolute; |
|
66 | 72 | padding: 8px 5px 5px 5px; |
|
67 | 73 | right: 10px; |
|
68 | 74 | font-weight: bold; |
|
69 | 75 | } |
|
70 | 76 | |
|
71 | 77 | |
|
72 | 78 | .status_idle { |
|
73 | 79 | color: gray; |
|
74 | 80 | visibility: hidden; |
|
75 | 81 | } |
|
76 | 82 | |
|
77 | 83 | .status_busy { |
|
78 | 84 | color: red; |
|
79 | 85 | } |
|
80 | 86 | |
|
81 | 87 | .status_restarting { |
|
82 | 88 | color: black; |
|
83 | 89 | } |
|
84 | 90 | |
|
85 | 91 | #kernel_persist { |
|
86 | 92 | float: right; |
|
87 | 93 | } |
|
88 | 94 | |
|
89 | 95 | .help_string { |
|
90 | 96 | float: right; |
|
91 | 97 | width: 170px; |
|
92 | 98 | padding: 0px 5px; |
|
93 | 99 | text-align: left; |
|
94 | 100 | font-size: 85%; |
|
95 | 101 | } |
|
96 | 102 | |
|
97 | 103 | .help_string_label { |
|
98 | 104 | float: right; |
|
99 | 105 | font-size: 85%; |
|
100 | 106 | } |
|
101 | 107 | |
|
102 | 108 | div#notebook_panel { |
|
103 | 109 | margin: 0px 0px 0px 0px; |
|
104 | 110 | padding: 0px; |
|
105 | 111 | } |
|
106 | 112 | |
|
107 | 113 | div#notebook { |
|
108 | 114 | overflow-y: scroll; |
|
109 | 115 | overflow-x: auto; |
|
110 | 116 | width: 100%; |
|
111 | 117 | /* This spaces the cell away from the edge of the notebook area */ |
|
112 | 118 | padding: 5px 5px 15px 5px; |
|
113 | 119 | margin: 0px |
|
114 | 120 | background-color: white; |
|
115 | 121 | } |
|
116 | 122 | |
|
117 | 123 | div#pager_splitter { |
|
118 | 124 | height: 8px; |
|
119 | 125 | } |
|
120 | 126 | |
|
121 | 127 | div#pager { |
|
122 | 128 | padding: 15px; |
|
123 | 129 | overflow: auto; |
|
124 | 130 | display: none; |
|
125 | 131 | } |
|
126 | 132 | |
|
127 | 133 | div.cell { |
|
128 | 134 | width: 100%; |
|
129 | 135 | padding: 5px 5px 5px 0px; |
|
130 | 136 | /* This acts as a spacer between cells, that is outside the border */ |
|
131 | 137 | margin: 2px 0px 2px 0px; |
|
132 | 138 | } |
|
133 | 139 | |
|
134 | 140 | div.code_cell { |
|
135 | 141 | background-color: white; |
|
136 | 142 | } |
|
137 | 143 | /* any special styling for code cells that are currently running goes here */ |
|
138 | 144 | div.code_cell.running { |
|
139 | 145 | } |
|
140 | 146 | |
|
141 | 147 | div.prompt { |
|
142 | 148 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ |
|
143 | 149 | width: 11ex; |
|
144 | 150 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ |
|
145 | 151 | padding: 0.4em; |
|
146 | 152 | margin: 0px; |
|
147 | 153 | font-family: monospace; |
|
148 | 154 | text-align:right; |
|
149 | 155 | } |
|
150 | 156 | |
|
151 | 157 | div.input { |
|
152 | 158 | page-break-inside: avoid; |
|
153 | 159 | } |
|
154 | 160 | |
|
155 | 161 | /* input_area and input_prompt must match in top border and margin for alignment */ |
|
156 | 162 | div.input_area { |
|
157 | 163 | color: black; |
|
158 | 164 | border: 1px solid #ddd; |
|
159 | 165 | border-radius: 3px; |
|
160 | 166 | background: #f7f7f7; |
|
161 | 167 | } |
|
162 | 168 | |
|
163 | 169 | div.input_prompt { |
|
164 | 170 | color: navy; |
|
165 | 171 | border-top: 1px solid transparent; |
|
166 | 172 | } |
|
167 | 173 | |
|
168 | 174 | div.output { |
|
169 | 175 | /* This is a spacer between the input and output of each cell */ |
|
170 | 176 | margin-top: 5px; |
|
171 | 177 | } |
|
172 | 178 | |
|
173 | 179 | div.output_prompt { |
|
174 | 180 | color: darkred; |
|
175 | 181 | } |
|
176 | 182 | |
|
177 | 183 | /* This class is the outer container of all output sections. */ |
|
178 | 184 | div.output_area { |
|
179 | 185 | padding: 0px; |
|
180 | 186 | page-break-inside: avoid; |
|
181 | 187 | } |
|
182 | 188 | |
|
183 | 189 | /* This class is for the output subarea inside the output_area and after |
|
184 | 190 | the prompt div. */ |
|
185 | 191 | div.output_subarea { |
|
186 | 192 | padding: 0.4em 6.1em 0.4em 0.4em; |
|
187 | 193 | } |
|
188 | 194 | |
|
189 | 195 | /* The rest of the output_* classes are for special styling of the different |
|
190 | 196 | output types */ |
|
191 | 197 | |
|
192 | 198 | /* all text output has this class: */ |
|
193 | 199 | div.output_text { |
|
194 | 200 | text-align: left; |
|
195 | 201 | color: black; |
|
196 | 202 | font-family: monospace; |
|
197 | 203 | } |
|
198 | 204 | |
|
199 | 205 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ |
|
200 | 206 | div.output_stream { |
|
201 | 207 | padding-top: 0.0em; |
|
202 | 208 | padding-bottom: 0.0em; |
|
203 | 209 | } |
|
204 | 210 | div.output_stdout { |
|
205 | 211 | } |
|
206 | 212 | div.output_stderr { |
|
207 | 213 | background: #fdd; /* very light red background for stderr */ |
|
208 | 214 | } |
|
209 | 215 | |
|
210 | 216 | div.output_latex { |
|
211 | 217 | text-align: left; |
|
212 | 218 | color: black; |
|
213 | 219 | } |
|
214 | 220 | |
|
215 | 221 | div.output_html { |
|
216 | 222 | } |
|
217 | 223 | |
|
218 | 224 | div.output_png { |
|
219 | 225 | } |
|
220 | 226 | |
|
221 | 227 | div.output_jpeg { |
|
222 | 228 | } |
|
223 | 229 | |
|
224 | 230 | div.text_cell { |
|
225 | 231 | background-color: white; |
|
226 | 232 | padding: 5px 5px 5px 5px; |
|
227 | 233 | } |
|
228 | 234 | |
|
229 | 235 | div.text_cell_input { |
|
230 | 236 | color: black; |
|
231 | 237 | border: 1px solid #ddd; |
|
232 | 238 | border-radius: 3px; |
|
233 | 239 | background: #f7f7f7; |
|
234 | 240 | } |
|
235 | 241 | |
|
236 | 242 | div.text_cell_render { |
|
237 | 243 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
238 | 244 | outline: none; |
|
239 | 245 | resize: none; |
|
240 | 246 | width: inherit; |
|
241 | 247 | border-style: none; |
|
242 | 248 | padding: 5px; |
|
243 | 249 | color: black; |
|
244 | 250 | } |
|
245 | 251 | |
|
246 | 252 | .CodeMirror { |
|
247 | 253 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
248 | 254 | } |
|
249 | 255 | |
|
250 | 256 | .CodeMirror-scroll { |
|
251 | 257 | height: auto; /* Changed to auto to autogrow */ |
|
252 | 258 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ |
|
253 | 259 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ |
|
254 | 260 | overflow-y: hidden; |
|
255 | 261 | overflow-x: auto; /* Changed from auto to remove scrollbar */ |
|
256 | 262 | } |
|
257 | 263 | |
|
258 | 264 | /* CSS font colors for translated ANSI colors. */ |
|
259 | 265 | |
|
260 | 266 | |
|
261 | 267 | .ansiblack {color: black;} |
|
262 | 268 | .ansired {color: darkred;} |
|
263 | 269 | .ansigreen {color: darkgreen;} |
|
264 | 270 | .ansiyellow {color: brown;} |
|
265 | 271 | .ansiblue {color: darkblue;} |
|
266 | 272 | .ansipurple {color: darkviolet;} |
|
267 | 273 | .ansicyan {color: steelblue;} |
|
268 | 274 | .ansigrey {color: grey;} |
|
269 | 275 | .ansibold {font-weight: bold;} |
|
270 | 276 | |
|
271 | 277 | .completions , .tooltip { |
|
272 | 278 | position: absolute; |
|
273 | 279 | z-index: 10; |
|
274 | 280 | overflow: auto; |
|
275 | 281 | border: 1px solid black; |
|
276 | 282 | } |
|
277 | 283 | |
|
278 | 284 | .completions select { |
|
279 | 285 | background: white; |
|
280 | 286 | outline: none; |
|
281 | 287 | border: none; |
|
282 | 288 | padding: 0px; |
|
283 | 289 | margin: 0px; |
|
284 | 290 | font-family: monospace; |
|
285 | 291 | } |
|
286 | 292 | |
|
287 | 293 | @-moz-keyframes fadeIn { |
|
288 | 294 | from {opacity:0;} |
|
289 | 295 | to {opacity:1;} |
|
290 | 296 | } |
|
291 | 297 | |
|
292 | 298 | @-webkit-keyframes fadeIn { |
|
293 | 299 | from {opacity:0;} |
|
294 | 300 | to {opacity:1;} |
|
295 | 301 | } |
|
296 | 302 | |
|
297 | 303 | @keyframes fadeIn { |
|
298 | 304 | from {opacity:0;} |
|
299 | 305 | to {opacity:1;} |
|
300 | 306 | } |
|
301 | 307 | |
|
302 | 308 | /*"close" "expand" and "Open in pager button" of |
|
303 | 309 | /* the tooltip*/ |
|
304 | 310 | .tooltip a { |
|
305 | 311 | float:right; |
|
306 | 312 | } |
|
307 | 313 | |
|
308 | 314 | /*properties of tooltip after "expand"*/ |
|
309 | 315 | .bigtooltip { |
|
310 | 316 | height:30%; |
|
311 | 317 | } |
|
312 | 318 | |
|
313 | 319 | /*properties of tooltip before "expand"*/ |
|
314 | 320 | .smalltooltip { |
|
315 | 321 | text-overflow: ellipsis; |
|
316 | 322 | overflow: hidden; |
|
317 | 323 | height:15%; |
|
318 | 324 | } |
|
319 | 325 | |
|
320 | 326 | .tooltip { |
|
321 | 327 | /*transition when "expand"ing tooltip */ |
|
322 | 328 | -webkit-transition-property: height; |
|
323 | 329 | -webkit-transition-duration: 1s; |
|
324 | 330 | -moz-transition-property: height; |
|
325 | 331 | -moz-transition-duration: 1s; |
|
326 | 332 | transition-property: height; |
|
327 | 333 | transition-duration: 1s; |
|
328 | 334 | max-width:700px; |
|
329 | 335 | border-radius: 0px 10px 10px 10px; |
|
330 | 336 | box-shadow: 3px 3px 5px #999; |
|
331 | 337 | /*fade-in animation when inserted*/ |
|
332 | 338 | -webkit-animation: fadeIn 200ms; |
|
333 | 339 | -moz-animation: fadeIn 200ms; |
|
334 | 340 | animation: fadeIn 200ms; |
|
335 | 341 | vertical-align: middle; |
|
336 | 342 | background: #FDFDD8; |
|
337 | 343 | outline: none; |
|
338 | 344 | padding: 3px; |
|
339 | 345 | margin: 0px; |
|
340 | 346 | font-family: monospace; |
|
341 | 347 | min-height:50px; |
|
342 | 348 | } |
|
343 | 349 | |
|
344 | 350 | /*fixed part of the completion*/ |
|
345 | 351 | .completions p b { |
|
346 | 352 | font-weight:bold; |
|
347 | 353 | } |
|
348 | 354 | |
|
349 | 355 | .completions p { |
|
350 | 356 | background: #DDF; |
|
351 | 357 | /*outline: none; |
|
352 | 358 | padding: 0px;*/ |
|
353 | 359 | border-bottom: black solid 1px; |
|
354 | 360 | padding: 1px; |
|
355 | 361 | font-family: monospace; |
|
356 | 362 | } |
|
357 | 363 | |
|
358 | 364 | pre.dialog { |
|
359 | 365 | background-color: #f7f7f7; |
|
360 | 366 | border: 1px solid #ddd; |
|
361 | 367 | border-radius: 3px; |
|
362 | 368 | padding: 0.4em; |
|
363 | 369 | padding-left: 2em; |
|
364 | 370 | } |
|
365 | 371 | |
|
366 | 372 | p.dialog { |
|
367 | 373 | padding : 0.2em; |
|
368 | 374 | } |
|
369 | 375 | |
|
370 | 376 | .shortcut_key { |
|
371 | 377 | display: inline-block; |
|
372 | 378 | width: 15ex; |
|
373 | 379 | text-align: right; |
|
374 | 380 | font-family: monospace; |
|
375 | 381 | } |
|
376 | 382 | |
|
377 | 383 | .shortcut_descr { |
|
378 | 384 | } |
|
379 | 385 | |
|
380 | 386 | /* Word-wrap output correctly. This is the CSS3 spelling, though Firefox seems |
|
381 | 387 | to not honor it correctly. Webkit browsers (Chrome, rekonq, Safari) do. |
|
382 | 388 | */ |
|
383 | 389 | pre, code, kbd, samp { white-space: pre-wrap; } |
@@ -1,48 +1,49 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 | // Layout |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | |
|
14 | 14 | var LayoutManager = function () { |
|
15 | 15 | this.bind_events(); |
|
16 | 16 | }; |
|
17 | 17 | |
|
18 | 18 | |
|
19 | 19 | LayoutManager.prototype.bind_events = function () { |
|
20 | 20 | $(window).resize($.proxy(this.do_resize,this)); |
|
21 | 21 | }; |
|
22 | 22 | |
|
23 | 23 | |
|
24 | 24 | LayoutManager.prototype.do_resize = function () { |
|
25 | 25 | var win = $(window); |
|
26 | 26 | var w = win.width(); |
|
27 | 27 | var h = win.height(); |
|
28 | 28 | var header_height = $('div#header').outerHeight(true); |
|
29 | 29 | var menubar_height = $('div#menubar').outerHeight(true); |
|
30 | var app_height = h-header_height-menubar_height-2; // content height | |
|
30 | var toolbar_height = $('div#toolbar').outerHeight(true); | |
|
31 | var app_height = h-header_height-menubar_height-toolbar_height-2; // content height | |
|
31 | 32 | |
|
32 | 33 | $('div#main_app').height(app_height + 2); // content+padding+border height |
|
33 | 34 | |
|
34 | 35 | var pager_height = IPython.pager.percentage_height*app_height; |
|
35 | 36 | var pager_splitter_height = $('div#pager_splitter').outerHeight(true); |
|
36 | 37 | $('div#pager').height(pager_height); |
|
37 | 38 | if (IPython.pager.expanded) { |
|
38 | 39 | $('div#notebook').height(app_height-pager_height-pager_splitter_height); |
|
39 | 40 | } else { |
|
40 | 41 | $('div#notebook').height(app_height-pager_splitter_height); |
|
41 | 42 | } |
|
42 | 43 | }; |
|
43 | 44 | |
|
44 | 45 | IPython.LayoutManager = LayoutManager; |
|
45 | 46 | |
|
46 | 47 | return IPython; |
|
47 | 48 | |
|
48 | 49 | }(IPython)); |
@@ -1,115 +1,117 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 | // On document ready |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | $(document).ready(function () { |
|
14 | 14 | if (window.MathJax){ |
|
15 | 15 | // MathJax loaded |
|
16 | 16 | MathJax.Hub.Config({ |
|
17 | 17 | tex2jax: { |
|
18 | 18 | inlineMath: [ ['$','$'], ["\\(","\\)"] ], |
|
19 | 19 | displayMath: [ ['$$','$$'], ["\\[","\\]"] ] |
|
20 | 20 | }, |
|
21 | 21 | displayAlign: 'left', // Change this to 'center' to center equations. |
|
22 | 22 | "HTML-CSS": { |
|
23 | 23 | styles: {'.MathJax_Display': {"margin": 0}} |
|
24 | 24 | } |
|
25 | 25 | }); |
|
26 | 26 | }else if (window.mathjax_url != ""){ |
|
27 | 27 | // Don't have MathJax, but should. Show dialog. |
|
28 | 28 | var dialog = $('<div></div>') |
|
29 | 29 | .append( |
|
30 | 30 | $("<p></p>").addClass('dialog').html( |
|
31 | 31 | "Math/LaTeX rendering will be disabled." |
|
32 | 32 | ) |
|
33 | 33 | ).append( |
|
34 | 34 | $("<p></p>").addClass('dialog').html( |
|
35 | 35 | "If you have administrative access to the notebook server and" + |
|
36 | 36 | " a working internet connection, you can install a local copy" + |
|
37 | 37 | " of MathJax for offline use with the following command on the server" + |
|
38 | 38 | " at a Python or IPython prompt:" |
|
39 | 39 | ) |
|
40 | 40 | ).append( |
|
41 | 41 | $("<pre></pre>").addClass('dialog').html( |
|
42 | 42 | ">>> from IPython.external import mathjax; mathjax.install_mathjax()" |
|
43 | 43 | ) |
|
44 | 44 | ).append( |
|
45 | 45 | $("<p></p>").addClass('dialog').html( |
|
46 | 46 | "This will try to install MathJax into the IPython source directory." |
|
47 | 47 | ) |
|
48 | 48 | ).append( |
|
49 | 49 | $("<p></p>").addClass('dialog').html( |
|
50 | 50 | "If IPython is installed to a location that requires" + |
|
51 | 51 | " administrative privileges to write, you will need to make this call as" + |
|
52 | 52 | " an administrator, via 'sudo'." |
|
53 | 53 | ) |
|
54 | 54 | ).append( |
|
55 | 55 | $("<p></p>").addClass('dialog').html( |
|
56 | 56 | "When you start the notebook server, you can instruct it to disable MathJax support altogether:" |
|
57 | 57 | ) |
|
58 | 58 | ).append( |
|
59 | 59 | $("<pre></pre>").addClass('dialog').html( |
|
60 | 60 | "$ ipython notebook --no-mathjax" |
|
61 | 61 | ) |
|
62 | 62 | ).append( |
|
63 | 63 | $("<p></p>").addClass('dialog').html( |
|
64 | 64 | "which will prevent this dialog from appearing." |
|
65 | 65 | ) |
|
66 | 66 | ).dialog({ |
|
67 | 67 | title: "Failed to retrieve MathJax from '" + window.mathjax_url + "'", |
|
68 | 68 | width: "70%", |
|
69 | 69 | modal: true, |
|
70 | 70 | }) |
|
71 | 71 | }else{ |
|
72 | 72 | // No MathJax, but none expected. No dialog. |
|
73 | 73 | } |
|
74 | 74 | |
|
75 | 75 | |
|
76 | 76 | IPython.markdown_converter = new Markdown.Converter(); |
|
77 | 77 | IPython.read_only = $('meta[name=read_only]').attr("content") == 'True'; |
|
78 | 78 | |
|
79 | 79 | $('div#header').addClass('border-box-sizing'); |
|
80 | 80 | $('div#main_app').addClass('border-box-sizing ui-widget ui-widget-content'); |
|
81 | 81 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); |
|
82 | 82 | |
|
83 | 83 | IPython.layout_manager = new IPython.LayoutManager(); |
|
84 | 84 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); |
|
85 | 85 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); |
|
86 | 86 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); |
|
87 | 87 | IPython.login_widget = new IPython.LoginWidget('span#login_widget'); |
|
88 | 88 | IPython.notebook = new IPython.Notebook('div#notebook'); |
|
89 | 89 | IPython.kernel_status_widget = new IPython.KernelStatusWidget('#kernel_status'); |
|
90 | 90 | IPython.menubar = new IPython.MenuBar('#menubar') |
|
91 | IPython.toolbar = new IPython.ToolBar('#toolbar') | |
|
91 | 92 | IPython.kernel_status_widget.status_idle(); |
|
92 | 93 | |
|
93 | 94 | IPython.layout_manager.do_resize(); |
|
94 | 95 | |
|
95 | 96 | // These have display: none in the css file and are made visible here to prevent FLOUC. |
|
96 | 97 | $('div#header').css('display','block'); |
|
97 | 98 | |
|
98 | 99 | if(IPython.read_only){ |
|
99 | 100 | // hide various elements from read-only view |
|
100 | 101 | $('div#pager').remove(); |
|
101 | 102 | $('div#pager_splitter').remove(); |
|
102 | 103 | $('span#login_widget').removeClass('hidden'); |
|
103 | 104 | |
|
104 | 105 | // set the notebook name field as not modifiable |
|
105 | 106 | $('#notebook_name').attr('disabled','disabled') |
|
106 | 107 | } |
|
107 | 108 | |
|
108 | 109 | $('div#menubar').css('display','block'); |
|
110 | $('div#toolbar').css('display','block'); | |
|
109 | 111 | $('div#main_app').css('display','block'); |
|
110 | 112 | |
|
111 | 113 | IPython.layout_manager.do_resize(); |
|
112 | 114 | IPython.notebook.load_notebook(); |
|
113 | 115 | |
|
114 | 116 | }); |
|
115 | 117 |
@@ -1,189 +1,221 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 | {% if mathjax_url %} |
|
10 | 10 | <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML" charset="utf-8"></script> |
|
11 | 11 | {% end %} |
|
12 | 12 | <script type="text/javascript"> |
|
13 | 13 | // MathJax disabled, set as null to distingish from *missing* MathJax, |
|
14 | 14 | // where it will be undefined, and should prompt a dialog later. |
|
15 | 15 | window.mathjax_url = "{{mathjax_url}}"; |
|
16 | 16 | </script> |
|
17 | 17 | |
|
18 | 18 | <link rel="stylesheet" href="/static/jquery/css/themes/base/jquery-ui.min.css" type="text/css" /> |
|
19 | 19 | <link rel="stylesheet" href="/static/codemirror/lib/codemirror.css"> |
|
20 | 20 | <link rel="stylesheet" href="/static/codemirror/theme/ipython.css"> |
|
21 | 21 | |
|
22 | 22 | <link rel="stylesheet" href="/static/prettify/prettify.css"/> |
|
23 | 23 | |
|
24 | 24 | <link rel="stylesheet" href="/static/css/boilerplate.css" type="text/css" /> |
|
25 | 25 | <link rel="stylesheet" href="/static/css/layout.css" type="text/css" /> |
|
26 | 26 | <link rel="stylesheet" href="/static/css/base.css" type="text/css" /> |
|
27 | 27 | <link rel="stylesheet" href="/static/css/notebook.css" type="text/css" /> |
|
28 | 28 | <link rel="stylesheet" href="/static/css/renderedhtml.css" type="text/css" /> |
|
29 | 29 | |
|
30 | 30 | {% comment In the notebook, the read-only flag is used to determine %} |
|
31 | 31 | {% comment whether to hide the side panels and switch off input %} |
|
32 | 32 | <meta name="read_only" content="{{read_only and not logged_in}}"/> |
|
33 | 33 | |
|
34 | 34 | </head> |
|
35 | 35 | |
|
36 | 36 | <body |
|
37 | 37 | data-project={{project}} data-notebook-id={{notebook_id}} |
|
38 | 38 | data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}} |
|
39 | 39 | > |
|
40 | 40 | |
|
41 | 41 | <div id="header"> |
|
42 | 42 | <span id="ipython_notebook"><h1><a href='..' alt='dashboard'><img src='/static/ipynblogo.png' alt='IPython Notebook'/></a></h1></span> |
|
43 | 43 | <span id="save_widget"> |
|
44 | 44 | <span id="notebook_name"></span> |
|
45 | 45 | <span id="save_status"></span> |
|
46 | 46 | </span> |
|
47 | 47 | |
|
48 | 48 | <span id="login_widget"> |
|
49 | 49 | {% comment This is a temporary workaround to hide the logout button %} |
|
50 | 50 | {% comment when appropriate until notebook.html is templated %} |
|
51 | 51 | {% if logged_in %} |
|
52 | 52 | <button id="logout">Logout</button> |
|
53 | 53 | {% elif not logged_in and login_available %} |
|
54 | 54 | <button id="login">Login</button> |
|
55 | 55 | {% end %} |
|
56 | 56 | </span> |
|
57 | 57 | |
|
58 | 58 | <span id="kernel_status">Idle</span> |
|
59 | 59 | </div> |
|
60 | 60 | |
|
61 | 61 | <div id="menubar"> |
|
62 | 62 | <ul id="menus"> |
|
63 | 63 | <li><a href="#">File</a> |
|
64 | 64 | <ul> |
|
65 | 65 | <li id="new_notebook"><a href="#">New</a></li> |
|
66 | 66 | <li id="open_notebook"><a href="#">Open...</a></li> |
|
67 | 67 | <hr/> |
|
68 | 68 | <li id="copy_notebook"><a href="#">Make a Copy...</a></li> |
|
69 | 69 | <li id="rename_notebook"><a href="#">Rename...</a></li> |
|
70 | 70 | <li id="save_notebook"><a href="#">Save</a></li> |
|
71 | 71 | <hr/> |
|
72 | 72 | <li><a href="#">Download as</a> |
|
73 | 73 | <ul> |
|
74 | 74 | <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li> |
|
75 | 75 | <li id="download_py"><a href="#">Python (.py)</a></li> |
|
76 | 76 | </ul> |
|
77 | 77 | </li> |
|
78 | 78 | <hr/> |
|
79 | 79 | <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li> |
|
80 | 80 | </ul> |
|
81 | 81 | </li> |
|
82 | 82 | <li><a href="#">Edit</a> |
|
83 | 83 | <ul> |
|
84 | 84 | <li id="cut_cell"><a href="#">Cut</a></li> |
|
85 | 85 | <li id="copy_cell"><a href="#">Copy</a></li> |
|
86 | 86 | <li id="paste_cell" class="ui-state-disabled"><a href="#">Paste</a></li> |
|
87 | 87 | <li id="paste_cell_above" class="ui-state-disabled"><a href="#">Paste Above</a></li> |
|
88 | 88 | <li id="paste_cell_below" class="ui-state-disabled"><a href="#">Paste Below</a></li> |
|
89 | 89 | <li id="delete_cell"><a href="#">Delete</a></li> |
|
90 | 90 | <hr/> |
|
91 | 91 | <li id="split_cell"><a href="#">Split</a></li> |
|
92 | 92 | <li id="merge_cell_above"><a href="#">Merge Above</a></li> |
|
93 | 93 | <li id="merge_cell_below"><a href="#">Merge Below</a></li> |
|
94 | 94 | <hr/> |
|
95 | 95 | <li id="move_cell_up"><a href="#">Move Up</a></li> |
|
96 | 96 | <li id="move_cell_down"><a href="#">Move Down</a></li> |
|
97 | 97 | <hr/> |
|
98 | 98 | <li id="select_previous"><a href="#">Select Previous</a></li> |
|
99 | 99 | <li id="select_next"><a href="#">Select Next</a></li> |
|
100 | 100 | </ul> |
|
101 | 101 | </li> |
|
102 | 102 | <li><a href="#">Insert</a> |
|
103 | 103 | <ul> |
|
104 | 104 | <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li> |
|
105 | 105 | <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li> |
|
106 | 106 | </ul> |
|
107 | 107 | </li> |
|
108 | 108 | <li><a href="#">Cell</a> |
|
109 | 109 | <ul> |
|
110 | 110 | <li id="run_cell"><a href="#">Run</a></li> |
|
111 | 111 | <li id="run_cell_in_place"><a href="#">Run in Place</a></li> |
|
112 | 112 | <li id="run_all_cells"><a href="#">Run All</a></li> |
|
113 | 113 | <hr/> |
|
114 | 114 | <li id="to_code"><a href="#">Code Cell</a></li> |
|
115 | 115 | <li id="to_markdown"><a href="#">Markdown Cell</a></li> |
|
116 | 116 | <hr/> |
|
117 | 117 | <li id="toggle_output"><a href="#">Toggle Output</a></li> |
|
118 | 118 | <li id="clear_all_output"><a href="#">Clear All Output</a></li> |
|
119 | 119 | </ul> |
|
120 | 120 | </li> |
|
121 | 121 | <li><a href="#">Kernel</a> |
|
122 | 122 | <ul> |
|
123 | 123 | <li id="int_kernel"><a href="#">Interrupt</a></li> |
|
124 | 124 | <li id="restart_kernel"><a href="#">Restart</a></li> |
|
125 | 125 | </ul> |
|
126 | 126 | </li> |
|
127 | 127 | <li><a href="#">Help</a> |
|
128 | 128 | <ul> |
|
129 | 129 | <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li> |
|
130 | 130 | <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li> |
|
131 | 131 | <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li> |
|
132 | 132 | <hr/> |
|
133 | 133 | <li><a href="http://docs.python.org" target="_blank">Python</a></li> |
|
134 | 134 | <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li> |
|
135 | 135 | <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li> |
|
136 | 136 | <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li> |
|
137 | 137 | <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li> |
|
138 | 138 | </ul> |
|
139 | 139 | </li> |
|
140 | 140 | </ul> |
|
141 | 141 | |
|
142 | 142 | </div> |
|
143 | 143 | |
|
144 | <div id="toolbar"> | |
|
145 | ||
|
146 | <span> | |
|
147 | <button id="save_b">Save</button> | |
|
148 | </span> | |
|
149 | <span id="cut_copy_paste"> | |
|
150 | <button id="cut_b" title="Cut">Cut</button> | |
|
151 | <button id="copy_b" title="Copy">Copy</button> | |
|
152 | <button id="paste_b" title="Paste">Paste</button> | |
|
153 | </span> | |
|
154 | <span id="move_up_down"> | |
|
155 | <button id="move_up_b" title="Move Up">Move Up</button> | |
|
156 | <button id="move_down_b" title="Move Down">Move Down</button> | |
|
157 | </span> | |
|
158 | <span id="insert_above_below"> | |
|
159 | <button id="insert_above_b" title="Insert Above">Insert Above</button> | |
|
160 | <button id="insert_below_b" title="Insert Below">Insert Below</button> | |
|
161 | </span> | |
|
162 | <span id="run_int"> | |
|
163 | <button id="run_b" title="Run">Run</button> | |
|
164 | <button id="interrupt_b" title="Interrupt">Interrupt</button> | |
|
165 | </span> | |
|
166 | <span> | |
|
167 | <select id="cell_type"> | |
|
168 | <option value="code">Code</option> | |
|
169 | <option value="markdown">Markdown</option> | |
|
170 | </select> | |
|
171 | </span> | |
|
172 | ||
|
173 | </div> | |
|
174 | ||
|
144 | 175 | <div id="main_app"> |
|
145 | 176 | |
|
146 | 177 | <div id="notebook_panel"> |
|
147 | 178 | <div id="notebook"></div> |
|
148 | 179 | <div id="pager_splitter"></div> |
|
149 | 180 | <div id="pager"></div> |
|
150 | 181 | </div> |
|
151 | 182 | |
|
152 | 183 | </div> |
|
153 | 184 | |
|
154 | 185 | <script src="/static/jquery/js/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script> |
|
155 | 186 | <script src="/static/jquery/js/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script> |
|
156 | 187 | |
|
157 | 188 | <script src="/static/codemirror/lib/codemirror.js" charset="utf-8"></script> |
|
158 | 189 | <script src="/static/codemirror/mode/python/python.js" charset="utf-8"></script> |
|
159 | 190 | <script src="/static/codemirror/mode/htmlmixed/htmlmixed.js" charset="utf-8"></script> |
|
160 | 191 | <script src="/static/codemirror/mode/xml/xml.js" charset="utf-8"></script> |
|
161 | 192 | <script src="/static/codemirror/mode/javascript/javascript.js" charset="utf-8"></script> |
|
162 | 193 | <script src="/static/codemirror/mode/css/css.js" charset="utf-8"></script> |
|
163 | 194 | <script src="/static/codemirror/mode/rst/rst.js" charset="utf-8"></script> |
|
164 | 195 | <script src="/static/codemirror/mode/markdown/markdown.js" charset="utf-8"></script> |
|
165 | 196 | |
|
166 | 197 | <script src="/static/pagedown/Markdown.Converter.js" charset="utf-8"></script> |
|
167 | 198 | |
|
168 | 199 | <script src="/static/prettify/prettify.js" charset="utf-8"></script> |
|
169 | 200 | <script src="/static/dateformat/date.format.js" charset="utf-8"></script> |
|
170 | 201 | |
|
171 | 202 | <script src="/static/js/namespace.js" type="text/javascript" charset="utf-8"></script> |
|
172 | 203 | <script src="/static/js/utils.js" type="text/javascript" charset="utf-8"></script> |
|
173 | 204 | <script src="/static/js/cell.js" type="text/javascript" charset="utf-8"></script> |
|
174 | 205 | <script src="/static/js/codecell.js" type="text/javascript" charset="utf-8"></script> |
|
175 | 206 | <script src="/static/js/textcell.js" type="text/javascript" charset="utf-8"></script> |
|
176 | 207 | <script src="/static/js/kernel.js" type="text/javascript" charset="utf-8"></script> |
|
177 | 208 | <script src="/static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script> |
|
178 | 209 | <script src="/static/js/layout.js" type="text/javascript" charset="utf-8"></script> |
|
179 | 210 | <script src="/static/js/savewidget.js" type="text/javascript" charset="utf-8"></script> |
|
180 | 211 | <script src="/static/js/quickhelp.js" type="text/javascript" charset="utf-8"></script> |
|
181 | 212 | <script src="/static/js/loginwidget.js" type="text/javascript" charset="utf-8"></script> |
|
182 | 213 | <script src="/static/js/pager.js" type="text/javascript" charset="utf-8"></script> |
|
183 | 214 | <script src="/static/js/menubar.js" type="text/javascript" charset="utf-8"></script> |
|
215 | <script src="/static/js/toolbar.js" type="text/javascript" charset="utf-8"></script> | |
|
184 | 216 | <script src="/static/js/notebook.js" type="text/javascript" charset="utf-8"></script> |
|
185 | 217 | <script src="/static/js/notebookmain.js" type="text/javascript" charset="utf-8"></script> |
|
186 | 218 | |
|
187 | 219 | </body> |
|
188 | 220 | |
|
189 | 221 | </html> |
General Comments 0
You need to be logged in to leave comments.
Login now