mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Wired up the javascript display protocol using eval.
This commit is contained in:
parent
cd0810ee25
commit
893572d3ad
@ -655,6 +655,8 @@ var IPython = (function (IPython) {
|
||||
CodeCell.prototype.append_mime_type = function (json, element) {
|
||||
if (json.html !== undefined) {
|
||||
this.append_html(json.html, element);
|
||||
} else if (json.javascript !== undefined) {
|
||||
this.append_javascript(json.javascript, element);
|
||||
} else if (json.latex !== undefined) {
|
||||
this.append_latex(json.latex, element);
|
||||
} else if (json.svg !== undefined) {
|
||||
@ -676,6 +678,12 @@ var IPython = (function (IPython) {
|
||||
};
|
||||
|
||||
|
||||
CodeCell.prototype.append_javascript = function (js, element) {
|
||||
// We just eval the JS code, element appears in the local scope.
|
||||
eval(js);
|
||||
}
|
||||
|
||||
|
||||
CodeCell.prototype.append_text = function (data, element, extra_class) {
|
||||
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_text");
|
||||
// escape ANSI & HTML specials in plaintext:
|
||||
|
@ -993,7 +993,6 @@ var IPython = (function (IPython) {
|
||||
} else if (msg_type === 'status') {
|
||||
if (content.execution_state === 'busy') {
|
||||
$([IPython.events]).trigger('status_busy.Kernel');
|
||||
IPython.kernel_status_widget.status_busy();
|
||||
} else if (content.execution_state === 'idle') {
|
||||
$([IPython.events]).trigger('status_idle.Kernel');
|
||||
} else if (content.execution_state === 'dead') {
|
||||
|
Loading…
Reference in New Issue
Block a user