Skip to content

Commit

Permalink
display order in output area configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Feb 10, 2013
1 parent 03ea8ef commit 46167f0
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions IPython/frontend/html/notebook/static/js/outputarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,20 @@ var IPython = (function (IPython) {
};
};

OutputArea.display_order = ['javascript','html','latex','svg','png','jpeg','text'];

OutputArea.prototype.append_mime_type = function (json, element, dynamic) {
if (json.javascript !== undefined && dynamic) {
this.append_javascript(json.javascript, element, dynamic);
} else if (json.html !== undefined) {
this.append_html(json.html, element);
} else if (json.latex !== undefined) {
this.append_latex(json.latex, element);
} else if (json.svg !== undefined) {
this.append_svg(json.svg, element);
} else if (json.png !== undefined) {
this.append_png(json.png, element);
} else if (json.jpeg !== undefined) {
this.append_jpeg(json.jpeg, element);
} else if (json.text !== undefined) {
this.append_text(json.text, element);
};
for(var type_i in OutputArea.display_order){
var type = OutputArea.display_order[type_i];
if(json[type] != undefined ){
if(type != 'javascript' && dynamic){
this['append_'+type](json[type],element)
} else {
this.append_javascript(json.javascript, element, dynamic);
}
return
}
}
};


Expand Down

0 comments on commit 46167f0

Please sign in to comment.