mirror of
https://github.com/jupyter/notebook.git
synced 2024-11-27 03:20:27 +08:00
dispatch on mime type for append methods
This commit is contained in:
parent
a6be6e9821
commit
e094fca4ef
@ -514,11 +514,12 @@ var IPython = (function (IPython) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
var old_name = OutputArea.mime_map[type]
|
||||
this['append_'+old_name](json[type], md, element, type);
|
||||
return true;
|
||||
var append = OutputArea.append_map[type];
|
||||
if (append !== undefined) {
|
||||
append.apply(this, [json[type], md, element, type]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -634,6 +635,17 @@ var IPython = (function (IPython) {
|
||||
element.append(toinsert);
|
||||
};
|
||||
|
||||
OutputArea.append_map = {
|
||||
"text/plain" : OutputArea.prototype.append_text,
|
||||
"text/html" : OutputArea.prototype.append_html,
|
||||
"image/svg+xml" : OutputArea.prototype.append_svg,
|
||||
"image/png" : OutputArea.prototype.append_png,
|
||||
"image/jpeg" : OutputArea.prototype.append_jpeg,
|
||||
"text/latex" : OutputArea.prototype.append_latex,
|
||||
"application/json" : OutputArea.prototype.append_json,
|
||||
"application/javascript" : OutputArea.prototype.append_javascript,
|
||||
};
|
||||
|
||||
OutputArea.prototype.append_raw_input = function (msg) {
|
||||
var that = this;
|
||||
this.expand();
|
||||
|
Loading…
Reference in New Issue
Block a user