##// END OF EJS Templates
Refactor out load_extensions_from_config function
Thomas Kluyver -
Show More
@@ -39,6 +39,20 define([
39 39 );
40 40 };
41 41
42 /**
43 * Wait for a config section to load, and then load the extensions specified
44 * in a 'load_extensions' key inside it.
45 */
46 function load_extensions_from_config(section) {
47 section.loaded.then(function() {
48 if (section.data.load_extensions) {
49 var nbextension_paths = Object.getOwnPropertyNames(
50 section.data.load_extensions);
51 IPython.load_extensions.apply(this, nbextension_paths);
52 }
53 });
54 }
55
42 56 //============================================================================
43 57 // Cross-browser RegEx Split
44 58 //============================================================================
@@ -822,6 +836,7 define([
822 836 };
823 837
824 838 var utils = {
839 load_extensions_from_config: load_extensions_from_config,
825 840 regex_split : regex_split,
826 841 uuid : uuid,
827 842 fixConsole : fixConsole,
@@ -150,13 +150,7 require([
150 150 IPython.tooltip = notebook.tooltip;
151 151
152 152 events.trigger('app_initialized.NotebookApp');
153 config_section.loaded.then(function() {
154 if (config_section.data.load_extensions) {
155 var nbextension_paths = Object.getOwnPropertyNames(
156 config_section.data.load_extensions);
157 IPython.load_extensions.apply(this, nbextension_paths);
158 }
159 });
153 utils.load_extensions_from_config(config_section);
160 154 notebook.load_notebook(common_options.notebook_path);
161 155
162 156 });
General Comments 0
You need to be logged in to leave comments. Login now