##// END OF EJS Templates
Wired up the javascript display protocol using eval.
Brian Granger -
Show More
@@ -655,6 +655,8 b' var IPython = (function (IPython) {'
655 CodeCell.prototype.append_mime_type = function (json, element) {
655 CodeCell.prototype.append_mime_type = function (json, element) {
656 if (json.html !== undefined) {
656 if (json.html !== undefined) {
657 this.append_html(json.html, element);
657 this.append_html(json.html, element);
658 } else if (json.javascript !== undefined) {
659 this.append_javascript(json.javascript, element);
658 } else if (json.latex !== undefined) {
660 } else if (json.latex !== undefined) {
659 this.append_latex(json.latex, element);
661 this.append_latex(json.latex, element);
660 } else if (json.svg !== undefined) {
662 } else if (json.svg !== undefined) {
@@ -676,6 +678,12 b' var IPython = (function (IPython) {'
676 };
678 };
677
679
678
680
681 CodeCell.prototype.append_javascript = function (js, element) {
682 // We just eval the JS code, element appears in the local scope.
683 eval(js);
684 }
685
686
679 CodeCell.prototype.append_text = function (data, element, extra_class) {
687 CodeCell.prototype.append_text = function (data, element, extra_class) {
680 var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_text");
688 var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_text");
681 // escape ANSI & HTML specials in plaintext:
689 // escape ANSI & HTML specials in plaintext:
@@ -993,7 +993,6 b' var IPython = (function (IPython) {'
993 } else if (msg_type === 'status') {
993 } else if (msg_type === 'status') {
994 if (content.execution_state === 'busy') {
994 if (content.execution_state === 'busy') {
995 $([IPython.events]).trigger('status_busy.Kernel');
995 $([IPython.events]).trigger('status_busy.Kernel');
996 IPython.kernel_status_widget.status_busy();
997 } else if (content.execution_state === 'idle') {
996 } else if (content.execution_state === 'idle') {
998 $([IPython.events]).trigger('status_idle.Kernel');
997 $([IPython.events]).trigger('status_idle.Kernel');
999 } else if (content.execution_state === 'dead') {
998 } else if (content.execution_state === 'dead') {
General Comments 0
You need to be logged in to leave comments. Login now