##// END OF EJS Templates
love javascript....
Paul Ivanov -
Show More
@@ -506,7 +506,7 b' var IPython = (function (IPython) {'
506 var type = OutputArea.display_order[type_i];
506 var type = OutputArea.display_order[type_i];
507 var append = OutputArea.append_map[type];
507 var append = OutputArea.append_map[type];
508 if ((json[type] !== undefined) && append) {
508 if ((json[type] !== undefined) && append) {
509 md = json.metadata || {};
509 var md = json.metadata || {};
510 append.apply(this, [json[type], md, element]);
510 append.apply(this, [json[type], md, element]);
511 return true;
511 return true;
512 }
512 }
@@ -516,7 +516,7 b' var IPython = (function (IPython) {'
516
516
517
517
518 OutputArea.prototype.append_html = function (html, md, element) {
518 OutputArea.prototype.append_html = function (html, md, element) {
519 type = 'text/html';
519 var type = 'text/html';
520 var toinsert = this.create_output_subarea(md, "output_html rendered_html", type);
520 var toinsert = this.create_output_subarea(md, "output_html rendered_html", type);
521 IPython.keyboard_manager.register_events(toinsert);
521 IPython.keyboard_manager.register_events(toinsert);
522 toinsert.append(html);
522 toinsert.append(html);
@@ -526,7 +526,7 b' var IPython = (function (IPython) {'
526
526
527 OutputArea.prototype.append_javascript = function (js, md, container) {
527 OutputArea.prototype.append_javascript = function (js, md, container) {
528 // We just eval the JS code, element appears in the local scope.
528 // We just eval the JS code, element appears in the local scope.
529 type = 'application/javascript';
529 var type = 'application/javascript';
530 var element = this.create_output_subarea(md, "output_javascript", type);
530 var element = this.create_output_subarea(md, "output_javascript", type);
531 IPython.keyboard_manager.register_events(element);
531 IPython.keyboard_manager.register_events(element);
532 container.append(element);
532 container.append(element);
@@ -540,7 +540,7 b' var IPython = (function (IPython) {'
540
540
541
541
542 OutputArea.prototype.append_text = function (data, md, element, extra_class) {
542 OutputArea.prototype.append_text = function (data, md, element, extra_class) {
543 type = 'text/plain';
543 var type = 'text/plain';
544 var toinsert = this.create_output_subarea(md, "output_text", type);
544 var toinsert = this.create_output_subarea(md, "output_text", type);
545 // escape ANSI & HTML specials in plaintext:
545 // escape ANSI & HTML specials in plaintext:
546 data = utils.fixConsole(data);
546 data = utils.fixConsole(data);
@@ -555,7 +555,7 b' var IPython = (function (IPython) {'
555
555
556
556
557 OutputArea.prototype.append_svg = function (svg, md, element) {
557 OutputArea.prototype.append_svg = function (svg, md, element) {
558 type = 'image/svg+xml';
558 var type = 'image/svg+xml';
559 var toinsert = this.create_output_subarea(md, "output_svg", type);
559 var toinsert = this.create_output_subarea(md, "output_svg", type);
560 toinsert.append(svg);
560 toinsert.append(svg);
561 element.append(toinsert);
561 element.append(toinsert);
@@ -590,7 +590,7 b' var IPython = (function (IPython) {'
590
590
591
591
592 OutputArea.prototype.append_png = function (png, md, element) {
592 OutputArea.prototype.append_png = function (png, md, element) {
593 type = 'image/png';
593 var type = 'image/png';
594 var toinsert = this.create_output_subarea(md, "output_png", type);
594 var toinsert = this.create_output_subarea(md, "output_png", type);
595 var img = $("<img/>");
595 var img = $("<img/>");
596 img[0].setAttribute('src','data:image/png;base64,'+png);
596 img[0].setAttribute('src','data:image/png;base64,'+png);
@@ -607,7 +607,7 b' var IPython = (function (IPython) {'
607
607
608
608
609 OutputArea.prototype.append_jpeg = function (jpeg, md, element) {
609 OutputArea.prototype.append_jpeg = function (jpeg, md, element) {
610 type = 'image/jpeg';
610 var type = 'image/jpeg';
611 var toinsert = this.create_output_subarea(md, "output_jpeg", type);
611 var toinsert = this.create_output_subarea(md, "output_jpeg", type);
612 var img = $("<img/>").attr('src','data:image/jpeg;base64,'+jpeg);
612 var img = $("<img/>").attr('src','data:image/jpeg;base64,'+jpeg);
613 if (md['height']) {
613 if (md['height']) {
@@ -625,7 +625,7 b' var IPython = (function (IPython) {'
625 OutputArea.prototype.append_latex = function (latex, md, element) {
625 OutputArea.prototype.append_latex = function (latex, md, element) {
626 // This method cannot do the typesetting because the latex first has to
626 // This method cannot do the typesetting because the latex first has to
627 // be on the page.
627 // be on the page.
628 type = 'text/latex';
628 var type = 'text/latex';
629 var toinsert = this.create_output_subarea(md, "output_latex", type);
629 var toinsert = this.create_output_subarea(md, "output_latex", type);
630 toinsert.append(latex);
630 toinsert.append(latex);
631 element.append(toinsert);
631 element.append(toinsert);
General Comments 0
You need to be logged in to leave comments. Login now