Show More
@@ -36,6 +36,29 b' define(["notebook/js/widget"], function(widget_manager){' | |||||
36 |
|
36 | |||
37 | widget_manager.register_widget_view('HTMLView', HTMLView); |
|
37 | widget_manager.register_widget_view('HTMLView', HTMLView); | |
38 |
|
38 | |||
|
39 | ||||
|
40 | var LatexView = IPython.WidgetView.extend({ | |||
|
41 | ||||
|
42 | // Called when view is rendered. | |||
|
43 | render : function(){ | |||
|
44 | this.update(); // Set defaults. | |||
|
45 | }, | |||
|
46 | ||||
|
47 | // Handles: Backend -> Frontend Sync | |||
|
48 | // Frontent -> Frontend Sync | |||
|
49 | update : function(){ | |||
|
50 | var that=this; | |||
|
51 | this.$el.html(this.model.get('value')); | |||
|
52 | var math_el = that.$el.get(0); | |||
|
53 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,math_el]); | |||
|
54 | ||||
|
55 | return IPython.WidgetView.prototype.update.call(this); | |||
|
56 | }, | |||
|
57 | ||||
|
58 | }); | |||
|
59 | ||||
|
60 | widget_manager.register_widget_view('LatexView', LatexView); | |||
|
61 | ||||
39 | var TextAreaView = IPython.WidgetView.extend({ |
|
62 | var TextAreaView = IPython.WidgetView.extend({ | |
40 |
|
63 | |||
41 | // Called when view is rendered. |
|
64 | // Called when view is rendered. |
@@ -314,6 +314,7 b'' | |||||
314 | "| | *DropdownView* |\n", |
|
314 | "| | *DropdownView* |\n", | |
315 | "| | ListBoxView |\n", |
|
315 | "| | ListBoxView |\n", | |
316 | "| StringWidget | HTMLView |\n", |
|
316 | "| StringWidget | HTMLView |\n", | |
|
317 | "| | LatexView |\n", | |||
317 | "| | TextAreaView |\n", |
|
318 | "| | TextAreaView |\n", | |
318 | "| | *TextBoxView* |\n" |
|
319 | "| | *TextBoxView* |\n" | |
319 | ] |
|
320 | ] |
General Comments 0
You need to be logged in to leave comments.
Login now