From 0db7ab16a3bb5bc7c032a29efed2a7da7578c9ff Mon Sep 17 00:00:00 2001 From: "Brian E. Granger" Date: Thu, 11 Aug 2011 14:17:01 -0700 Subject: [PATCH] Finishing display system work. * Added image/jpeg MIME type to notebook format, the core display logic and the notebook. * Finished HTML, SVG, Image, Math, Javascript, JSON classes. --- .../html/notebook/static/js/codecell.js | 27 ++++++++++++++----- .../html/notebook/static/js/notebook.js | 3 +++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 6b2c9523f..1ffc2928f 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -205,13 +205,15 @@ var IPython = (function (IPython) { CodeCell.prototype.append_pyerr = function (json) { var tb = json.traceback; - var s = ''; - var len = tb.length; - for (var i=0; i").addClass("output_area output_jpeg"); + toinsert.append($("").attr('src','data:image/jpeg;base64,'+jpeg)); + element.append(toinsert); + return element; + }; + + CodeCell.prototype.append_latex = function (latex, element) { // This method cannot do the typesetting because the latex first has to // be on the page. diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js index 27e821d89..f415dde45 100644 --- a/IPython/frontend/html/notebook/static/js/notebook.js +++ b/IPython/frontend/html/notebook/static/js/notebook.js @@ -544,6 +544,9 @@ var IPython = (function (IPython) { if (data['image/png'] !== undefined) { json.png = data['image/png']; }; + if (data['image/jpeg'] !== undefined) { + json.jpeg = data['image/jpeg']; + }; if (data['text/latex'] !== undefined) { json.latex = data['text/latex']; };