Show More
@@ -25,7 +25,7 b' var IPython = (function (IPython) {' | |||||
25 | this.prompt_area = true; |
|
25 | this.prompt_area = true; | |
26 | } else { |
|
26 | } else { | |
27 | this.prompt_area = prompt_area; |
|
27 | this.prompt_area = prompt_area; | |
28 |
} |
|
28 | } | |
29 | this.create_elements(); |
|
29 | this.create_elements(); | |
30 | this.style(); |
|
30 | this.style(); | |
31 | this.bind_events(); |
|
31 | this.bind_events(); | |
@@ -107,7 +107,7 b' var IPython = (function (IPython) {' | |||||
107 | this.collapse_button.show(); |
|
107 | this.collapse_button.show(); | |
108 | } |
|
108 | } | |
109 | this.collapsed = true; |
|
109 | this.collapsed = true; | |
110 |
} |
|
110 | } | |
111 | }; |
|
111 | }; | |
112 |
|
112 | |||
113 |
|
113 | |||
@@ -117,7 +117,7 b' var IPython = (function (IPython) {' | |||||
117 | this.element.show(); |
|
117 | this.element.show(); | |
118 | this.prompt_overlay.show(); |
|
118 | this.prompt_overlay.show(); | |
119 | this.collapsed = false; |
|
119 | this.collapsed = false; | |
120 |
} |
|
120 | } | |
121 | }; |
|
121 | }; | |
122 |
|
122 | |||
123 |
|
123 | |||
@@ -126,7 +126,7 b' var IPython = (function (IPython) {' | |||||
126 | this.expand(); |
|
126 | this.expand(); | |
127 | } else { |
|
127 | } else { | |
128 | this.collapse(); |
|
128 | this.collapse(); | |
129 |
} |
|
129 | } | |
130 | }; |
|
130 | }; | |
131 |
|
131 | |||
132 |
|
132 | |||
@@ -148,7 +148,7 b' var IPython = (function (IPython) {' | |||||
148 | if (this._should_scroll(lines)) { |
|
148 | if (this._should_scroll(lines)) { | |
149 | // only allow scrolling long-enough output |
|
149 | // only allow scrolling long-enough output | |
150 | this.scroll_area(); |
|
150 | this.scroll_area(); | |
151 |
} |
|
151 | } | |
152 | }; |
|
152 | }; | |
153 |
|
153 | |||
154 |
|
154 | |||
@@ -158,7 +158,7 b' var IPython = (function (IPython) {' | |||||
158 | } else { |
|
158 | } else { | |
159 | // only allow scrolling long-enough output |
|
159 | // only allow scrolling long-enough output | |
160 | this.scroll_if_long(20); |
|
160 | this.scroll_if_long(20); | |
161 |
} |
|
161 | } | |
162 | }; |
|
162 | }; | |
163 |
|
163 | |||
164 |
|
164 | |||
@@ -185,7 +185,7 b' var IPython = (function (IPython) {' | |||||
185 | json.ename = content.ename; |
|
185 | json.ename = content.ename; | |
186 | json.evalue = content.evalue; |
|
186 | json.evalue = content.evalue; | |
187 | json.traceback = content.traceback; |
|
187 | json.traceback = content.traceback; | |
188 |
} |
|
188 | } | |
189 | // append with dynamic=true |
|
189 | // append with dynamic=true | |
190 | this.append_output(json, true); |
|
190 | this.append_output(json, true); | |
191 | }; |
|
191 | }; | |
@@ -194,25 +194,25 b' var IPython = (function (IPython) {' | |||||
194 | OutputArea.prototype.convert_mime_types = function (json, data) { |
|
194 | OutputArea.prototype.convert_mime_types = function (json, data) { | |
195 | if (data['text/plain'] !== undefined) { |
|
195 | if (data['text/plain'] !== undefined) { | |
196 | json.text = data['text/plain']; |
|
196 | json.text = data['text/plain']; | |
197 |
} |
|
197 | } | |
198 | if (data['text/html'] !== undefined) { |
|
198 | if (data['text/html'] !== undefined) { | |
199 | json.html = data['text/html']; |
|
199 | json.html = data['text/html']; | |
200 |
} |
|
200 | } | |
201 | if (data['image/svg+xml'] !== undefined) { |
|
201 | if (data['image/svg+xml'] !== undefined) { | |
202 | json.svg = data['image/svg+xml']; |
|
202 | json.svg = data['image/svg+xml']; | |
203 |
} |
|
203 | } | |
204 | if (data['image/png'] !== undefined) { |
|
204 | if (data['image/png'] !== undefined) { | |
205 | json.png = data['image/png']; |
|
205 | json.png = data['image/png']; | |
206 |
} |
|
206 | } | |
207 | if (data['image/jpeg'] !== undefined) { |
|
207 | if (data['image/jpeg'] !== undefined) { | |
208 | json.jpeg = data['image/jpeg']; |
|
208 | json.jpeg = data['image/jpeg']; | |
209 |
} |
|
209 | } | |
210 | if (data['text/latex'] !== undefined) { |
|
210 | if (data['text/latex'] !== undefined) { | |
211 | json.latex = data['text/latex']; |
|
211 | json.latex = data['text/latex']; | |
212 |
} |
|
212 | } | |
213 | if (data['application/json'] !== undefined) { |
|
213 | if (data['application/json'] !== undefined) { | |
214 | json.json = data['application/json']; |
|
214 | json.json = data['application/json']; | |
215 |
} |
|
215 | } | |
216 | if (data['application/javascript'] !== undefined) { |
|
216 | if (data['application/javascript'] !== undefined) { | |
217 | json.javascript = data['application/javascript']; |
|
217 | json.javascript = data['application/javascript']; | |
218 | } |
|
218 | } | |
@@ -232,7 +232,7 b' var IPython = (function (IPython) {' | |||||
232 | this.append_display_data(json, dynamic); |
|
232 | this.append_display_data(json, dynamic); | |
233 | } else if (json.output_type === 'stream') { |
|
233 | } else if (json.output_type === 'stream') { | |
234 | this.append_stream(json); |
|
234 | this.append_stream(json); | |
235 |
} |
|
235 | } | |
236 | this.outputs.push(json); |
|
236 | this.outputs.push(json); | |
237 | var that = this; |
|
237 | var that = this; | |
238 | setTimeout(function(){that.element.trigger('resize');}, 100); |
|
238 | setTimeout(function(){that.element.trigger('resize');}, 100); | |
@@ -259,7 +259,7 b' var IPython = (function (IPython) {' | |||||
259 | // If we just output latex, typeset it. |
|
259 | // If we just output latex, typeset it. | |
260 | if ((json.latex !== undefined) || (json.html !== undefined)) { |
|
260 | if ((json.latex !== undefined) || (json.html !== undefined)) { | |
261 | this.typeset(); |
|
261 | this.typeset(); | |
262 |
} |
|
262 | } | |
263 | }; |
|
263 | }; | |
264 |
|
264 | |||
265 |
|
265 | |||
@@ -275,7 +275,7 b' var IPython = (function (IPython) {' | |||||
275 | var toinsert = this.create_output_area(); |
|
275 | var toinsert = this.create_output_area(); | |
276 | this.append_text(s, toinsert); |
|
276 | this.append_text(s, toinsert); | |
277 | this.element.append(toinsert); |
|
277 | this.element.append(toinsert); | |
278 |
} |
|
278 | } | |
279 | }; |
|
279 | }; | |
280 |
|
280 | |||
281 |
|
281 | |||
@@ -322,7 +322,7 b' var IPython = (function (IPython) {' | |||||
322 | // If we just output latex, typeset it. |
|
322 | // If we just output latex, typeset it. | |
323 | if ( (json.latex !== undefined) || (json.html !== undefined) ) { |
|
323 | if ( (json.latex !== undefined) || (json.html !== undefined) ) { | |
324 | this.typeset(); |
|
324 | this.typeset(); | |
325 |
} |
|
325 | } | |
326 | }; |
|
326 | }; | |
327 |
|
327 | |||
328 | OutputArea.display_order = ['javascript','html','latex','svg','png','jpeg','text']; |
|
328 | OutputArea.display_order = ['javascript','html','latex','svg','png','jpeg','text']; | |
@@ -334,9 +334,9 b' var IPython = (function (IPython) {' | |||||
334 | if(type == 'javascript' && dynamic){ |
|
334 | if(type == 'javascript' && dynamic){ | |
335 | this.append_javascript(json.javascript, element, dynamic); |
|
335 | this.append_javascript(json.javascript, element, dynamic); | |
336 | } else { |
|
336 | } else { | |
337 | this['append_'+type](json[type],element) |
|
337 | this['append_'+type](json[type], element); | |
338 | } |
|
338 | } | |
339 | return |
|
339 | return; | |
340 | } |
|
340 | } | |
341 | } |
|
341 | } | |
342 | }; |
|
342 | }; | |
@@ -370,7 +370,7 b' var IPython = (function (IPython) {' | |||||
370 | .addClass('js-error') |
|
370 | .addClass('js-error') | |
371 | ); |
|
371 | ); | |
372 | } |
|
372 | } | |
373 | } |
|
373 | }; | |
374 |
|
374 | |||
375 |
|
375 | |||
376 | OutputArea.prototype.append_text = function (data, element, extra_class) { |
|
376 | OutputArea.prototype.append_text = function (data, element, extra_class) { | |
@@ -405,7 +405,7 b' var IPython = (function (IPython) {' | |||||
405 | if (!(h0 && w0)) { |
|
405 | if (!(h0 && w0)) { | |
406 | // zero size, schedule another timeout |
|
406 | // zero size, schedule another timeout | |
407 | that._dblclick_to_reset_size(img); |
|
407 | that._dblclick_to_reset_size(img); | |
408 | return |
|
408 | return; | |
409 | } |
|
409 | } | |
410 | img.resizable({ |
|
410 | img.resizable({ | |
411 | aspectRatio: true, |
|
411 | aspectRatio: true, | |
@@ -419,7 +419,7 b' var IPython = (function (IPython) {' | |||||
419 | img.width(w0); |
|
419 | img.width(w0); | |
420 | }); |
|
420 | }); | |
421 | }, 250); |
|
421 | }, 250); | |
422 | } |
|
422 | }; | |
423 |
|
423 | |||
424 |
|
424 | |||
425 | OutputArea.prototype.append_png = function (png, element) { |
|
425 | OutputArea.prototype.append_png = function (png, element) { | |
@@ -451,7 +451,7 b' var IPython = (function (IPython) {' | |||||
451 |
|
451 | |||
452 | OutputArea.prototype.handle_clear_output = function (content) { |
|
452 | OutputArea.prototype.handle_clear_output = function (content) { | |
453 | this.clear_output(content.stdout, content.stderr, content.other); |
|
453 | this.clear_output(content.stdout, content.stderr, content.other); | |
454 | } |
|
454 | }; | |
455 |
|
455 | |||
456 |
|
456 | |||
457 | OutputArea.prototype.clear_output = function (stdout, stderr, other) { |
|
457 | OutputArea.prototype.clear_output = function (stdout, stderr, other) { | |
@@ -524,8 +524,8 b' var IPython = (function (IPython) {' | |||||
524 | clearTimeout(this.clear_out_timeout); |
|
524 | clearTimeout(this.clear_out_timeout); | |
525 | this.clear_out_timeout = null; |
|
525 | this.clear_out_timeout = null; | |
526 | this.clear_output_callback(this._clear_stdout, this._clear_stderr, this._clear_other); |
|
526 | this.clear_output_callback(this._clear_stdout, this._clear_stderr, this._clear_other); | |
527 |
} |
|
527 | } | |
528 | } |
|
528 | }; | |
529 |
|
529 | |||
530 |
|
530 | |||
531 | // JSON serialization |
|
531 | // JSON serialization | |
@@ -535,7 +535,7 b' var IPython = (function (IPython) {' | |||||
535 | for (var i=0; i<len; i++) { |
|
535 | for (var i=0; i<len; i++) { | |
536 | // append with dynamic=false. |
|
536 | // append with dynamic=false. | |
537 | this.append_output(outputs[i], false); |
|
537 | this.append_output(outputs[i], false); | |
538 |
} |
|
538 | } | |
539 | }; |
|
539 | }; | |
540 |
|
540 | |||
541 |
|
541 | |||
@@ -544,7 +544,7 b' var IPython = (function (IPython) {' | |||||
544 | var len = this.outputs.length; |
|
544 | var len = this.outputs.length; | |
545 | for (var i=0; i<len; i++) { |
|
545 | for (var i=0; i<len; i++) { | |
546 | outputs[i] = this.outputs[i]; |
|
546 | outputs[i] = this.outputs[i]; | |
547 |
} |
|
547 | } | |
548 | return outputs; |
|
548 | return outputs; | |
549 | }; |
|
549 | }; | |
550 |
|
550 |
General Comments 0
You need to be logged in to leave comments.
Login now