Show More
@@ -0,0 +1,37 b'' | |||
|
1 | ||
|
2 | //============================================================================ | |
|
3 | // Cell | |
|
4 | //============================================================================ | |
|
5 | ||
|
6 | var IPython = (function (IPython) { | |
|
7 | ||
|
8 | var utils = IPython.utils; | |
|
9 | ||
|
10 | var SaveWidget = function (selector) { | |
|
11 | this.element = $(selector); | |
|
12 | this.create_element(); | |
|
13 | if (this.element !== undefined) { | |
|
14 | this.element.data("cell", this); | |
|
15 | this.bind_events(); | |
|
16 | } | |
|
17 | }; | |
|
18 | ||
|
19 | ||
|
20 | SaveWidget.prototype.bind_events = function () { | |
|
21 | var that = this; | |
|
22 | }; | |
|
23 | ||
|
24 | ||
|
25 | // Subclasses must implement create_element. | |
|
26 | SaveWidget.prototype.create_element = function () { | |
|
27 | this.element. | |
|
28 | append($('textarea')). | |
|
29 | append($('<button>Save</button>').button()); | |
|
30 | }; | |
|
31 | ||
|
32 | IPython.SaveWidget = SaveWidget; | |
|
33 | ||
|
34 | return IPython; | |
|
35 | ||
|
36 | }(IPython)); | |
|
37 |
@@ -1,296 +1,303 b'' | |||
|
1 | 1 | /** |
|
2 | 2 | * HTML5 β° Boilerplate |
|
3 | 3 | * |
|
4 | 4 | * style.css contains a reset, font normalization and some base styles. |
|
5 | 5 | * |
|
6 | 6 | * Credit is left where credit is due. |
|
7 | 7 | * Much inspiration was taken from these projects: |
|
8 | 8 | * - yui.yahooapis.com/2.8.1/build/base/base.css |
|
9 | 9 | * - camendesign.com/design/ |
|
10 | 10 | * - praegnanz.de/weblog/htmlcssjs-kickstart |
|
11 | 11 | */ |
|
12 | 12 | |
|
13 | 13 | |
|
14 | 14 | /** |
|
15 | 15 | * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline) |
|
16 | 16 | * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark |
|
17 | 17 | * html5doctor.com/html-5-reset-stylesheet/ |
|
18 | 18 | */ |
|
19 | 19 | |
|
20 | 20 | html, body, div, span, object, iframe, |
|
21 | 21 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
|
22 | 22 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, |
|
23 | 23 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, |
|
24 | 24 | fieldset, form, label, legend, |
|
25 | 25 | table, caption, tbody, tfoot, thead, tr, th, td, |
|
26 | 26 | article, aside, canvas, details, figcaption, figure, |
|
27 | 27 | footer, header, hgroup, menu, nav, section, summary, |
|
28 | 28 | time, mark, audio, video { |
|
29 | 29 | margin: 0; |
|
30 | 30 | padding: 0; |
|
31 | 31 | border: 0; |
|
32 | 32 | /* font-size: 100%;*/ |
|
33 | 33 | font: inherit; |
|
34 | 34 | vertical-align: baseline; |
|
35 | 35 | } |
|
36 | 36 | |
|
37 | 37 | article, aside, details, figcaption, figure, |
|
38 | 38 | footer, header, hgroup, menu, nav, section { |
|
39 | 39 | display: block; |
|
40 | 40 | } |
|
41 | 41 | |
|
42 | 42 | blockquote, q { quotes: none; } |
|
43 | 43 | |
|
44 | 44 | blockquote:before, blockquote:after, |
|
45 | 45 | q:before, q:after { content: ""; content: none; } |
|
46 | 46 | |
|
47 | 47 | ins { background-color: #ff9; color: #000; text-decoration: none; } |
|
48 | 48 | |
|
49 | 49 | mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } |
|
50 | 50 | |
|
51 | 51 | del { text-decoration: line-through; } |
|
52 | 52 | |
|
53 | 53 | abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } |
|
54 | 54 | |
|
55 | 55 | table { border-collapse: collapse; border-spacing: 0; } |
|
56 | 56 | |
|
57 | 57 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } |
|
58 | 58 | |
|
59 | 59 | input, select { vertical-align: middle; } |
|
60 | 60 | |
|
61 | 61 | body { |
|
62 | 62 | background-color: white; |
|
63 | 63 | /* This won't propagate to all children so we also set it below */ |
|
64 | 64 | font-size: 11pt; |
|
65 | 65 | /* This makes sure that the body covers the entire window and needs to |
|
66 | 66 | be in a different element than the display: box in wrapper below */ |
|
67 | 67 | position: absolute; |
|
68 | 68 | left: 0px; |
|
69 | 69 | right: 0px; |
|
70 | 70 | top: 0px; |
|
71 | 71 | bottom: 0px; |
|
72 | 72 | overflow: hidden; |
|
73 | 73 | } |
|
74 | 74 | |
|
75 | 75 | |
|
76 | span#ipython_notebook h1 { | |
|
77 | font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; | |
|
78 | font-size: 22pt; | |
|
76 | div#header { | |
|
79 | 77 | height: 35px; |
|
80 | 78 | padding: 5px; |
|
81 | 79 | margin: 0px; |
|
80 | width: 100% | |
|
81 | } | |
|
82 | 82 | |
|
83 | span#ipython_notebook { | |
|
84 | } | |
|
85 | ||
|
86 | span#ipython_notebook h1 { | |
|
87 | font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; | |
|
88 | font-size: 22pt; | |
|
83 | 89 | } |
|
84 | 90 | |
|
85 | 91 | span#kernel_status { |
|
86 | 92 | position: absolute; |
|
87 | 93 | top: 12%; |
|
88 | 94 | right: 10px; |
|
89 | 95 | font-weight: bold; |
|
90 | 96 | } |
|
91 | 97 | |
|
92 | 98 | .status_idle { |
|
93 | 99 | color: gray; |
|
94 | 100 | } |
|
95 | 101 | |
|
96 | 102 | .status_busy { |
|
97 | 103 | color: red; |
|
98 | 104 | } |
|
99 | 105 | |
|
100 | 106 | .status_restarting { |
|
101 | 107 | color: black; |
|
102 | 108 | } |
|
103 | 109 | |
|
104 | 110 | div#notebook_app { |
|
105 | 111 | width: 100%; |
|
106 | 112 | position: relative; |
|
107 | 113 | } |
|
108 | 114 | |
|
109 | 115 | div#left_panel { |
|
110 | 116 | overflow-y: auto; |
|
111 | 117 | top: 0px; |
|
112 | 118 | left: 0px; |
|
113 | 119 | margin: 0px; |
|
114 | 120 | padding: 0px; |
|
115 | 121 | position: absolute; |
|
116 | 122 | } |
|
117 | 123 | |
|
118 | 124 | h3.section_header { |
|
119 | 125 | padding: 5px; |
|
120 | 126 | } |
|
121 | 127 | |
|
122 | 128 | div.section_content { |
|
123 | 129 | padding: 5px; |
|
124 | 130 | } |
|
125 | 131 | |
|
126 | 132 | #expand_cell, #collapse_cell, #insert_cell_above, #insert_cell_below, |
|
127 | 133 | #move_cell_up, #move_cell_down, #to_code, #to_text, #run_selected_cell, |
|
128 | #run_all_cells { | |
|
134 | #run_all_cells, #int_kernel, #restart_kernel, #python_help, #ipython_help, | |
|
135 | #numpy_help, #matplotlib_help, #scipy_help, #sympy_help { | |
|
129 | 136 | width: 65px; |
|
130 | 137 | } |
|
131 | 138 | |
|
132 | 139 | .cell_section_row { |
|
133 | 140 | margin: 5px 0px; |
|
134 | 141 | } |
|
135 | 142 | |
|
136 | 143 | .cell_section_row_buttons { |
|
137 | 144 | float: right; |
|
138 | 145 | } |
|
139 | 146 | |
|
140 | 147 | .cell_section_row_header { |
|
141 | 148 | float: left; |
|
142 | 149 | font-size: 0.8em; |
|
143 | 150 | padding: 0.2em 0em; |
|
144 | 151 | font-weight: bold; |
|
145 | 152 | } |
|
146 | 153 | |
|
147 | 154 | span.button_label { |
|
148 | 155 | padding: 0.2em 1em; |
|
149 | 156 | font-size: 0.8em; |
|
150 | 157 | float: right; |
|
151 | 158 | } |
|
152 | 159 | |
|
153 | 160 | /* This is needed because FF was adding a 2px margin top and bottom. */ |
|
154 | 161 | .cell_section_row .ui-button { |
|
155 | 162 | margin-top: 0px; |
|
156 | 163 | margin-bottom: 0px; |
|
157 | 164 | } |
|
158 | 165 | |
|
159 | 166 | |
|
160 | 167 | .ui-button .ui-button-text { |
|
161 | 168 | padding: 0.2em 0.8em; |
|
162 | 169 | font-size: 0.7em; |
|
163 | 170 | } |
|
164 | 171 | |
|
165 | 172 | div#left_panel_splitter { |
|
166 | 173 | width: 8px; |
|
167 | 174 | top: 0px; |
|
168 | 175 | left: 202px; |
|
169 | 176 | margin: 0px; |
|
170 | 177 | padding: 0px; |
|
171 | 178 | position: absolute; |
|
172 | 179 | } |
|
173 | 180 | |
|
174 | 181 | div#notebook_panel { |
|
175 | 182 | /* The L margin will be set in the Javascript code*/ |
|
176 | 183 | margin: 0px 0px 0px 0px; |
|
177 | 184 | padding: 0px; |
|
178 | 185 | } |
|
179 | 186 | |
|
180 | 187 | div#notebook { |
|
181 | 188 | overflow-y: scroll; |
|
182 | 189 | overflow-x: auto; |
|
183 | 190 | width: 100%; |
|
184 | 191 | padding: 0px 15px 0px 15px; |
|
185 | 192 | margin: 0px |
|
186 | 193 | background-color: white; |
|
187 | 194 | font-size: 11pt; |
|
188 | 195 | } |
|
189 | 196 | |
|
190 | 197 | div#pager_splitter { |
|
191 | 198 | height: 8px; |
|
192 | 199 | } |
|
193 | 200 | |
|
194 | 201 | div#pager { |
|
195 | 202 | padding: 15px; |
|
196 | 203 | overflow: auto; |
|
197 | 204 | } |
|
198 | 205 | |
|
199 | 206 | .monospace-font { |
|
200 | 207 | font-family: monospace; |
|
201 | 208 | font-size: 11pt; |
|
202 | 209 | } |
|
203 | 210 | |
|
204 | 211 | div.cell { |
|
205 | 212 | width: 100%; |
|
206 | 213 | padding: 5px; |
|
207 | 214 | /* This acts as a spacer between cells, that is outside the border */ |
|
208 | 215 | margin: 15px 0px 15px 0px; |
|
209 | 216 | } |
|
210 | 217 | |
|
211 | 218 | div.code_cell { |
|
212 | 219 | background-color: white; |
|
213 | 220 | } |
|
214 | 221 | |
|
215 | 222 | div.prompt { |
|
216 | 223 | width: 90px; |
|
217 | 224 | padding: 0.4em; |
|
218 | 225 | margin: 0px; |
|
219 | 226 | line-height: 1em; |
|
220 | 227 | } |
|
221 | 228 | |
|
222 | 229 | div.input_prompt { |
|
223 | 230 | color: navy; |
|
224 | 231 | } |
|
225 | 232 | |
|
226 | 233 | div.output { |
|
227 | 234 | /* This is a spacer between the input and output of each cell */ |
|
228 | 235 | margin-top: 15px; |
|
229 | 236 | } |
|
230 | 237 | |
|
231 | 238 | div.output_prompt { |
|
232 | 239 | color: darkred; |
|
233 | 240 | } |
|
234 | 241 | |
|
235 | 242 | div.output_area { |
|
236 | 243 | text-align: left; |
|
237 | 244 | color: black; |
|
238 | 245 | } |
|
239 | 246 | |
|
240 | 247 | div.output_latex { |
|
241 | 248 | /* Slightly bigger than the rest of the notebook */ |
|
242 | 249 | font-size: 12pt; |
|
243 | 250 | } |
|
244 | 251 | |
|
245 | 252 | div.output_png { |
|
246 | 253 | } |
|
247 | 254 | |
|
248 | 255 | div.text_cell { |
|
249 | 256 | background-color: white; |
|
250 | 257 | } |
|
251 | 258 | |
|
252 | 259 | textarea.text_cell_input { |
|
253 | 260 | /* Slightly bigger than the rest of the notebook */ |
|
254 | 261 | font-size: 12pt; |
|
255 | 262 | outline: none; |
|
256 | 263 | resize: none; |
|
257 | 264 | width: inherit; |
|
258 | 265 | border-style: none; |
|
259 | 266 | padding: 0px; |
|
260 | 267 | margin: 0px; |
|
261 | 268 | color: black; |
|
262 | 269 | } |
|
263 | 270 | |
|
264 | 271 | div.text_cell_render { |
|
265 | 272 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
266 | 273 | /* Slightly bigger than the rest of the notebook */ |
|
267 | 274 | font-size: 12pt; |
|
268 | 275 | outline: none; |
|
269 | 276 | resize: none; |
|
270 | 277 | width: inherit; |
|
271 | 278 | border-style: none; |
|
272 | 279 | padding: 5px; |
|
273 | 280 | color: black; |
|
274 | 281 | } |
|
275 | 282 | |
|
276 | 283 | div.text_cell_render em {font-style: italic;} |
|
277 | 284 | div.text_cell_render strong {font-weight: bold;} |
|
278 | 285 | div.text_cell_render u {text-decoration: underline;} |
|
279 | 286 | div.text_cell_render :link { text-decoration: underline } |
|
280 | 287 | div.text_cell_render :visited { text-decoration: underline } |
|
281 | 288 | div.text_cell_render h1 {font-size: 2.0em; margin: .67em 0; font-weight: bold;} |
|
282 | 289 | div.text_cell_render h2 {font-size: 1.5em; margin: .75em 0; font-weight: bold;} |
|
283 | 290 | div.text_cell_render h3 {font-size: 1.17em; margin: .83em 0; font-weight: bold;} |
|
284 | 291 | div.text_cell_render h4 {margin: 1.12em 0; font-weight: bold;} |
|
285 | 292 | div.text_cell_render h5 {font-size: .83em; margin: 1.5em 0; font-weight: bold;} |
|
286 | 293 | div.text_cell_render h6 {font-size: .75em; margin: 1.67em 0; font-weight: bold;} |
|
287 | 294 | div.text_cell_render ul {list-style:disc; margin-left: 40px;} |
|
288 | 295 | div.text_cell_render ul ul {list-style:square; margin-left: 40px;} |
|
289 | 296 | div.text_cell_render ul ul ul {list-style:circle; margin-left: 40px;} |
|
290 | 297 | div.text_cell_render ol {list-style:upper-roman; margin-left: 40px;} |
|
291 | 298 | div.text_cell_render ol ol {list-style:upper-alpha;} |
|
292 | 299 | div.text_cell_render ol ol ol {list-style:decimal;} |
|
293 | 300 | div.text_cell_render ol ol ol ol {list-style:lower-alpha;} |
|
294 | 301 | div.text_cell_render ol ol ol ol ol {list-style:lower-roman;} |
|
295 | 302 | |
|
296 | 303 |
@@ -1,32 +1,33 b'' | |||
|
1 | 1 | |
|
2 | 2 | //============================================================================ |
|
3 | 3 | // On document ready |
|
4 | 4 | //============================================================================ |
|
5 | 5 | |
|
6 | 6 | |
|
7 | 7 | $(document).ready(function () { |
|
8 | 8 | |
|
9 | 9 | MathJax.Hub.Config({ |
|
10 | 10 | tex2jax: { |
|
11 | 11 | inlineMath: [ ['$','$'], ["\\(","\\)"] ], |
|
12 | 12 | displayMath: [ ['$$','$$'], ["\\[","\\]"] ], |
|
13 | 13 | }, |
|
14 | 14 | displayAlign: 'left', // Change this to 'center' to center equations. |
|
15 | 15 | "HTML-CSS": { |
|
16 | 16 | styles: {'.MathJax_Display': {"margin": 0}} |
|
17 | 17 | } |
|
18 | 18 | }); |
|
19 | 19 | |
|
20 | 20 | $('div#notebook_app').addClass('border-box-sizing ui-widget ui-widget-content'); |
|
21 | 21 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); |
|
22 | 22 | |
|
23 | 23 | IPython.layout_manager = new IPython.LayoutManager(); |
|
24 | // IPython.save_widget = new IPython.SaveWidget('span#save_widget'); | |
|
24 | 25 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); |
|
25 | 26 | IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter'); |
|
26 | 27 | IPython.notebook = new IPython.Notebook('div#notebook'); |
|
27 | 28 | |
|
28 | 29 | IPython.notebook.insert_code_cell_after(); |
|
29 | 30 | IPython.layout_manager.do_resize(); |
|
30 | 31 | IPython.pager.collapse(); |
|
31 | 32 | }); |
|
32 | 33 |
@@ -1,285 +1,285 b'' | |||
|
1 | 1 | |
|
2 | 2 | //============================================================================ |
|
3 | 3 | // Cell |
|
4 | 4 | //============================================================================ |
|
5 | 5 | |
|
6 | 6 | var IPython = (function (IPython) { |
|
7 | 7 | |
|
8 | 8 | var utils = IPython.utils; |
|
9 | 9 | |
|
10 | 10 | // Base PanelSection class |
|
11 | 11 | |
|
12 | 12 | var PanelSection = function () { |
|
13 | 13 | if (this.section_name === undefined) { |
|
14 | 14 | this.section_name = 'section'; |
|
15 | 15 | }; |
|
16 | 16 | this.create_element(); |
|
17 | 17 | if (this.element !== undefined) { |
|
18 | 18 | this.bind_events(); |
|
19 | 19 | } |
|
20 | 20 | this.expanded = true; |
|
21 | 21 | }; |
|
22 | 22 | |
|
23 | 23 | |
|
24 | 24 | PanelSection.prototype.bind_events = function () { |
|
25 | 25 | var that = this; |
|
26 | 26 | this.header.click(function () { |
|
27 | 27 | that.toggle(); |
|
28 | 28 | }); |
|
29 | 29 | this.header.hover(function () { |
|
30 | 30 | that.header.toggleClass('ui-state-hover'); |
|
31 | 31 | }); |
|
32 | 32 | }; |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | PanelSection.prototype.create_element = function () { |
|
36 | 36 | this.element = $('<div/>').attr('id',this.id()); |
|
37 | 37 | this.header = $('<h3>'+this.section_name+'</h3>'). |
|
38 | 38 | addClass('ui-widget ui-state-default section_header'); |
|
39 | 39 | this.content = $('<div/>'). |
|
40 | 40 | addClass('ui-widget section_content'); |
|
41 | 41 | this.element.append(this.header).append(this.content); |
|
42 | 42 | this.create_children(); |
|
43 | 43 | }; |
|
44 | 44 | |
|
45 | 45 | |
|
46 | 46 | PanelSection.prototype.id = function () { |
|
47 | 47 | return this.section_name.toLowerCase() + "_section"; |
|
48 | 48 | }; |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | PanelSection.prototype.expand = function () { |
|
52 | 52 | if (!this.expanded) { |
|
53 | 53 | this.content.slideDown('fast'); |
|
54 | 54 | // this.header.addClass('ui-state-active'); |
|
55 | 55 | // this.header.removeClass('ui-state-default'); |
|
56 | 56 | this.expanded = true; |
|
57 | 57 | }; |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | |
|
61 | 61 | PanelSection.prototype.collapse = function () { |
|
62 | 62 | if (this.expanded) { |
|
63 | 63 | this.content.slideUp('fast'); |
|
64 | 64 | // this.header.removeClass('ui-state-active'); |
|
65 | 65 | // this.header.addClass('ui-state-default'); |
|
66 | 66 | this.expanded = false; |
|
67 | 67 | }; |
|
68 | 68 | }; |
|
69 | 69 | |
|
70 | 70 | |
|
71 | 71 | PanelSection.prototype.toggle = function () { |
|
72 | 72 | if (this.expanded === true) { |
|
73 | 73 | this.collapse(); |
|
74 | 74 | } else { |
|
75 | 75 | this.expand(); |
|
76 | 76 | }; |
|
77 | 77 | }; |
|
78 | 78 | |
|
79 | 79 | |
|
80 | 80 | PanelSection.prototype.create_children = function () {}; |
|
81 | 81 | |
|
82 | 82 | |
|
83 | 83 | // NotebookSection |
|
84 | 84 | |
|
85 | 85 | var NotebookSection = function () { |
|
86 | 86 | this.section_name = "Notebook"; |
|
87 | 87 | PanelSection.apply(this, arguments); |
|
88 | 88 | }; |
|
89 | 89 | |
|
90 | 90 | |
|
91 | 91 | NotebookSection.prototype = new PanelSection(); |
|
92 | 92 | |
|
93 | 93 | |
|
94 | 94 | // CellSection |
|
95 | 95 | |
|
96 | 96 | var CellSection = function () { |
|
97 | 97 | this.section_name = "Cell"; |
|
98 | 98 | PanelSection.apply(this, arguments); |
|
99 | 99 | }; |
|
100 | 100 | |
|
101 | 101 | |
|
102 | 102 | CellSection.prototype = new PanelSection(); |
|
103 | 103 | |
|
104 | 104 | |
|
105 | 105 | CellSection.prototype.bind_events = function () { |
|
106 | 106 | PanelSection.prototype.bind_events.apply(this); |
|
107 | 107 | this.content.find('#collapse_cell').click(function () { |
|
108 | 108 | IPython.notebook.collapse(); |
|
109 | 109 | }); |
|
110 | 110 | this.content.find('#expand_cell').click(function () { |
|
111 | 111 | IPython.notebook.expand(); |
|
112 | 112 | }); |
|
113 | 113 | this.content.find('#delete_cell').click(function () { |
|
114 | 114 | IPython.notebook.delete_cell(); |
|
115 | 115 | }); |
|
116 | 116 | this.content.find('#insert_cell_above').click(function () { |
|
117 | 117 | IPython.notebook.insert_code_cell_before(); |
|
118 | 118 | }); |
|
119 | 119 | this.content.find('#insert_cell_below').click(function () { |
|
120 | 120 | IPython.notebook.insert_code_cell_after(); |
|
121 | 121 | }); |
|
122 | 122 | this.content.find('#move_cell_up').click(function () { |
|
123 | 123 | IPython.notebook.move_cell_up(); |
|
124 | 124 | }); |
|
125 | 125 | this.content.find('#move_cell_down').click(function () { |
|
126 | 126 | IPython.notebook.move_cell_down(); |
|
127 | 127 | }); |
|
128 | 128 | this.content.find('#to_code').click(function () { |
|
129 | 129 | IPython.notebook.text_to_code(); |
|
130 | 130 | }); |
|
131 | 131 | this.content.find('#to_text').click(function () { |
|
132 | 132 | IPython.notebook.code_to_text(); |
|
133 | 133 | }); |
|
134 | 134 | this.content.find('#run_selected_cell').click(function () { |
|
135 | 135 | alert("Not Implemented"); |
|
136 | 136 | }); |
|
137 | 137 | this.content.find('#run_all_cells').click(function () { |
|
138 | 138 | alert("Not Implemented"); |
|
139 | 139 | }); |
|
140 | 140 | }; |
|
141 | 141 | |
|
142 | 142 | |
|
143 | 143 | CellSection.prototype.create_children = function () { |
|
144 | 144 | |
|
145 | 145 | this.content.addClass('ui-helper-clearfix'); |
|
146 | 146 | |
|
147 | 147 | var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
148 | 148 | append($('<span/>').addClass('cell_section_row_buttons'). |
|
149 | 149 | append($('<button>X</button>').attr('id','delete_cell'))). |
|
150 | 150 | append($('<span/>').html('Actions').addClass('cell_section_row_header')); |
|
151 | 151 | row0.find('#delete_cell').button(); |
|
152 | 152 | this.content.append(row0); |
|
153 | 153 | |
|
154 | 154 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
155 | 155 | append($('<span/>').attr('id','insert').addClass('cell_section_row_buttons'). |
|
156 | 156 | append( $('<button>Above</button>').attr('id','insert_cell_above') ). |
|
157 | 157 | append( $('<button>Below</button>').attr('id','insert_cell_below') )). |
|
158 | 158 | append($('<span/>').html('Insert').addClass('button_label')); |
|
159 | 159 | row1.find('#insert').buttonset(); |
|
160 | 160 | this.content.append(row1); |
|
161 | 161 | |
|
162 | 162 | var row2 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
163 | 163 | append($('<span/>').attr('id','move').addClass('cell_section_row_buttons'). |
|
164 | 164 | append( $('<button>Up</button>').attr('id','move_cell_up') ). |
|
165 | 165 | append( $('<button>Down</button>').attr('id','move_cell_down') ) ). |
|
166 | 166 | append($('<span/>').html('Move').addClass('button_label')); |
|
167 | 167 | row2.find('#move').buttonset(); |
|
168 | 168 | this.content.append(row2); |
|
169 | 169 | |
|
170 | 170 | var row3 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
171 | 171 | append($('<span/>').attr('id','cell_type').addClass('cell_section_row_buttons'). |
|
172 | 172 | append( $('<button>Code</button>').attr('id','to_code') ). |
|
173 | 173 | append( $('<button>Text</button>').attr('id','to_text') ) ). |
|
174 | 174 | append($('<span/>').html('Cell Type').addClass('button_label')); |
|
175 | 175 | row3.find('#cell_type').buttonset(); |
|
176 | 176 | this.content.append(row3); |
|
177 | 177 | |
|
178 | 178 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
179 | 179 | append($('<span/>').attr('id','toggle_output').addClass('cell_section_row_buttons'). |
|
180 | 180 | append( $('<button>Collapse</button>').attr('id','collapse_cell') ). |
|
181 | 181 | append( $('<button>Expand</button>').attr('id','expand_cell') ) ). |
|
182 | 182 | append($('<span/>').html('Output').addClass('button_label')); |
|
183 | 183 | row1.find('#toggle_output').buttonset(); |
|
184 | 184 | this.content.append(row1); |
|
185 | 185 | |
|
186 | 186 | var row0 = $('<div>').addClass('cell_section_row'). |
|
187 | 187 | append($('<span/>').attr('id','run_cells').addClass('cell_section_row_buttons'). |
|
188 | 188 | append( $('<button>Selected</button>').attr('id','run_selected_cell') ). |
|
189 | 189 | append( $('<button>All</button>').attr('id','run_all_cells') ) ). |
|
190 | 190 | append($('<span/>').html('Run').addClass('button_label')); |
|
191 | 191 | row0.find('#run_cells').buttonset(); |
|
192 | 192 | this.content.append(row0); |
|
193 | 193 | }; |
|
194 | 194 | |
|
195 | 195 | |
|
196 | 196 | // KernelSection |
|
197 | 197 | |
|
198 | 198 | var KernelSection = function () { |
|
199 | 199 | this.section_name = "Kernel"; |
|
200 | 200 | PanelSection.apply(this, arguments); |
|
201 | 201 | }; |
|
202 | 202 | |
|
203 | 203 | |
|
204 | 204 | KernelSection.prototype = new PanelSection(); |
|
205 | 205 | |
|
206 | 206 | |
|
207 | 207 | KernelSection.prototype.bind_events = function () { |
|
208 | 208 | PanelSection.prototype.bind_events.apply(this); |
|
209 | 209 | this.content.find('#restart_kernel').click(function () { |
|
210 | 210 | IPython.notebook.kernel.restart(); |
|
211 | 211 | }); |
|
212 | 212 | this.content.find('#int_kernel').click(function () { |
|
213 | 213 | IPython.notebook.kernel.interrupt(); |
|
214 | 214 | }); |
|
215 | 215 | }; |
|
216 | 216 | |
|
217 | 217 | |
|
218 | 218 | KernelSection.prototype.create_children = function () { |
|
219 | 219 | |
|
220 | 220 | this.content.addClass('ui-helper-clearfix'); |
|
221 | 221 | |
|
222 | 222 | var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
223 | 223 | append($('<span/>').attr('id','int_restart').addClass('cell_section_row_buttons'). |
|
224 | 224 | append( $('<button>Interrupt</button>').attr('id','int_kernel') ). |
|
225 | 225 | append( $('<button>Restart</button>').attr('id','restart_kernel') )). |
|
226 | 226 | append($('<span/>').html('Actions').addClass('cell_section_row_header')); |
|
227 | 227 | row0.find('#int_restart').buttonset(); |
|
228 | 228 | this.content.append(row0); |
|
229 | 229 | }; |
|
230 | 230 | |
|
231 | 231 | |
|
232 | 232 | // HelpSection |
|
233 | 233 | |
|
234 | 234 | var HelpSection = function () { |
|
235 | 235 | this.section_name = "Help"; |
|
236 | 236 | PanelSection.apply(this, arguments); |
|
237 | 237 | }; |
|
238 | 238 | |
|
239 | 239 | |
|
240 | 240 | HelpSection.prototype = new PanelSection(); |
|
241 | 241 | |
|
242 | 242 | |
|
243 | 243 | HelpSection.prototype.bind_events = function () { |
|
244 | 244 | PanelSection.prototype.bind_events.apply(this); |
|
245 | 245 | }; |
|
246 | 246 | |
|
247 | 247 | |
|
248 | 248 | HelpSection.prototype.create_children = function () { |
|
249 | 249 | |
|
250 | 250 | this.content.addClass('ui-helper-clearfix'); |
|
251 | 251 | |
|
252 | 252 | var row0 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
253 | 253 | append($('<span/>').attr('id','help_buttons0').addClass('cell_section_row_buttons'). |
|
254 | 254 | append( $('<button/>').attr('id','python_help'). |
|
255 | 255 | append( $('<a>Python</a>').attr('href','http://docs.python.org').attr('target','_blank') )). |
|
256 | 256 | append( $('<button/>').attr('id','ipython_help'). |
|
257 | 257 | append( $('<a>IPython</a>').attr('href','http://ipython.org/documentation.html').attr('target','_blank') )). |
|
258 | 258 | append( $('<button/>').attr('id','numpy_help'). |
|
259 | 259 | append( $('<a>NumPy</a>').attr('href','http://docs.scipy.org/doc/numpy/reference/').attr('target','_blank') ))). |
|
260 | 260 | append($('<span/>').html('Links').addClass('cell_section_row_header')); |
|
261 | 261 | row0.find('#help_buttons0').buttonset(); |
|
262 | 262 | this.content.append(row0); |
|
263 | 263 | |
|
264 | 264 | var row1 = $('<div>').addClass('cell_section_row ui-helper-clearfix'). |
|
265 | 265 | append($('<span/>').attr('id','help_buttons1').addClass('cell_section_row_buttons'). |
|
266 | 266 | append( $('<button/>').attr('id','matplotlib_help'). |
|
267 |
append( $('<a>M |
|
|
267 | append( $('<a>MPL</a>').attr('href','http://matplotlib.sourceforge.net/').attr('target','_blank') )). | |
|
268 | 268 | append( $('<button/>').attr('id','scipy_help'). |
|
269 | 269 | append( $('<a>SciPy</a>').attr('href','http://docs.scipy.org/doc/scipy/reference/').attr('target','_blank') )). |
|
270 | 270 | append( $('<button/>').attr('id','sympy_help'). |
|
271 | 271 | append( $('<a>SymPy</a>').attr('href','http://docs.sympy.org/dev/index.html').attr('target','_blank') ))); |
|
272 | 272 | row1.find('#help_buttons1').buttonset(); |
|
273 | 273 | this.content.append(row1); |
|
274 | 274 | }; |
|
275 | 275 | |
|
276 | 276 | IPython.PanelSection = PanelSection; |
|
277 | 277 | IPython.NotebookSection = NotebookSection; |
|
278 | 278 | IPython.CellSection = CellSection; |
|
279 | 279 | IPython.KernelSection = KernelSection; |
|
280 | 280 | IPython.HelpSection = HelpSection; |
|
281 | 281 | |
|
282 | 282 | return IPython; |
|
283 | 283 | |
|
284 | 284 | }(IPython)); |
|
285 | 285 |
@@ -1,70 +1,72 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 | <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> |
|
10 |
|
|
|
10 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> --> | |
|
11 | 11 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />--> |
|
12 | 12 | |
|
13 | 13 | <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script> |
|
14 | 14 | <!-- <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script> --> |
|
15 | 15 | <script type="text/javascript"> |
|
16 | 16 | if (typeof MathJax == 'undefined') { |
|
17 | 17 | console.log("Trying to load local copy of MathJax"); |
|
18 | 18 | document.write(unescape("%3Cscript type='text/javascript' src='static/mathjax/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E")); |
|
19 | 19 | } |
|
20 | 20 | </script> |
|
21 | 21 | |
|
22 | 22 | <link rel="stylesheet" href="static/codemirror2/lib/codemirror.css"> |
|
23 | 23 | <link rel="stylesheet" href="static/codemirror2/mode/python/python.css"> |
|
24 | 24 | |
|
25 | 25 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> |
|
26 | 26 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> |
|
27 | 27 | |
|
28 | 28 | </head> |
|
29 | 29 | |
|
30 | 30 | <body> |
|
31 | 31 | |
|
32 | 32 | <div id="header"> |
|
33 | 33 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> |
|
34 | <span id="save_widget"></span> | |
|
34 | 35 | </div> |
|
35 | 36 | |
|
36 | 37 | <div id="notebook_app"> |
|
37 | 38 | |
|
38 | 39 | <div id="left_panel"></div> |
|
39 | 40 | <div id="left_panel_splitter"></div> |
|
40 | 41 | <div id="notebook_panel"> |
|
41 | 42 | <div id="notebook"></div> |
|
42 | 43 | <div id="pager_splitter"></div> |
|
43 | 44 | <div id="pager"></div> |
|
44 | 45 | </div> |
|
45 | 46 | |
|
46 | 47 | </div> |
|
47 | 48 | |
|
48 | 49 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> |
|
49 | 50 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> |
|
50 | 51 | <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script> |
|
51 | 52 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> |
|
52 | 53 | <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script> |
|
53 | 54 | <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script> |
|
54 | 55 | <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script> |
|
55 | 56 | <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script> |
|
56 | 57 | <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script> |
|
57 | 58 | <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script> |
|
59 | <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script> | |
|
58 | 60 | <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script> |
|
59 | 61 | <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script> |
|
60 | 62 | <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script> |
|
61 | 63 | <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script> |
|
62 | 64 | <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script> |
|
63 | 65 | <script src="static/codemirror2/lib/codemirror.js"></script> |
|
64 | 66 | <script src="static/codemirror2/mode/python/python.js"></script> |
|
65 | 67 | |
|
66 | 68 | </body> |
|
67 | 69 | |
|
68 | 70 | </html> |
|
69 | 71 | |
|
70 | 72 |
General Comments 0
You need to be logged in to leave comments.
Login now