##// END OF EJS Templates
Remove init_widget_js, use require.js for everything...
Jonathan Frederic -
Show More
@@ -14,7 +14,8 b''
14 14 // as injecting require.js make marked not to put itself in the globals,
15 15 // which make both this file fail at setting marked configuration, and textcell.js
16 16 // which search marked into global.
17 require(['components/marked/lib/marked'],
17 require(['components/marked/lib/marked',
18 'notebook/js/widgets/basic_widgets'],
18 19
19 20 function (marked) {
20 21
@@ -1295,11 +1295,13 b' var IPython = (function (IPython) {'
1295 1295
1296 1296
1297 1297 /**
1298 * Once a session is started, link the code cells to the kernel
1298 * Once a session is started, link the code cells to the kernel and pass the
1299 * comm manager to the widget manager
1299 1300 *
1300 1301 */
1301 1302 Notebook.prototype._session_started = function(){
1302 1303 this.kernel = this.session.kernel;
1304 IPython.widget_manager.attach_comm_manager(this.kernel.comm_manager);
1303 1305 var ncells = this.ncells();
1304 1306 for (var i=0; i<ncells; i++) {
1305 1307 var cell = this.get_cell(i);
@@ -24,8 +24,6 b' define(["components/underscore/underscore-min",'
24 24 "components/backbone/backbone-min",
25 25 ], function(){
26 26
27 // Only run once on a notebook.
28 if (IPython.notebook.widget_manager == undefined) {
29 27
30 28 //--------------------------------------------------------------------
31 29 // WidgetModel class
@@ -73,8 +71,8 b' define(["components/underscore/underscore-min",'
73 71
74 72 // Send buffer if this message caused another message to be
75 73 // throttled.
76 if (this.msg_buffer != null) {
77 if (this.msg_throttle == this.pending_msgs &&
74 if (this.msg_buffer != null &&
75 this.msg_throttle == this.pending_msgs &&
78 76 this.msg_buffer.length > 0) {
79 77
80 78 var output_area = this._get_msg_output_area(msg);
@@ -89,7 +87,6 b' define(["components/underscore/underscore-min",'
89 87 --this.pending_msgs;
90 88 }
91 89 }
92 }
93 90 },
94 91
95 92
@@ -421,8 +418,8 b' define(["components/underscore/underscore-min",'
421 418 //--------------------------------------------------------------------
422 419 // WidgetManager class
423 420 //--------------------------------------------------------------------
424 var WidgetManager = function(comm_manager){
425 this.comm_manager = comm_manager;
421 var WidgetManager = function(){
422 this.comm_manager = null;
426 423 this.widget_model_types = {};
427 424 this.widget_view_types = {};
428 425
@@ -436,10 +433,22 b' define(["components/underscore/underscore-min",'
436 433 }
437 434
438 435
436 WidgetManager.prototype.attach_comm_manager = function (comm_manager) {
437 this.comm_manager = comm_manager;
438
439 // Register already register widget model types with the comm manager.
440 for (var widget_model_name in this.widget_model_types) {
441 this.comm_manager.register_target(widget_model_name, $.proxy(this.handle_com_open, this));
442 }
443 }
444
445
439 446 WidgetManager.prototype.register_widget_model = function (widget_model_name, widget_model_type) {
440 447 // Register the widget with the comm manager. Make sure to pass this object's context
441 448 // in so `this` works in the call back.
449 if (this.comm_manager!=null) {
442 450 this.comm_manager.register_target(widget_model_name, $.proxy(this.handle_com_open, this));
451 }
443 452 this.widget_model_types[widget_model_name] = widget_model_type;
444 453 }
445 454
@@ -462,7 +471,6 b' define(["components/underscore/underscore-min",'
462 471 IPython.WidgetModel = WidgetModel;
463 472 IPython.WidgetView = WidgetView;
464 473
465 IPython.notebook.widget_manager = new WidgetManager(IPython.notebook.kernel.comm_manager);
474 IPython.widget_manager = new WidgetManager();
466 475
467 };
468 476 });
@@ -1,8 +1,8 b''
1 1
2 require(["notebook/js/widget"], function(){
2 define(["notebook/js/widget"], function(){
3 3
4 4 var BoolWidgetModel = IPython.WidgetModel.extend({});
5 IPython.notebook.widget_manager.register_widget_model('BoolWidgetModel', BoolWidgetModel);
5 IPython.widget_manager.register_widget_model('BoolWidgetModel', BoolWidgetModel);
6 6
7 7 var CheckboxView = IPython.WidgetView.extend({
8 8
@@ -51,7 +51,7 b' require(["notebook/js/widget"], function(){'
51 51
52 52 });
53 53
54 IPython.notebook.widget_manager.register_widget_view('CheckboxView', CheckboxView);
54 IPython.widget_manager.register_widget_view('CheckboxView', CheckboxView);
55 55
56 56 var ToggleButtonView = IPython.WidgetView.extend({
57 57
@@ -104,6 +104,6 b' require(["notebook/js/widget"], function(){'
104 104 },
105 105 });
106 106
107 IPython.notebook.widget_manager.register_widget_view('ToggleButtonView', ToggleButtonView);
107 IPython.widget_manager.register_widget_view('ToggleButtonView', ToggleButtonView);
108 108
109 109 });
@@ -1,8 +1,8 b''
1 1
2 require(["notebook/js/widget"], function(){
2 define(["notebook/js/widget"], function(){
3 3
4 4 var ButtonWidgetModel = IPython.WidgetModel.extend({});
5 IPython.notebook.widget_manager.register_widget_model('ButtonWidgetModel', ButtonWidgetModel);
5 IPython.widget_manager.register_widget_model('ButtonWidgetModel', ButtonWidgetModel);
6 6
7 7 var ButtonView = IPython.WidgetView.extend({
8 8
@@ -34,6 +34,6 b' require(["notebook/js/widget"], function(){'
34 34
35 35 });
36 36
37 IPython.notebook.widget_manager.register_widget_view('ButtonView', ButtonView);
37 IPython.widget_manager.register_widget_view('ButtonView', ButtonView);
38 38
39 39 });
@@ -1,6 +1,6 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var ContainerModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('ContainerWidgetModel', ContainerModel);
3 IPython.widget_manager.register_widget_model('ContainerWidgetModel', ContainerModel);
4 4
5 5 var ContainerView = IPython.WidgetView.extend({
6 6
@@ -42,5 +42,5 b' require(["notebook/js/widget"], function(){'
42 42 },
43 43 });
44 44
45 IPython.notebook.widget_manager.register_widget_view('ContainerView', ContainerView);
45 IPython.widget_manager.register_widget_view('ContainerView', ContainerView);
46 46 }); No newline at end of file
@@ -1,4 +1,4 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var FloatWidgetModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('FloatWidgetModel', FloatWidgetModel);
3 IPython.widget_manager.register_widget_model('FloatWidgetModel', FloatWidgetModel);
4 4 }); No newline at end of file
@@ -1,6 +1,6 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var FloatRangeWidgetModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('FloatRangeWidgetModel', FloatRangeWidgetModel);
3 IPython.widget_manager.register_widget_model('FloatRangeWidgetModel', FloatRangeWidgetModel);
4 4
5 5 var FloatSliderView = IPython.WidgetView.extend({
6 6
@@ -97,7 +97,7 b' require(["notebook/js/widget"], function(){'
97 97 },
98 98 });
99 99
100 IPython.notebook.widget_manager.register_widget_view('FloatSliderView', FloatSliderView);
100 IPython.widget_manager.register_widget_view('FloatSliderView', FloatSliderView);
101 101
102 102
103 103 var FloatTextView = IPython.WidgetView.extend({
@@ -188,7 +188,7 b' require(["notebook/js/widget"], function(){'
188 188 }
189 189 });
190 190
191 IPython.notebook.widget_manager.register_widget_view('FloatTextView', FloatTextView);
191 IPython.widget_manager.register_widget_view('FloatTextView', FloatTextView);
192 192
193 193
194 194 var ProgressView = IPython.WidgetView.extend({
@@ -235,5 +235,5 b' require(["notebook/js/widget"], function(){'
235 235
236 236 });
237 237
238 IPython.notebook.widget_manager.register_widget_view('ProgressView', ProgressView);
238 IPython.widget_manager.register_widget_view('ProgressView', ProgressView);
239 239 });
@@ -1,4 +1,4 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var IntWidgetModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel);
3 IPython.widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel);
4 4 }); No newline at end of file
@@ -1,6 +1,6 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var IntRangeWidgetModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('IntRangeWidgetModel', IntRangeWidgetModel);
3 IPython.widget_manager.register_widget_model('IntRangeWidgetModel', IntRangeWidgetModel);
4 4
5 5 var IntSliderView = IPython.WidgetView.extend({
6 6
@@ -97,7 +97,7 b' require(["notebook/js/widget"], function(){'
97 97 },
98 98 });
99 99
100 IPython.notebook.widget_manager.register_widget_view('IntSliderView', IntSliderView);
100 IPython.widget_manager.register_widget_view('IntSliderView', IntSliderView);
101 101
102 102 var IntTextView = IPython.WidgetView.extend({
103 103
@@ -187,5 +187,5 b' require(["notebook/js/widget"], function(){'
187 187 }
188 188 });
189 189
190 IPython.notebook.widget_manager.register_widget_view('IntTextView', IntTextView);
190 IPython.widget_manager.register_widget_view('IntTextView', IntTextView);
191 191 });
@@ -1,6 +1,6 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var MulticontainerModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('MulticontainerWidgetModel', MulticontainerModel);
3 IPython.widget_manager.register_widget_model('MulticontainerWidgetModel', MulticontainerModel);
4 4
5 5 var AccordionView = IPython.WidgetView.extend({
6 6
@@ -57,7 +57,7 b' require(["notebook/js/widget"], function(){'
57 57 },
58 58 });
59 59
60 IPython.notebook.widget_manager.register_widget_view('AccordionView', AccordionView);
60 IPython.widget_manager.register_widget_view('AccordionView', AccordionView);
61 61
62 62 var TabView = IPython.WidgetView.extend({
63 63
@@ -134,6 +134,6 b' require(["notebook/js/widget"], function(){'
134 134 },
135 135 });
136 136
137 IPython.notebook.widget_manager.register_widget_view('TabView', TabView);
137 IPython.widget_manager.register_widget_view('TabView', TabView);
138 138
139 139 });
@@ -1,6 +1,6 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var SelectionWidgetModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);
3 IPython.widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);
4 4
5 5 var DropdownView = IPython.WidgetView.extend({
6 6
@@ -80,7 +80,7 b' require(["notebook/js/widget"], function(){'
80 80
81 81 });
82 82
83 IPython.notebook.widget_manager.register_widget_view('DropdownView', DropdownView);
83 IPython.widget_manager.register_widget_view('DropdownView', DropdownView);
84 84
85 85 var RadioButtonsView = IPython.WidgetView.extend({
86 86
@@ -165,7 +165,7 b' require(["notebook/js/widget"], function(){'
165 165
166 166 });
167 167
168 IPython.notebook.widget_manager.register_widget_view('RadioButtonsView', RadioButtonsView);
168 IPython.widget_manager.register_widget_view('RadioButtonsView', RadioButtonsView);
169 169
170 170
171 171 var ToggleButtonsView = IPython.WidgetView.extend({
@@ -247,5 +247,5 b' require(["notebook/js/widget"], function(){'
247 247
248 248 });
249 249
250 IPython.notebook.widget_manager.register_widget_view('ToggleButtonsView', ToggleButtonsView);
250 IPython.widget_manager.register_widget_view('ToggleButtonsView', ToggleButtonsView);
251 251 });
@@ -1,6 +1,6 b''
1 require(["notebook/js/widget"], function(){
1 define(["notebook/js/widget"], function(){
2 2 var StringWidgetModel = IPython.WidgetModel.extend({});
3 IPython.notebook.widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel);
3 IPython.widget_manager.register_widget_model('StringWidgetModel', StringWidgetModel);
4 4
5 5 var LabelView = IPython.WidgetView.extend({
6 6
@@ -19,7 +19,7 b' require(["notebook/js/widget"], function(){'
19 19
20 20 });
21 21
22 IPython.notebook.widget_manager.register_widget_view('LabelView', LabelView);
22 IPython.widget_manager.register_widget_view('LabelView', LabelView);
23 23
24 24 var TextAreaView = IPython.WidgetView.extend({
25 25
@@ -73,7 +73,7 b' require(["notebook/js/widget"], function(){'
73 73 },
74 74 });
75 75
76 IPython.notebook.widget_manager.register_widget_view('TextAreaView', TextAreaView);
76 IPython.widget_manager.register_widget_view('TextAreaView', TextAreaView);
77 77
78 78 var TextBoxView = IPython.WidgetView.extend({
79 79
@@ -127,5 +127,5 b' require(["notebook/js/widget"], function(){'
127 127 },
128 128 });
129 129
130 IPython.notebook.widget_manager.register_widget_view('TextBoxView', TextBoxView);
130 IPython.widget_manager.register_widget_view('TextBoxView', TextBoxView);
131 131 });
@@ -1,4 +1,4 b''
1 from .widget import Widget, init_widget_js
1 from .widget import Widget
2 2
3 3 from .widget_bool import BoolWidget
4 4 from .widget_button import ButtonWidget
@@ -26,19 +26,6 b' from IPython.utils.traitlets import Unicode, Dict, List, Instance, Bool'
26 26 from IPython.display import Javascript, display
27 27 from IPython.utils.py3compat import string_types
28 28
29 #-----------------------------------------------------------------------------
30 # Shared
31 #-----------------------------------------------------------------------------
32 def init_widget_js():
33 path = os.path.split(os.path.abspath( __file__ ))[0]
34 for filepath in glob(os.path.join(path, "*.py")):
35 filename = os.path.split(filepath)[1]
36 name = filename.rsplit('.', 1)[0]
37 if not (name == 'widget' or name == '__init__') and name.startswith('widget_'):
38 # Remove 'widget_' from the start of the name before compiling the path.
39 js_path = 'static/notebook/js/widgets/%s.js' % name[7:]
40 display(Javascript(data='$.getScript($("body").data("baseProjectUrl") + "%s");' % js_path), exclude="text/plain")
41
42 29
43 30 #-----------------------------------------------------------------------------
44 31 # Classes
@@ -18,85 +18,11 b''
18 18 "collapsed": false,
19 19 "input": [
20 20 "from IPython.html import widgets # Widget definitions\n",
21 "from IPython.display import display # Used to display widgets in the notebook\n",
22 "\n",
23 "# Enable widgets in this notebook\n",
24 "widgets.init_widget_js()"
21 "from IPython.display import display # Used to display widgets in the notebook"
25 22 ],
26 23 "language": "python",
27 24 "metadata": {},
28 "outputs": [
29 {
30 "javascript": [
31 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/button.js\");"
32 ],
33 "metadata": {},
34 "output_type": "display_data"
35 },
36 {
37 "javascript": [
38 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/int_range.js\");"
39 ],
40 "metadata": {},
41 "output_type": "display_data"
42 },
43 {
44 "javascript": [
45 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/string.js\");"
46 ],
47 "metadata": {},
48 "output_type": "display_data"
49 },
50 {
51 "javascript": [
52 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/multicontainer.js\");"
53 ],
54 "metadata": {},
55 "output_type": "display_data"
56 },
57 {
58 "javascript": [
59 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/bool.js\");"
60 ],
61 "metadata": {},
62 "output_type": "display_data"
63 },
64 {
65 "javascript": [
66 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/int.js\");"
67 ],
68 "metadata": {},
69 "output_type": "display_data"
70 },
71 {
72 "javascript": [
73 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/selection.js\");"
74 ],
75 "metadata": {},
76 "output_type": "display_data"
77 },
78 {
79 "javascript": [
80 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/float.js\");"
81 ],
82 "metadata": {},
83 "output_type": "display_data"
84 },
85 {
86 "javascript": [
87 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/float_range.js\");"
88 ],
89 "metadata": {},
90 "output_type": "display_data"
91 },
92 {
93 "javascript": [
94 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/container.js\");"
95 ],
96 "metadata": {},
97 "output_type": "display_data"
98 }
99 ],
25 "outputs": [],
100 26 "prompt_number": 1
101 27 },
102 28 {
@@ -141,7 +67,7 b''
141 67 " \n",
142 68 " // Define the FileModel and register it with the widget manager.\n",
143 69 " var FileModel = IPython.WidgetModel.extend({});\n",
144 " IPython.notebook.widget_manager.register_widget_model('FileWidgetModel', FileModel);\n",
70 " IPython.widget_manager.register_widget_model('FileWidgetModel', FileModel);\n",
145 71 " \n",
146 72 " // Define the FilePickerView\n",
147 73 " var FilePickerView = IPython.WidgetView.extend({\n",
@@ -176,7 +102,7 b''
176 102 " });\n",
177 103 " \n",
178 104 " // Register the DatePickerView with the widget manager.\n",
179 " IPython.notebook.widget_manager.register_widget_view('FilePickerView', FilePickerView);\n",
105 " IPython.widget_manager.register_widget_view('FilePickerView', FilePickerView);\n",
180 106 "});"
181 107 ],
182 108 "language": "python",
@@ -189,7 +115,7 b''
189 115 " \n",
190 116 " // Define the FileModel and register it with the widget manager.\n",
191 117 " var FileModel = IPython.WidgetModel.extend({});\n",
192 " IPython.notebook.widget_manager.register_widget_model('FileWidgetModel', FileModel);\n",
118 " IPython.widget_manager.register_widget_model('FileWidgetModel', FileModel);\n",
193 119 " \n",
194 120 " // Define the FilePickerView\n",
195 121 " var FilePickerView = IPython.WidgetView.extend({\n",
@@ -202,7 +128,6 b''
202 128 " },\n",
203 129 " \n",
204 130 " // Handles: User input\n",
205 " events: { \"change\" : \"handleFileChange\" }, \n",
206 131 " handleFileChange: function(evt) { \n",
207 132 " \n",
208 133 " //Retrieve the first (and only!) File from the FileList object\n",
@@ -225,13 +150,13 b''
225 150 " });\n",
226 151 " \n",
227 152 " // Register the DatePickerView with the widget manager.\n",
228 " IPython.notebook.widget_manager.register_widget_view('FilePickerView', FilePickerView);\n",
153 " IPython.widget_manager.register_widget_view('FilePickerView', FilePickerView);\n",
229 154 "});"
230 155 ],
231 156 "metadata": {},
232 157 "output_type": "display_data",
233 158 "text": [
234 "<IPython.core.display.Javascript at 0x2fa80d0>"
159 "<IPython.core.display.Javascript at 0x319fe90>"
235 160 ]
236 161 }
237 162 ],
@@ -1,5 +1,11 b''
1 1 {
2 2 "metadata": {
3 "cell_tags": [
4 [
5 "<None>",
6 null
7 ]
8 ],
3 9 "name": ""
4 10 },
5 11 "nbformat": 3,
@@ -11,7 +17,7 b''
11 17 "cell_type": "markdown",
12 18 "metadata": {},
13 19 "source": [
14 "To enable the use IPython widgets in the notebook, the widget namespace and display function need to be imported. The Javascript dependencies need to be loaded via `IPython.html.widgets.init_widget_js()`. This method needs to be called each time the notebook webpage is refreshed."
20 "To use IPython widgets in the notebook, the widget namespace and display function need to be imported."
15 21 ]
16 22 },
17 23 {
@@ -19,85 +25,11 b''
19 25 "collapsed": false,
20 26 "input": [
21 27 "from IPython.html import widgets # Widget definitions\n",
22 "from IPython.display import display # Used to display widgets in the notebook\n",
23 "\n",
24 "# Enable widgets in this notebook\n",
25 "widgets.init_widget_js()"
28 "from IPython.display import display # Used to display widgets in the notebook"
26 29 ],
27 30 "language": "python",
28 31 "metadata": {},
29 "outputs": [
30 {
31 "javascript": [
32 "$.getScript(\"/static/notebook/js/widgets/bool.js\");"
33 ],
34 "metadata": {},
35 "output_type": "display_data"
36 },
37 {
38 "javascript": [
39 "$.getScript(\"/static/notebook/js/widgets/int_range.js\");"
40 ],
41 "metadata": {},
42 "output_type": "display_data"
43 },
44 {
45 "javascript": [
46 "$.getScript(\"/static/notebook/js/widgets/int.js\");"
47 ],
48 "metadata": {},
49 "output_type": "display_data"
50 },
51 {
52 "javascript": [
53 "$.getScript(\"/static/notebook/js/widgets/selection.js\");"
54 ],
55 "metadata": {},
56 "output_type": "display_data"
57 },
58 {
59 "javascript": [
60 "$.getScript(\"/static/notebook/js/widgets/string.js\");"
61 ],
62 "metadata": {},
63 "output_type": "display_data"
64 },
65 {
66 "javascript": [
67 "$.getScript(\"/static/notebook/js/widgets/float.js\");"
68 ],
69 "metadata": {},
70 "output_type": "display_data"
71 },
72 {
73 "javascript": [
74 "$.getScript(\"/static/notebook/js/widgets/container.js\");"
75 ],
76 "metadata": {},
77 "output_type": "display_data"
78 },
79 {
80 "javascript": [
81 "$.getScript(\"/static/notebook/js/widgets/multicontainer.js\");"
82 ],
83 "metadata": {},
84 "output_type": "display_data"
85 },
86 {
87 "javascript": [
88 "$.getScript(\"/static/notebook/js/widgets/button.js\");"
89 ],
90 "metadata": {},
91 "output_type": "display_data"
92 },
93 {
94 "javascript": [
95 "$.getScript(\"/static/notebook/js/widgets/float_range.js\");"
96 ],
97 "metadata": {},
98 "output_type": "display_data"
99 }
100 ],
32 "outputs": [],
101 33 "prompt_number": 1
102 34 },
103 35 {
@@ -1,5 +1,11 b''
1 1 {
2 2 "metadata": {
3 "cell_tags": [
4 [
5 "<None>",
6 null
7 ]
8 ],
3 9 "name": ""
4 10 },
5 11 "nbformat": 3,
@@ -12,85 +18,11 b''
12 18 "collapsed": false,
13 19 "input": [
14 20 "from IPython.html import widgets # Widget definitions\n",
15 "from IPython.display import display # Used to display widgets in the notebook\n",
16 "\n",
17 "# Enable widgets in this notebook\n",
18 "widgets.init_widget_js()"
21 "from IPython.display import display # Used to display widgets in the notebook"
19 22 ],
20 23 "language": "python",
21 24 "metadata": {},
22 "outputs": [
23 {
24 "javascript": [
25 "$.getScript(\"/static/notebook/js/widgets/bool.js\");"
26 ],
27 "metadata": {},
28 "output_type": "display_data"
29 },
30 {
31 "javascript": [
32 "$.getScript(\"/static/notebook/js/widgets/int_range.js\");"
33 ],
34 "metadata": {},
35 "output_type": "display_data"
36 },
37 {
38 "javascript": [
39 "$.getScript(\"/static/notebook/js/widgets/int.js\");"
40 ],
41 "metadata": {},
42 "output_type": "display_data"
43 },
44 {
45 "javascript": [
46 "$.getScript(\"/static/notebook/js/widgets/selection.js\");"
47 ],
48 "metadata": {},
49 "output_type": "display_data"
50 },
51 {
52 "javascript": [
53 "$.getScript(\"/static/notebook/js/widgets/string.js\");"
54 ],
55 "metadata": {},
56 "output_type": "display_data"
57 },
58 {
59 "javascript": [
60 "$.getScript(\"/static/notebook/js/widgets/float.js\");"
61 ],
62 "metadata": {},
63 "output_type": "display_data"
64 },
65 {
66 "javascript": [
67 "$.getScript(\"/static/notebook/js/widgets/container.js\");"
68 ],
69 "metadata": {},
70 "output_type": "display_data"
71 },
72 {
73 "javascript": [
74 "$.getScript(\"/static/notebook/js/widgets/multicontainer.js\");"
75 ],
76 "metadata": {},
77 "output_type": "display_data"
78 },
79 {
80 "javascript": [
81 "$.getScript(\"/static/notebook/js/widgets/button.js\");"
82 ],
83 "metadata": {},
84 "output_type": "display_data"
85 },
86 {
87 "javascript": [
88 "$.getScript(\"/static/notebook/js/widgets/float_range.js\");"
89 ],
90 "metadata": {},
91 "output_type": "display_data"
92 }
93 ],
25 "outputs": [],
94 26 "prompt_number": 1
95 27 },
96 28 {
@@ -1,5 +1,11 b''
1 1 {
2 2 "metadata": {
3 "cell_tags": [
4 [
5 "<None>",
6 null
7 ]
8 ],
3 9 "name": ""
4 10 },
5 11 "nbformat": 3,
@@ -12,85 +18,11 b''
12 18 "collapsed": false,
13 19 "input": [
14 20 "from IPython.html import widgets # Widget definitions\n",
15 "from IPython.display import display # Used to display widgets in the notebook\n",
16 "\n",
17 "# Enable widgets in this notebook\n",
18 "widgets.init_widget_js()"
21 "from IPython.display import display # Used to display widgets in the notebook"
19 22 ],
20 23 "language": "python",
21 24 "metadata": {},
22 "outputs": [
23 {
24 "javascript": [
25 "$.getScript(\"/static/notebook/js/widgets/bool.js\");"
26 ],
27 "metadata": {},
28 "output_type": "display_data"
29 },
30 {
31 "javascript": [
32 "$.getScript(\"/static/notebook/js/widgets/int_range.js\");"
33 ],
34 "metadata": {},
35 "output_type": "display_data"
36 },
37 {
38 "javascript": [
39 "$.getScript(\"/static/notebook/js/widgets/int.js\");"
40 ],
41 "metadata": {},
42 "output_type": "display_data"
43 },
44 {
45 "javascript": [
46 "$.getScript(\"/static/notebook/js/widgets/selection.js\");"
47 ],
48 "metadata": {},
49 "output_type": "display_data"
50 },
51 {
52 "javascript": [
53 "$.getScript(\"/static/notebook/js/widgets/string.js\");"
54 ],
55 "metadata": {},
56 "output_type": "display_data"
57 },
58 {
59 "javascript": [
60 "$.getScript(\"/static/notebook/js/widgets/float.js\");"
61 ],
62 "metadata": {},
63 "output_type": "display_data"
64 },
65 {
66 "javascript": [
67 "$.getScript(\"/static/notebook/js/widgets/container.js\");"
68 ],
69 "metadata": {},
70 "output_type": "display_data"
71 },
72 {
73 "javascript": [
74 "$.getScript(\"/static/notebook/js/widgets/multicontainer.js\");"
75 ],
76 "metadata": {},
77 "output_type": "display_data"
78 },
79 {
80 "javascript": [
81 "$.getScript(\"/static/notebook/js/widgets/button.js\");"
82 ],
83 "metadata": {},
84 "output_type": "display_data"
85 },
86 {
87 "javascript": [
88 "$.getScript(\"/static/notebook/js/widgets/float_range.js\");"
89 ],
90 "metadata": {},
91 "output_type": "display_data"
92 }
93 ],
25 "outputs": [],
94 26 "prompt_number": 1
95 27 },
96 28 {
@@ -1,5 +1,11 b''
1 1 {
2 2 "metadata": {
3 "cell_tags": [
4 [
5 "<None>",
6 null
7 ]
8 ],
3 9 "name": ""
4 10 },
5 11 "nbformat": 3,
@@ -12,85 +18,11 b''
12 18 "collapsed": false,
13 19 "input": [
14 20 "from IPython.html import widgets # Widget definitions\n",
15 "from IPython.display import display # Used to display widgets in the notebook\n",
16 "\n",
17 "# Enable widgets in this notebook\n",
18 "widgets.init_widget_js()"
21 "from IPython.display import display # Used to display widgets in the notebook"
19 22 ],
20 23 "language": "python",
21 24 "metadata": {},
22 "outputs": [
23 {
24 "javascript": [
25 "$.getScript(\"../static/notebook/js/widgets/bool.js\");"
26 ],
27 "metadata": {},
28 "output_type": "display_data"
29 },
30 {
31 "javascript": [
32 "$.getScript(\"../static/notebook/js/widgets/int_range.js\");"
33 ],
34 "metadata": {},
35 "output_type": "display_data"
36 },
37 {
38 "javascript": [
39 "$.getScript(\"../static/notebook/js/widgets/int.js\");"
40 ],
41 "metadata": {},
42 "output_type": "display_data"
43 },
44 {
45 "javascript": [
46 "$.getScript(\"../static/notebook/js/widgets/selection.js\");"
47 ],
48 "metadata": {},
49 "output_type": "display_data"
50 },
51 {
52 "javascript": [
53 "$.getScript(\"../static/notebook/js/widgets/string.js\");"
54 ],
55 "metadata": {},
56 "output_type": "display_data"
57 },
58 {
59 "javascript": [
60 "$.getScript(\"../static/notebook/js/widgets/float.js\");"
61 ],
62 "metadata": {},
63 "output_type": "display_data"
64 },
65 {
66 "javascript": [
67 "$.getScript(\"../static/notebook/js/widgets/container.js\");"
68 ],
69 "metadata": {},
70 "output_type": "display_data"
71 },
72 {
73 "javascript": [
74 "$.getScript(\"../static/notebook/js/widgets/multicontainer.js\");"
75 ],
76 "metadata": {},
77 "output_type": "display_data"
78 },
79 {
80 "javascript": [
81 "$.getScript(\"../static/notebook/js/widgets/button.js\");"
82 ],
83 "metadata": {},
84 "output_type": "display_data"
85 },
86 {
87 "javascript": [
88 "$.getScript(\"../static/notebook/js/widgets/float_range.js\");"
89 ],
90 "metadata": {},
91 "output_type": "display_data"
92 }
93 ],
25 "outputs": [],
94 26 "prompt_number": 1
95 27 },
96 28 {
@@ -18,85 +18,11 b''
18 18 "collapsed": false,
19 19 "input": [
20 20 "from IPython.html import widgets # Widget definitions\n",
21 "from IPython.display import display # Used to display widgets in the notebook\n",
22 "\n",
23 "# Enable widgets in this notebook\n",
24 "widgets.init_widget_js()"
21 "from IPython.display import display # Used to display widgets in the notebook"
25 22 ],
26 23 "language": "python",
27 24 "metadata": {},
28 "outputs": [
29 {
30 "javascript": [
31 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/button.js\");"
32 ],
33 "metadata": {},
34 "output_type": "display_data"
35 },
36 {
37 "javascript": [
38 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/int_range.js\");"
39 ],
40 "metadata": {},
41 "output_type": "display_data"
42 },
43 {
44 "javascript": [
45 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/string.js\");"
46 ],
47 "metadata": {},
48 "output_type": "display_data"
49 },
50 {
51 "javascript": [
52 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/multicontainer.js\");"
53 ],
54 "metadata": {},
55 "output_type": "display_data"
56 },
57 {
58 "javascript": [
59 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/bool.js\");"
60 ],
61 "metadata": {},
62 "output_type": "display_data"
63 },
64 {
65 "javascript": [
66 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/int.js\");"
67 ],
68 "metadata": {},
69 "output_type": "display_data"
70 },
71 {
72 "javascript": [
73 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/selection.js\");"
74 ],
75 "metadata": {},
76 "output_type": "display_data"
77 },
78 {
79 "javascript": [
80 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/float.js\");"
81 ],
82 "metadata": {},
83 "output_type": "display_data"
84 },
85 {
86 "javascript": [
87 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/float_range.js\");"
88 ],
89 "metadata": {},
90 "output_type": "display_data"
91 },
92 {
93 "javascript": [
94 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/container.js\");"
95 ],
96 "metadata": {},
97 "output_type": "display_data"
98 }
99 ],
25 "outputs": [],
100 26 "prompt_number": 1
101 27 },
102 28 {
@@ -30,85 +30,11 b''
30 30 "collapsed": false,
31 31 "input": [
32 32 "from IPython.html import widgets # Widget definitions\n",
33 "from IPython.display import display # Used to display widgets in the notebook\n",
34 "\n",
35 "# Enable widgets in this notebook\n",
36 "widgets.init_widget_js()"
33 "from IPython.display import display # Used to display widgets in the notebook"
37 34 ],
38 35 "language": "python",
39 36 "metadata": {},
40 "outputs": [
41 {
42 "javascript": [
43 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/button.js\");"
44 ],
45 "metadata": {},
46 "output_type": "display_data"
47 },
48 {
49 "javascript": [
50 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/int_range.js\");"
51 ],
52 "metadata": {},
53 "output_type": "display_data"
54 },
55 {
56 "javascript": [
57 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/string.js\");"
58 ],
59 "metadata": {},
60 "output_type": "display_data"
61 },
62 {
63 "javascript": [
64 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/multicontainer.js\");"
65 ],
66 "metadata": {},
67 "output_type": "display_data"
68 },
69 {
70 "javascript": [
71 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/bool.js\");"
72 ],
73 "metadata": {},
74 "output_type": "display_data"
75 },
76 {
77 "javascript": [
78 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/int.js\");"
79 ],
80 "metadata": {},
81 "output_type": "display_data"
82 },
83 {
84 "javascript": [
85 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/selection.js\");"
86 ],
87 "metadata": {},
88 "output_type": "display_data"
89 },
90 {
91 "javascript": [
92 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/float.js\");"
93 ],
94 "metadata": {},
95 "output_type": "display_data"
96 },
97 {
98 "javascript": [
99 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/float_range.js\");"
100 ],
101 "metadata": {},
102 "output_type": "display_data"
103 },
104 {
105 "javascript": [
106 "$.getScript($(\"body\").data(\"baseProjectUrl\") + \"static/notebook/js/widgets/container.js\");"
107 ],
108 "metadata": {},
109 "output_type": "display_data"
110 }
111 ],
37 "outputs": [],
112 38 "prompt_number": 1
113 39 },
114 40 {
@@ -213,7 +139,7 b''
213 139 "metadata": {},
214 140 "output_type": "display_data",
215 141 "text": [
216 "<IPython.core.display.Javascript at 0x168b0d0>"
142 "<IPython.core.display.Javascript at 0x21f8f10>"
217 143 ]
218 144 }
219 145 ],
@@ -236,7 +162,7 b''
236 162 " \n",
237 163 " // Define the DateModel and register it with the widget manager.\n",
238 164 " var DateModel = IPython.WidgetModel.extend({});\n",
239 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
165 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
240 166 "});"
241 167 ],
242 168 "language": "python",
@@ -249,13 +175,13 b''
249 175 " \n",
250 176 " // Define the DateModel and register it with the widget manager.\n",
251 177 " var DateModel = IPython.WidgetModel.extend({});\n",
252 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
178 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
253 179 "});"
254 180 ],
255 181 "metadata": {},
256 182 "output_type": "display_data",
257 183 "text": [
258 "<IPython.core.display.Javascript at 0x168df50>"
184 "<IPython.core.display.Javascript at 0x21f8ed0>"
259 185 ]
260 186 }
261 187 ],
@@ -280,7 +206,7 b''
280 206 " \n",
281 207 " // Define the DateModel and register it with the widget manager.\n",
282 208 " var DateModel = IPython.WidgetModel.extend({});\n",
283 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
209 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
284 210 " \n",
285 211 " // Define the DatePickerView\n",
286 212 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -292,7 +218,7 b''
292 218 " });\n",
293 219 " \n",
294 220 " // Register the DatePickerView with the widget manager.\n",
295 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
221 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
296 222 "});"
297 223 ],
298 224 "language": "python",
@@ -305,7 +231,7 b''
305 231 " \n",
306 232 " // Define the DateModel and register it with the widget manager.\n",
307 233 " var DateModel = IPython.WidgetModel.extend({});\n",
308 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
234 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
309 235 " \n",
310 236 " // Define the DatePickerView\n",
311 237 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -317,13 +243,13 b''
317 243 " });\n",
318 244 " \n",
319 245 " // Register the DatePickerView with the widget manager.\n",
320 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
246 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
321 247 "});"
322 248 ],
323 249 "metadata": {},
324 250 "output_type": "display_data",
325 251 "text": [
326 "<IPython.core.display.Javascript at 0x168f050>"
252 "<IPython.core.display.Javascript at 0x21f8cd0>"
327 253 ]
328 254 }
329 255 ],
@@ -426,7 +352,7 b''
426 352 " \n",
427 353 " // Define the DateModel and register it with the widget manager.\n",
428 354 " var DateModel = IPython.WidgetModel.extend({});\n",
429 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
355 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
430 356 " \n",
431 357 " // Define the DatePickerView\n",
432 358 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -443,7 +369,7 b''
443 369 " });\n",
444 370 " \n",
445 371 " // Register the DatePickerView with the widget manager.\n",
446 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
372 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
447 373 "});"
448 374 ],
449 375 "language": "python",
@@ -456,7 +382,7 b''
456 382 " \n",
457 383 " // Define the DateModel and register it with the widget manager.\n",
458 384 " var DateModel = IPython.WidgetModel.extend({});\n",
459 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
385 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
460 386 " \n",
461 387 " // Define the DatePickerView\n",
462 388 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -473,13 +399,13 b''
473 399 " });\n",
474 400 " \n",
475 401 " // Register the DatePickerView with the widget manager.\n",
476 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
402 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
477 403 "});"
478 404 ],
479 405 "metadata": {},
480 406 "output_type": "display_data",
481 407 "text": [
482 "<IPython.core.display.Javascript at 0x17822d0>"
408 "<IPython.core.display.Javascript at 0x21fc310>"
483 409 ]
484 410 }
485 411 ],
@@ -502,7 +428,7 b''
502 428 " \n",
503 429 " // Define the DateModel and register it with the widget manager.\n",
504 430 " var DateModel = IPython.WidgetModel.extend({});\n",
505 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
431 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
506 432 " \n",
507 433 " // Define the DatePickerView\n",
508 434 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -526,7 +452,7 b''
526 452 " });\n",
527 453 " \n",
528 454 " // Register the DatePickerView with the widget manager.\n",
529 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
455 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
530 456 "});"
531 457 ],
532 458 "language": "python",
@@ -539,7 +465,7 b''
539 465 " \n",
540 466 " // Define the DateModel and register it with the widget manager.\n",
541 467 " var DateModel = IPython.WidgetModel.extend({});\n",
542 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
468 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
543 469 " \n",
544 470 " // Define the DatePickerView\n",
545 471 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -563,13 +489,13 b''
563 489 " });\n",
564 490 " \n",
565 491 " // Register the DatePickerView with the widget manager.\n",
566 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
492 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
567 493 "});"
568 494 ],
569 495 "metadata": {},
570 496 "output_type": "display_data",
571 497 "text": [
572 "<IPython.core.display.Javascript at 0x1782390>"
498 "<IPython.core.display.Javascript at 0x21fc290>"
573 499 ]
574 500 }
575 501 ],
@@ -596,7 +522,7 b''
596 522 " \n",
597 523 " // Define the DateModel and register it with the widget manager.\n",
598 524 " var DateModel = IPython.WidgetModel.extend({});\n",
599 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
525 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
600 526 " \n",
601 527 " // Define the DatePickerView\n",
602 528 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -632,7 +558,7 b''
632 558 " });\n",
633 559 " \n",
634 560 " // Register the DatePickerView with the widget manager.\n",
635 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
561 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
636 562 "});"
637 563 ],
638 564 "language": "python",
@@ -645,7 +571,7 b''
645 571 " \n",
646 572 " // Define the DateModel and register it with the widget manager.\n",
647 573 " var DateModel = IPython.WidgetModel.extend({});\n",
648 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
574 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
649 575 " \n",
650 576 " // Define the DatePickerView\n",
651 577 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -681,13 +607,13 b''
681 607 " });\n",
682 608 " \n",
683 609 " // Register the DatePickerView with the widget manager.\n",
684 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
610 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
685 611 "});"
686 612 ],
687 613 "metadata": {},
688 614 "output_type": "display_data",
689 615 "text": [
690 "<IPython.core.display.Javascript at 0x17821d0>"
616 "<IPython.core.display.Javascript at 0x21fc3d0>"
691 617 ]
692 618 }
693 619 ],
@@ -759,7 +685,7 b''
759 685 "output_type": "pyout",
760 686 "prompt_number": 13,
761 687 "text": [
762 "u''"
688 "u'2013-11-14'"
763 689 ]
764 690 }
765 691 ],
@@ -1041,7 +967,7 b''
1041 967 " \n",
1042 968 " // Define the DateModel and register it with the widget manager.\n",
1043 969 " var DateModel = IPython.WidgetModel.extend({});\n",
1044 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
970 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
1045 971 " \n",
1046 972 " // Define the DatePickerView\n",
1047 973 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -1095,7 +1021,7 b''
1095 1021 " });\n",
1096 1022 " \n",
1097 1023 " // Register the DatePickerView with the widget manager.\n",
1098 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
1024 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
1099 1025 "});"
1100 1026 ],
1101 1027 "language": "python",
@@ -1108,7 +1034,7 b''
1108 1034 " \n",
1109 1035 " // Define the DateModel and register it with the widget manager.\n",
1110 1036 " var DateModel = IPython.WidgetModel.extend({});\n",
1111 " IPython.notebook.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
1037 " IPython.widget_manager.register_widget_model('DateWidgetModel', DateModel);\n",
1112 1038 " \n",
1113 1039 " // Define the DatePickerView\n",
1114 1040 " var DatePickerView = IPython.WidgetView.extend({\n",
@@ -1162,13 +1088,13 b''
1162 1088 " });\n",
1163 1089 " \n",
1164 1090 " // Register the DatePickerView with the widget manager.\n",
1165 " IPython.notebook.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
1091 " IPython.widget_manager.register_widget_view('DatePickerView', DatePickerView);\n",
1166 1092 "});"
1167 1093 ],
1168 1094 "metadata": {},
1169 1095 "output_type": "display_data",
1170 1096 "text": [
1171 "<IPython.core.display.Javascript at 0x179f790>"
1097 "<IPython.core.display.Javascript at 0x221a850>"
1172 1098 ]
1173 1099 }
1174 1100 ],
@@ -1216,7 +1142,6 b''
1216 1142 "cell_type": "code",
1217 1143 "collapsed": false,
1218 1144 "input": [
1219 "\n",
1220 1145 "display(my_widget, view_name=\"TextBoxView\")"
1221 1146 ],
1222 1147 "language": "python",
General Comments 0
You need to be logged in to leave comments. Login now