init.js
34 lines
| 1.1 KiB
| application/javascript
|
JavascriptLexer
Jonathan Frederic
|
r17198 | // Copyright (c) IPython Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||||
Jonathan Frederic
|
r14470 | |||
Jonathan Frederic
|
r14546 | define([ | ||
Jonathan Frederic
|
r17198 | "widgets/js/manager", | ||
Jason Grout
|
r18056 | "widgets/js/widget_link", | ||
Jonathan Frederic
|
r15427 | "widgets/js/widget_bool", | ||
"widgets/js/widget_button", | ||||
Jonathan Frederic
|
r17639 | "widgets/js/widget_box", | ||
Jonathan Frederic
|
r15427 | "widgets/js/widget_float", | ||
"widgets/js/widget_image", | ||||
"widgets/js/widget_int", | ||||
Jonathan Frederic
|
r18953 | "widgets/js/widget_output", | ||
Jonathan Frederic
|
r15427 | "widgets/js/widget_selection", | ||
"widgets/js/widget_selectioncontainer", | ||||
"widgets/js/widget_string", | ||||
Jason Grout
|
r18056 | ], function(widgetmanager, linkModels) { | ||
for (var target_name in linkModels) { | ||||
if (linkModels.hasOwnProperty(target_name)) { | ||||
widgetmanager.WidgetManager.register_widget_model(target_name, linkModels[target_name]); | ||||
} | ||||
} | ||||
Jonathan Frederic
|
r17198 | |||
// Register all of the loaded views with the widget manager. | ||||
Jason Grout
|
r18056 | for (var i = 2; i < arguments.length; i++) { | ||
Jonathan Frederic
|
r17198 | for (var target_name in arguments[i]) { | ||
if (arguments[i].hasOwnProperty(target_name)) { | ||||
Jonathan Frederic
|
r17203 | widgetmanager.WidgetManager.register_widget_view(target_name, arguments[i][target_name]); | ||
Jonathan Frederic
|
r17198 | } | ||
} | ||||
} | ||||
Jonathan Frederic
|
r17203 | return {'WidgetManager': widgetmanager.WidgetManager}; | ||
Jonathan Frederic
|
r17198 | }); | ||