diff --git a/notebook/nbextensions.py b/notebook/nbextensions.py index 45f35599f..922fedacb 100644 --- a/notebook/nbextensions.py +++ b/notebook/nbextensions.py @@ -223,10 +223,16 @@ def enable_nbextension_python(package, user=False, sys_prefix=False, log=None): for nbext in nbexts: require = nbext['require'] section = nbext['section'] - if section == 'notebook': + if section == 'common': + diff = {'NotebookApp': {'nbextensions_common': {require: True}}} + elif section == 'notebook': diff = {'NotebookApp': {'nbextensions_notebook': {require: True}}} elif section == 'tree': diff = {'NotebookApp': {'nbextensions_tree': {require: True}}} + elif section == 'edit': + diff = {'NotebookApp': {'nbextensions_edit': {require: True}}} + elif section == 'terminal': + diff = {'NotebookApp': {'nbextensions_terminal': {require: True}}} _recursive_update(data, diff) _write_config_data(data, user=user, sys_prefix=sys_prefix) @@ -238,10 +244,16 @@ def disable_nbextension_python(package, user=False, sys_prefix=False): for nbext in nbexts: require = nbext['require'] section = nbext['section'] - if section == 'notebook': + if section == 'common': + diff = {'NotebookApp': {'nbextensions_common': {require: False}}} + elif section == 'notebook': diff = {'NotebookApp': {'nbextensions_notebook': {require: False}}} elif section == 'tree': diff = {'NotebookApp': {'nbextensions_tree': {require: False}}} + elif section == 'edit': + diff = {'NotebookApp': {'nbextensions_edit': {require: False}}} + elif section == 'terminal': + diff = {'NotebookApp': {'nbextensions_terminal': {require: False}}} _recursive_update(data, diff) _write_config_data(data, user=user, sys_prefix=sys_prefix) @@ -498,7 +510,7 @@ class ListNBExtensionsApp(BaseNBExtensionApp): for config_dir in config_dirs: self.log.info('config dir: {}'.format(config_dir)) cm = BaseJSONConfigManager(parent=self, config_dir=config_dir) - for section in ['notebook', 'tree']: + for section in ['common', 'notebook', 'tree', 'edit', 'terminal']: data = cm.get(section) if 'load_extensions' in data: self.log.info(' {} section'.format(section)) diff --git a/notebook/static/terminal/js/main.js b/notebook/static/terminal/js/main.js index 6e7a22eb0..7bac667e4 100644 --- a/notebook/static/terminal/js/main.js +++ b/notebook/static/terminal/js/main.js @@ -18,6 +18,9 @@ require([ requirejs(['custom/custom'], function() {}); page = new page.Page(); + var config = new configmod.ConfigSection('terminal', + {base_url: utils.get_body_data('baseUrl')}); + config.load(); var common_config = new configmod.ConfigSection('common', {base_url: utils.get_body_data('baseUrl')}); common_config.load(); @@ -49,6 +52,7 @@ require([ page.show_site(); + utils.load_extensions_from_config(config); utils.load_extensions_from_config(common_config); window.onresize = function() {