From bac8c3816fbbceb252736083ac42d08c931625ae 2014-02-01 10:42:28 From: Matthias BUSSONNIER <bussonniermatthias@gmail.com> Date: 2014-02-01 10:42:28 Subject: [PATCH] put OutputArea map at the end --- diff --git a/IPython/html/static/notebook/js/outputarea.js b/IPython/html/static/notebook/js/outputarea.js index b762b44..a062c45 100644 --- a/IPython/html/static/notebook/js/outputarea.js +++ b/IPython/html/static/notebook/js/outputarea.js @@ -42,79 +42,6 @@ var IPython = (function (IPython) { this.bind_events(); }; - /** - * Class properties - **/ - - /** - * Threshold to trigger autoscroll when the OutputArea is resized, - * typically when new outputs are added. - * - * Behavior is undefined if autoscroll is lower than minimum_scroll_threshold, - * unless it is < 0, in which case autoscroll will never be triggered - * - * @property auto_scroll_threshold - * @type Number - * @default 100 - * - **/ - OutputArea.auto_scroll_threshold = 100; - - /** - * Lower limit (in lines) for OutputArea to be made scrollable. OutputAreas - * shorter than this are never scrolled. - * - * @property minimum_scroll_threshold - * @type Number - * @default 20 - * - **/ - OutputArea.minimum_scroll_threshold = 20; - - - - OutputArea.mime_map = { - "text/plain" : "text", - "text/html" : "html", - "image/svg+xml" : "svg", - "image/png" : "png", - "image/jpeg" : "jpeg", - "text/latex" : "latex", - "application/json" : "json", - "application/javascript" : "javascript", - }; - - OutputArea.mime_map_r = { - "text" : "text/plain", - "html" : "text/html", - "svg" : "image/svg+xml", - "png" : "image/png", - "jpeg" : "image/jpeg", - "latex" : "text/latex", - "json" : "application/json", - "javascript" : "application/javascript", - }; - - OutputArea.display_order = [ - 'application/javascript', - 'text/html', - 'text/latex', - 'image/svg+xml', - 'image/png', - 'image/jpeg', - 'text/plain' - ]; - - 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, - }; /** * Class prototypes @@ -835,6 +762,79 @@ var IPython = (function (IPython) { return outputs; }; + /** + * Class properties + **/ + + /** + * Threshold to trigger autoscroll when the OutputArea is resized, + * typically when new outputs are added. + * + * Behavior is undefined if autoscroll is lower than minimum_scroll_threshold, + * unless it is < 0, in which case autoscroll will never be triggered + * + * @property auto_scroll_threshold + * @type Number + * @default 100 + * + **/ + OutputArea.auto_scroll_threshold = 100; + + /** + * Lower limit (in lines) for OutputArea to be made scrollable. OutputAreas + * shorter than this are never scrolled. + * + * @property minimum_scroll_threshold + * @type Number + * @default 20 + * + **/ + OutputArea.minimum_scroll_threshold = 20; + + + + OutputArea.mime_map = { + "text/plain" : "text", + "text/html" : "html", + "image/svg+xml" : "svg", + "image/png" : "png", + "image/jpeg" : "jpeg", + "text/latex" : "latex", + "application/json" : "json", + "application/javascript" : "javascript", + }; + + OutputArea.mime_map_r = { + "text" : "text/plain", + "html" : "text/html", + "svg" : "image/svg+xml", + "png" : "image/png", + "jpeg" : "image/jpeg", + "latex" : "text/latex", + "json" : "application/json", + "javascript" : "application/javascript", + }; + + OutputArea.display_order = [ + 'application/javascript', + 'text/html', + 'text/latex', + 'image/svg+xml', + 'image/png', + 'image/jpeg', + 'text/plain' + ]; + + 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, + }; IPython.OutputArea = OutputArea;