Show More
@@ -42,79 +42,6 var IPython = (function (IPython) { | |||||
42 | this.bind_events(); |
|
42 | this.bind_events(); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 | /** |
|
|||
46 | * Class properties |
|
|||
47 | **/ |
|
|||
48 |
|
||||
49 | /** |
|
|||
50 | * Threshold to trigger autoscroll when the OutputArea is resized, |
|
|||
51 | * typically when new outputs are added. |
|
|||
52 | * |
|
|||
53 | * Behavior is undefined if autoscroll is lower than minimum_scroll_threshold, |
|
|||
54 | * unless it is < 0, in which case autoscroll will never be triggered |
|
|||
55 | * |
|
|||
56 | * @property auto_scroll_threshold |
|
|||
57 | * @type Number |
|
|||
58 | * @default 100 |
|
|||
59 | * |
|
|||
60 | **/ |
|
|||
61 | OutputArea.auto_scroll_threshold = 100; |
|
|||
62 |
|
||||
63 | /** |
|
|||
64 | * Lower limit (in lines) for OutputArea to be made scrollable. OutputAreas |
|
|||
65 | * shorter than this are never scrolled. |
|
|||
66 | * |
|
|||
67 | * @property minimum_scroll_threshold |
|
|||
68 | * @type Number |
|
|||
69 | * @default 20 |
|
|||
70 | * |
|
|||
71 | **/ |
|
|||
72 | OutputArea.minimum_scroll_threshold = 20; |
|
|||
73 |
|
||||
74 |
|
||||
75 |
|
||||
76 | OutputArea.mime_map = { |
|
|||
77 | "text/plain" : "text", |
|
|||
78 | "text/html" : "html", |
|
|||
79 | "image/svg+xml" : "svg", |
|
|||
80 | "image/png" : "png", |
|
|||
81 | "image/jpeg" : "jpeg", |
|
|||
82 | "text/latex" : "latex", |
|
|||
83 | "application/json" : "json", |
|
|||
84 | "application/javascript" : "javascript", |
|
|||
85 | }; |
|
|||
86 |
|
||||
87 | OutputArea.mime_map_r = { |
|
|||
88 | "text" : "text/plain", |
|
|||
89 | "html" : "text/html", |
|
|||
90 | "svg" : "image/svg+xml", |
|
|||
91 | "png" : "image/png", |
|
|||
92 | "jpeg" : "image/jpeg", |
|
|||
93 | "latex" : "text/latex", |
|
|||
94 | "json" : "application/json", |
|
|||
95 | "javascript" : "application/javascript", |
|
|||
96 | }; |
|
|||
97 |
|
||||
98 | OutputArea.display_order = [ |
|
|||
99 | 'application/javascript', |
|
|||
100 | 'text/html', |
|
|||
101 | 'text/latex', |
|
|||
102 | 'image/svg+xml', |
|
|||
103 | 'image/png', |
|
|||
104 | 'image/jpeg', |
|
|||
105 | 'text/plain' |
|
|||
106 | ]; |
|
|||
107 |
|
||||
108 | OutputArea.append_map = { |
|
|||
109 | "text/plain" : OutputArea.prototype.append_text, |
|
|||
110 | "text/html" : OutputArea.prototype.append_html, |
|
|||
111 | "image/svg+xml" : OutputArea.prototype.append_svg, |
|
|||
112 | "image/png" : OutputArea.prototype.append_png, |
|
|||
113 | "image/jpeg" : OutputArea.prototype.append_jpeg, |
|
|||
114 | "text/latex" : OutputArea.prototype.append_latex, |
|
|||
115 | "application/json" : OutputArea.prototype.append_json, |
|
|||
116 | "application/javascript" : OutputArea.prototype.append_javascript, |
|
|||
117 | }; |
|
|||
118 |
|
45 | |||
119 | /** |
|
46 | /** | |
120 | * Class prototypes |
|
47 | * Class prototypes | |
@@ -835,6 +762,79 var IPython = (function (IPython) { | |||||
835 | return outputs; |
|
762 | return outputs; | |
836 | }; |
|
763 | }; | |
837 |
|
764 | |||
|
765 | /** | |||
|
766 | * Class properties | |||
|
767 | **/ | |||
|
768 | ||||
|
769 | /** | |||
|
770 | * Threshold to trigger autoscroll when the OutputArea is resized, | |||
|
771 | * typically when new outputs are added. | |||
|
772 | * | |||
|
773 | * Behavior is undefined if autoscroll is lower than minimum_scroll_threshold, | |||
|
774 | * unless it is < 0, in which case autoscroll will never be triggered | |||
|
775 | * | |||
|
776 | * @property auto_scroll_threshold | |||
|
777 | * @type Number | |||
|
778 | * @default 100 | |||
|
779 | * | |||
|
780 | **/ | |||
|
781 | OutputArea.auto_scroll_threshold = 100; | |||
|
782 | ||||
|
783 | /** | |||
|
784 | * Lower limit (in lines) for OutputArea to be made scrollable. OutputAreas | |||
|
785 | * shorter than this are never scrolled. | |||
|
786 | * | |||
|
787 | * @property minimum_scroll_threshold | |||
|
788 | * @type Number | |||
|
789 | * @default 20 | |||
|
790 | * | |||
|
791 | **/ | |||
|
792 | OutputArea.minimum_scroll_threshold = 20; | |||
|
793 | ||||
|
794 | ||||
|
795 | ||||
|
796 | OutputArea.mime_map = { | |||
|
797 | "text/plain" : "text", | |||
|
798 | "text/html" : "html", | |||
|
799 | "image/svg+xml" : "svg", | |||
|
800 | "image/png" : "png", | |||
|
801 | "image/jpeg" : "jpeg", | |||
|
802 | "text/latex" : "latex", | |||
|
803 | "application/json" : "json", | |||
|
804 | "application/javascript" : "javascript", | |||
|
805 | }; | |||
|
806 | ||||
|
807 | OutputArea.mime_map_r = { | |||
|
808 | "text" : "text/plain", | |||
|
809 | "html" : "text/html", | |||
|
810 | "svg" : "image/svg+xml", | |||
|
811 | "png" : "image/png", | |||
|
812 | "jpeg" : "image/jpeg", | |||
|
813 | "latex" : "text/latex", | |||
|
814 | "json" : "application/json", | |||
|
815 | "javascript" : "application/javascript", | |||
|
816 | }; | |||
|
817 | ||||
|
818 | OutputArea.display_order = [ | |||
|
819 | 'application/javascript', | |||
|
820 | 'text/html', | |||
|
821 | 'text/latex', | |||
|
822 | 'image/svg+xml', | |||
|
823 | 'image/png', | |||
|
824 | 'image/jpeg', | |||
|
825 | 'text/plain' | |||
|
826 | ]; | |||
|
827 | ||||
|
828 | OutputArea.append_map = { | |||
|
829 | "text/plain" : OutputArea.prototype.append_text, | |||
|
830 | "text/html" : OutputArea.prototype.append_html, | |||
|
831 | "image/svg+xml" : OutputArea.prototype.append_svg, | |||
|
832 | "image/png" : OutputArea.prototype.append_png, | |||
|
833 | "image/jpeg" : OutputArea.prototype.append_jpeg, | |||
|
834 | "text/latex" : OutputArea.prototype.append_latex, | |||
|
835 | "application/json" : OutputArea.prototype.append_json, | |||
|
836 | "application/javascript" : OutputArea.prototype.append_javascript, | |||
|
837 | }; | |||
838 |
|
838 | |||
839 | IPython.OutputArea = OutputArea; |
|
839 | IPython.OutputArea = OutputArea; | |
840 |
|
840 |
General Comments 0
You need to be logged in to leave comments.
Login now