Show More
@@ -27,15 +27,19 b' require([' | |||||
27 | savewidget, |
|
27 | savewidget, | |
28 | notificationarea |
|
28 | notificationarea | |
29 | ){ |
|
29 | ){ | |
|
30 | "use strict"; | |||
30 | page = new page.Page(); |
|
31 | page = new page.Page(); | |
31 |
|
32 | |||
32 | var base_url = utils.get_body_data('baseUrl'); |
|
33 | var base_url = utils.get_body_data('baseUrl'); | |
33 | var file_path = utils.get_body_data('filePath'); |
|
34 | var file_path = utils.get_body_data('filePath'); | |
34 | contents = new contents.Contents({base_url: base_url}); |
|
|||
35 | var config = new configmod.ConfigSection('edit', {base_url: base_url}); |
|
35 | var config = new configmod.ConfigSection('edit', {base_url: base_url}); | |
36 | config.load(); |
|
36 | config.load(); | |
37 | var common_config = new configmod.ConfigSection('common', {base_url: base_url}); |
|
37 | var common_config = new configmod.ConfigSection('common', {base_url: base_url}); | |
38 | common_config.load(); |
|
38 | common_config.load(); | |
|
39 | contents = new contents.Contents({ | |||
|
40 | base_url: base_url, | |||
|
41 | common_config: common_config | |||
|
42 | }); | |||
39 |
|
43 | |||
40 | var editor = new editmod.Editor('#texteditor-container', { |
|
44 | var editor = new editmod.Editor('#texteditor-container', { | |
41 | base_url: base_url, |
|
45 | base_url: base_url, |
@@ -75,9 +75,10 b' require([' | |||||
75 | var save_widget = new savewidget.SaveWidget('span#save_widget', { |
|
75 | var save_widget = new savewidget.SaveWidget('span#save_widget', { | |
76 | events: events, |
|
76 | events: events, | |
77 | keyboard_manager: keyboard_manager}); |
|
77 | keyboard_manager: keyboard_manager}); | |
78 |
var contents = new contents.Contents( |
|
78 | var contents = new contents.Contents({ | |
79 | events: events, config:config_section}, |
|
79 | base_url: common_options.base_url, | |
80 | common_options)); |
|
80 | common_config: common_config | |
|
81 | }); | |||
81 | var notebook = new notebook.Notebook('div#notebook', $.extend({ |
|
82 | var notebook = new notebook.Notebook('div#notebook', $.extend({ | |
82 | events: events, |
|
83 | events: events, | |
83 | keyboard_manager: keyboard_manager, |
|
84 | keyboard_manager: keyboard_manager, |
@@ -50,13 +50,14 b' require([' | |||||
50 | common_options.config = cfg; |
|
50 | common_options.config = cfg; | |
51 | var common_config = new config.ConfigSection('common', common_options); |
|
51 | var common_config = new config.ConfigSection('common', common_options); | |
52 | common_config.load(); |
|
52 | common_config.load(); | |
53 |
|
53 | |||
54 | var session_list = new sesssionlist.SesssionList($.extend({ |
|
54 | var session_list = new sesssionlist.SesssionList($.extend({ | |
55 | events: events}, |
|
|||
56 | common_options)); |
|
|||
57 | var contents = new contents_service.Contents($.extend({ |
|
|||
58 | events: events}, |
|
55 | events: events}, | |
59 | common_options)); |
|
56 | common_options)); | |
|
57 | var contents = new contents_service.Contents({ | |||
|
58 | base_url: common_options.base_url, | |||
|
59 | common_config: common_config | |||
|
60 | }); | |||
60 | var notebook_list = new notebooklist.NotebookList('#notebook_list', $.extend({ |
|
61 | var notebook_list = new notebooklist.NotebookList('#notebook_list', $.extend({ | |
61 | contents: contents, |
|
62 | contents: contents, | |
62 | session_list: session_list}, |
|
63 | session_list: session_list}, | |
@@ -98,16 +99,16 b' require([' | |||||
98 | if (terminal_list) { |
|
99 | if (terminal_list) { | |
99 | terminal_list.load_terminals(); |
|
100 | terminal_list.load_terminals(); | |
100 | } |
|
101 | } | |
101 | } |
|
102 | }; | |
102 |
|
103 | |||
103 | var enable_autorefresh = function(){ |
|
104 | var enable_autorefresh = function(){ | |
104 | /** |
|
105 | /** | |
105 | *refresh immediately , then start interval |
|
106 | *refresh immediately , then start interval | |
106 | */ |
|
107 | */ | |
107 | var now = new Date() |
|
108 | var now = new Date(); | |
108 |
|
109 | |||
109 | if (now - _last_refresh < IPython.min_delta_refresh*1000){ |
|
110 | if (now - _last_refresh < IPython.min_delta_refresh*1000){ | |
110 | console.log("Reenabling autorefresh too close to last tree refresh, not refreshing immediately again.") |
|
111 | console.log("Reenabling autorefresh too close to last tree refresh, not refreshing immediately again."); | |
111 | } else { |
|
112 | } else { | |
112 | _refresh_list(); |
|
113 | _refresh_list(); | |
113 | } |
|
114 | } |
General Comments 0
You need to be logged in to leave comments.
Login now