mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Merge pull request #7756 from Carreau/common_conf
pass common config to contents manager
This commit is contained in:
commit
faf648d259
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user