From 18f23afa4b3a957fd6612f742410ef65843233dc 2015-02-13 00:32:03
From: Thomas Kluyver <takowl@gmail.com>
Date: 2015-02-13 00:32:03
Subject: [PATCH] Merge pull request #7756 from Carreau/common_conf

pass common config to contents manager
---

diff --git a/IPython/html/static/edit/js/main.js b/IPython/html/static/edit/js/main.js
index 351a093..49d883b 100644
--- a/IPython/html/static/edit/js/main.js
+++ b/IPython/html/static/edit/js/main.js
@@ -27,15 +27,19 @@ require([
     savewidget,
     notificationarea
     ){
+    "use strict";
     page = new page.Page();
 
     var base_url = utils.get_body_data('baseUrl');
     var file_path = utils.get_body_data('filePath');
-    contents = new contents.Contents({base_url: base_url});
     var config = new configmod.ConfigSection('edit', {base_url: base_url});
     config.load();
     var common_config = new configmod.ConfigSection('common', {base_url: base_url});
     common_config.load();
+    contents = new contents.Contents({
+        base_url: base_url,
+        common_config: common_config
+    });
     
     var editor = new editmod.Editor('#texteditor-container', {
         base_url: base_url,
diff --git a/IPython/html/static/notebook/js/main.js b/IPython/html/static/notebook/js/main.js
index b854b4b..31df711 100644
--- a/IPython/html/static/notebook/js/main.js
+++ b/IPython/html/static/notebook/js/main.js
@@ -75,9 +75,10 @@ require([
     var save_widget = new savewidget.SaveWidget('span#save_widget', {
         events: events, 
         keyboard_manager: keyboard_manager});
-    var contents = new contents.Contents($.extend({
-        events: events, config:config_section},
-        common_options));
+    var contents = new contents.Contents({
+          base_url: common_options.base_url,
+          common_config: common_config
+        });
     var notebook = new notebook.Notebook('div#notebook', $.extend({
         events: events,
         keyboard_manager: keyboard_manager,
diff --git a/IPython/html/static/tree/js/main.js b/IPython/html/static/tree/js/main.js
index 2bdb089..9a93bcf 100644
--- a/IPython/html/static/tree/js/main.js
+++ b/IPython/html/static/tree/js/main.js
@@ -50,13 +50,14 @@ require([
     common_options.config = cfg;
     var common_config = new config.ConfigSection('common', common_options);
     common_config.load();
-    
+
     var session_list = new sesssionlist.SesssionList($.extend({
-        events: events}, 
-        common_options));
-    var contents = new contents_service.Contents($.extend({
         events: events},
         common_options));
+    var contents = new contents_service.Contents({
+        base_url: common_options.base_url,
+        common_config: common_config
+    });
     var notebook_list = new notebooklist.NotebookList('#notebook_list', $.extend({
         contents: contents,
         session_list:  session_list}, 
@@ -98,16 +99,16 @@ require([
         if (terminal_list) {
             terminal_list.load_terminals();
         }
-    }
+    };
 
     var enable_autorefresh = function(){
         /**
          *refresh immediately , then start interval
          */
-        var now = new Date()
+        var now = new Date();
 
         if (now - _last_refresh < IPython.min_delta_refresh*1000){
-            console.log("Reenabling autorefresh too close to last tree refresh, not refreshing immediately again.")
+            console.log("Reenabling autorefresh too close to last tree refresh, not refreshing immediately again.");
         } else {
             _refresh_list();
         }