##// END OF EJS Templates
Fix equals sign and clarify where the number of restart attempts comes from
Jessica B. Hamrick -
Show More
@@ -1,384 +1,389
1 // Copyright (c) IPython Development Team.
1 // Copyright (c) IPython Development Team.
2 // Distributed under the terms of the Modified BSD License.
2 // Distributed under the terms of the Modified BSD License.
3
3
4 define([
4 define([
5 'base/js/namespace',
5 'base/js/namespace',
6 'jquery',
6 'jquery',
7 'base/js/utils',
7 'base/js/utils',
8 'base/js/dialog',
8 'base/js/dialog',
9 'notebook/js/notificationwidget',
9 'notebook/js/notificationwidget',
10 'moment'
10 'moment'
11 ], function(IPython, $, utils, dialog, notificationwidget, moment) {
11 ], function(IPython, $, utils, dialog, notificationwidget, moment) {
12 "use strict";
12 "use strict";
13
13
14 // store reference to the NotificationWidget class
14 // store reference to the NotificationWidget class
15 var NotificationWidget = notificationwidget.NotificationWidget;
15 var NotificationWidget = notificationwidget.NotificationWidget;
16
16
17 /**
17 /**
18 * Construct the NotificationArea object. Options are:
18 * Construct the NotificationArea object. Options are:
19 * events: $(Events) instance
19 * events: $(Events) instance
20 * save_widget: SaveWidget instance
20 * save_widget: SaveWidget instance
21 * notebook: Notebook instance
21 * notebook: Notebook instance
22 * keyboard_manager: KeyboardManager instance
22 * keyboard_manager: KeyboardManager instance
23 *
23 *
24 * @constructor
24 * @constructor
25 * @param {string} selector - a jQuery selector string for the
25 * @param {string} selector - a jQuery selector string for the
26 * notification area element
26 * notification area element
27 * @param {Object} [options] - a dictionary of keyword arguments.
27 * @param {Object} [options] - a dictionary of keyword arguments.
28 */
28 */
29 var NotificationArea = function (selector, options) {
29 var NotificationArea = function (selector, options) {
30 this.selector = selector;
30 this.selector = selector;
31 this.events = options.events;
31 this.events = options.events;
32 this.save_widget = options.save_widget;
32 this.save_widget = options.save_widget;
33 this.notebook = options.notebook;
33 this.notebook = options.notebook;
34 this.keyboard_manager = options.keyboard_manager;
34 this.keyboard_manager = options.keyboard_manager;
35 if (this.selector !== undefined) {
35 if (this.selector !== undefined) {
36 this.element = $(selector);
36 this.element = $(selector);
37 }
37 }
38 this.widget_dict = {};
38 this.widget_dict = {};
39 };
39 };
40
40
41 /**
41 /**
42 * Get a widget by name, creating it if it doesn't exist.
42 * Get a widget by name, creating it if it doesn't exist.
43 *
43 *
44 * @method widget
44 * @method widget
45 * @param {string} name - the widget name
45 * @param {string} name - the widget name
46 */
46 */
47 NotificationArea.prototype.widget = function (name) {
47 NotificationArea.prototype.widget = function (name) {
48 if (this.widget_dict[name] === undefined) {
48 if (this.widget_dict[name] === undefined) {
49 return this.new_notification_widget(name);
49 return this.new_notification_widget(name);
50 }
50 }
51 return this.get_widget(name);
51 return this.get_widget(name);
52 };
52 };
53
53
54 /**
54 /**
55 * Get a widget by name, throwing an error if it doesn't exist.
55 * Get a widget by name, throwing an error if it doesn't exist.
56 *
56 *
57 * @method get_widget
57 * @method get_widget
58 * @param {string} name - the widget name
58 * @param {string} name - the widget name
59 */
59 */
60 NotificationArea.prototype.get_widget = function (name) {
60 NotificationArea.prototype.get_widget = function (name) {
61 if(this.widget_dict[name] === undefined) {
61 if(this.widget_dict[name] === undefined) {
62 throw('no widgets with this name');
62 throw('no widgets with this name');
63 }
63 }
64 return this.widget_dict[name];
64 return this.widget_dict[name];
65 };
65 };
66
66
67 /**
67 /**
68 * Create a new notification widget with the given name. The
68 * Create a new notification widget with the given name. The
69 * widget must not already exist.
69 * widget must not already exist.
70 *
70 *
71 * @method new_notification_widget
71 * @method new_notification_widget
72 * @param {string} name - the widget name
72 * @param {string} name - the widget name
73 */
73 */
74 NotificationArea.prototype.new_notification_widget = function (name) {
74 NotificationArea.prototype.new_notification_widget = function (name) {
75 if (this.widget_dict[name] !== undefined) {
75 if (this.widget_dict[name] !== undefined) {
76 throw('widget with that name already exists!');
76 throw('widget with that name already exists!');
77 }
77 }
78
78
79 // create the element for the notification widget and add it
79 // create the element for the notification widget and add it
80 // to the notification aread element
80 // to the notification aread element
81 var div = $('<div/>').attr('id', 'notification_' + name);
81 var div = $('<div/>').attr('id', 'notification_' + name);
82 $(this.selector).append(div);
82 $(this.selector).append(div);
83
83
84 // create the widget object and return it
84 // create the widget object and return it
85 this.widget_dict[name] = new NotificationWidget('#notification_' + name);
85 this.widget_dict[name] = new NotificationWidget('#notification_' + name);
86 return this.widget_dict[name];
86 return this.widget_dict[name];
87 };
87 };
88
88
89 /**
89 /**
90 * Initialize the default set of notification widgets.
90 * Initialize the default set of notification widgets.
91 *
91 *
92 * @method init_notification_widgets
92 * @method init_notification_widgets
93 */
93 */
94 NotificationArea.prototype.init_notification_widgets = function () {
94 NotificationArea.prototype.init_notification_widgets = function () {
95 this.init_kernel_notification_widget();
95 this.init_kernel_notification_widget();
96 this.init_notebook_notification_widget();
96 this.init_notebook_notification_widget();
97 };
97 };
98
98
99 /**
99 /**
100 * Initialize the notification widget for kernel status messages.
100 * Initialize the notification widget for kernel status messages.
101 *
101 *
102 * @method init_kernel_notification_widget
102 * @method init_kernel_notification_widget
103 */
103 */
104 NotificationArea.prototype.init_kernel_notification_widget = function () {
104 NotificationArea.prototype.init_kernel_notification_widget = function () {
105 var that = this;
105 var that = this;
106 var knw = this.new_notification_widget('kernel');
106 var knw = this.new_notification_widget('kernel');
107 var $kernel_ind_icon = $("#kernel_indicator_icon");
107 var $kernel_ind_icon = $("#kernel_indicator_icon");
108 var $modal_ind_icon = $("#modal_indicator_icon");
108 var $modal_ind_icon = $("#modal_indicator_icon");
109
109
110 // Command/Edit mode
110 // Command/Edit mode
111 this.events.on('edit_mode.Notebook', function () {
111 this.events.on('edit_mode.Notebook', function () {
112 that.save_widget.update_document_title();
112 that.save_widget.update_document_title();
113 $modal_ind_icon.attr('class','edit_mode_icon').attr('title','Edit Mode');
113 $modal_ind_icon.attr('class','edit_mode_icon').attr('title','Edit Mode');
114 });
114 });
115
115
116 this.events.on('command_mode.Notebook', function () {
116 this.events.on('command_mode.Notebook', function () {
117 that.save_widget.update_document_title();
117 that.save_widget.update_document_title();
118 $modal_ind_icon.attr('class','command_mode_icon').attr('title','Command Mode');
118 $modal_ind_icon.attr('class','command_mode_icon').attr('title','Command Mode');
119 });
119 });
120
120
121 // Implicitly start off in Command mode, switching to Edit mode will trigger event
121 // Implicitly start off in Command mode, switching to Edit mode will trigger event
122 $modal_ind_icon.attr('class','command_mode_icon').attr('title','Command Mode');
122 $modal_ind_icon.attr('class','command_mode_icon').attr('title','Command Mode');
123
123
124 // Kernel events
124 // Kernel events
125
125
126 // this can be either kernel_created.Kernel or kernel_created.Session
126 // this can be either kernel_created.Kernel or kernel_created.Session
127 this.events.on('kernel_created.Kernel kernel_created.Session', function () {
127 this.events.on('kernel_created.Kernel kernel_created.Session', function () {
128 knw.info("Kernel Created", 500);
128 knw.info("Kernel Created", 500);
129 });
129 });
130
130
131 this.events.on('status_reconnecting.Kernel', function () {
131 this.events.on('status_reconnecting.Kernel', function () {
132 knw.warning("Connecting to kernel");
132 knw.warning("Connecting to kernel");
133 });
133 });
134
134
135 this.events.on('status_connected.Kernel', function () {
135 this.events.on('status_connected.Kernel', function () {
136 knw.info("Connected", 500);
136 knw.info("Connected", 500);
137 });
137 });
138
138
139 this.events.on('status_restarting.Kernel', function () {
139 this.events.on('status_restarting.Kernel', function () {
140 that.save_widget.update_document_title();
140 that.save_widget.update_document_title();
141 knw.set_message("Restarting kernel", 2000);
141 knw.set_message("Restarting kernel", 2000);
142 });
142 });
143
143
144 this.events.on('status_autorestarting.Kernel', function (evt, info) {
144 this.events.on('status_autorestarting.Kernel', function (evt, info) {
145 // only show the dialog on the first restart attempt
145 // Only show the dialog on the first restart attempt. This
146 if (info.attempt == 1) {
146 // number gets tracked by the `Kernel` object and passed
147 // along here, because we don't want to show the user 5
148 // dialogs saying the same thing (which is the number of
149 // times it tries restarting).
150 if (info.attempt === 1) {
151
147 // hide existing modal dialog
152 // hide existing modal dialog
148 $(".modal").modal('hide');
153 $(".modal").modal('hide');
149
154
150 dialog.modal({
155 dialog.modal({
151 notebook: that.notebook,
156 notebook: that.notebook,
152 keyboard_manager: that.keyboard_manager,
157 keyboard_manager: that.keyboard_manager,
153 title: "Kernel Restarting",
158 title: "Kernel Restarting",
154 body: "The kernel appears to have died. It will restart automatically.",
159 body: "The kernel appears to have died. It will restart automatically.",
155 buttons: {
160 buttons: {
156 OK : {
161 OK : {
157 class : "btn-primary"
162 class : "btn-primary"
158 }
163 }
159 }
164 }
160 });
165 });
161 };
166 };
162
167
163 that.save_widget.update_document_title();
168 that.save_widget.update_document_title();
164 knw.danger("Dead kernel");
169 knw.danger("Dead kernel");
165 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
170 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
166 });
171 });
167
172
168 this.events.on('status_interrupting.Kernel', function () {
173 this.events.on('status_interrupting.Kernel', function () {
169 knw.set_message("Interrupting kernel", 2000);
174 knw.set_message("Interrupting kernel", 2000);
170 });
175 });
171
176
172 this.events.on('status_disconnected.Kernel', function () {
177 this.events.on('status_disconnected.Kernel', function () {
173 knw.danger("Disconnected", undefined, function () {
178 knw.danger("Disconnected", undefined, function () {
174 that.notebook.kernel.reconnect();
179 that.notebook.kernel.reconnect();
175 return false;
180 return false;
176 });
181 });
177 $kernel_ind_icon
182 $kernel_ind_icon
178 .attr('class', 'kernel_disconnected_icon')
183 .attr('class', 'kernel_disconnected_icon')
179 .attr('title', 'No Connection to Kernel');
184 .attr('title', 'No Connection to Kernel');
180 });
185 });
181
186
182 this.events.on('connection_failed.Kernel', function () {
187 this.events.on('connection_failed.Kernel', function () {
183 // hide existing dialog
188 // hide existing dialog
184 $(".modal").modal('hide');
189 $(".modal").modal('hide');
185
190
186 var msg = "A WebSocket connection could not be established." +
191 var msg = "A WebSocket connection could not be established." +
187 " You will NOT be able to run code. Check your" +
192 " You will NOT be able to run code. Check your" +
188 " network connection or notebook server configuration.";
193 " network connection or notebook server configuration.";
189
194
190 dialog.modal({
195 dialog.modal({
191 title: "WebSocket connection failed",
196 title: "WebSocket connection failed",
192 body: msg,
197 body: msg,
193 keyboard_manager: that.keyboard_manager,
198 keyboard_manager: that.keyboard_manager,
194 notebook: that.notebook,
199 notebook: that.notebook,
195 buttons : {
200 buttons : {
196 "OK": {},
201 "OK": {},
197 "Reconnect": {
202 "Reconnect": {
198 click: function () {
203 click: function () {
199 that.notebook.kernel.reconnect();
204 that.notebook.kernel.reconnect();
200 }
205 }
201 }
206 }
202 }
207 }
203 });
208 });
204 });
209 });
205
210
206 this.events.on('status_killed.Kernel status_killed.Session', function () {
211 this.events.on('status_killed.Kernel status_killed.Session', function () {
207 that.save_widget.update_document_title();
212 that.save_widget.update_document_title();
208 knw.danger("Dead kernel");
213 knw.danger("Dead kernel");
209 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
214 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
210 });
215 });
211
216
212 this.events.on('kernel_dead.Kernel', function () {
217 this.events.on('kernel_dead.Kernel', function () {
213
218
214 var showMsg = function () {
219 var showMsg = function () {
215 // hide existing dialog
220 // hide existing dialog
216 $(".modal").modal('hide');
221 $(".modal").modal('hide');
217
222
218 var msg = 'The kernel has died, and the automatic restart has failed.' +
223 var msg = 'The kernel has died, and the automatic restart has failed.' +
219 ' It is possible the kernel cannot be restarted.' +
224 ' It is possible the kernel cannot be restarted.' +
220 ' If you are not able to restart the kernel, you will still be able to save' +
225 ' If you are not able to restart the kernel, you will still be able to save' +
221 ' the notebook, but running code will no longer work until the notebook' +
226 ' the notebook, but running code will no longer work until the notebook' +
222 ' is reopened.';
227 ' is reopened.';
223
228
224 dialog.modal({
229 dialog.modal({
225 title: "Dead kernel",
230 title: "Dead kernel",
226 body : msg,
231 body : msg,
227 keyboard_manager: that.keyboard_manager,
232 keyboard_manager: that.keyboard_manager,
228 notebook: that.notebook,
233 notebook: that.notebook,
229 buttons : {
234 buttons : {
230 "Manual Restart": {
235 "Manual Restart": {
231 class: "btn-danger",
236 class: "btn-danger",
232 click: function () {
237 click: function () {
233 that.notebook.start_session();
238 that.notebook.start_session();
234 }
239 }
235 },
240 },
236 "Don't restart": {}
241 "Don't restart": {}
237 }
242 }
238 });
243 });
239
244
240 return false;
245 return false;
241 };
246 };
242
247
243 that.save_widget.update_document_title();
248 that.save_widget.update_document_title();
244 knw.danger("Dead kernel", undefined, showMsg);
249 knw.danger("Dead kernel", undefined, showMsg);
245 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
250 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
246
251
247 showMsg();
252 showMsg();
248 });
253 });
249
254
250 this.events.on('kernel_dead.Session', function (evt, info) {
255 this.events.on('kernel_dead.Session', function (evt, info) {
251 var full = info.xhr.responseJSON.message;
256 var full = info.xhr.responseJSON.message;
252 var short = info.xhr.responseJSON.short_message || 'Kernel error';
257 var short = info.xhr.responseJSON.short_message || 'Kernel error';
253 var traceback = info.xhr.responseJSON.traceback;
258 var traceback = info.xhr.responseJSON.traceback;
254
259
255 var showMsg = function () {
260 var showMsg = function () {
256 var msg = $('<div/>').append($('<p/>').text(full));
261 var msg = $('<div/>').append($('<p/>').text(full));
257 var cm, cm_elem, cm_open;
262 var cm, cm_elem, cm_open;
258
263
259 if (traceback) {
264 if (traceback) {
260 cm_elem = $('<div/>')
265 cm_elem = $('<div/>')
261 .css('margin-top', '1em')
266 .css('margin-top', '1em')
262 .css('padding', '1em')
267 .css('padding', '1em')
263 .addClass('output_scroll');
268 .addClass('output_scroll');
264 msg.append(cm_elem);
269 msg.append(cm_elem);
265 cm = CodeMirror(cm_elem.get(0), {
270 cm = CodeMirror(cm_elem.get(0), {
266 mode: "python",
271 mode: "python",
267 readOnly : true
272 readOnly : true
268 });
273 });
269 cm.setValue(traceback);
274 cm.setValue(traceback);
270 cm_open = $.proxy(cm.refresh, cm);
275 cm_open = $.proxy(cm.refresh, cm);
271 }
276 }
272
277
273 // hide existing modal dialog
278 // hide existing modal dialog
274 $(".modal").modal('hide');
279 $(".modal").modal('hide');
275
280
276 dialog.modal({
281 dialog.modal({
277 title: "Failed to start the kernel",
282 title: "Failed to start the kernel",
278 body : msg,
283 body : msg,
279 keyboard_manager: that.keyboard_manager,
284 keyboard_manager: that.keyboard_manager,
280 notebook: that.notebook,
285 notebook: that.notebook,
281 open: cm_open,
286 open: cm_open,
282 buttons : {
287 buttons : {
283 "Ok": { class: 'btn-primary' }
288 "Ok": { class: 'btn-primary' }
284 }
289 }
285 });
290 });
286
291
287 return false;
292 return false;
288 };
293 };
289
294
290 that.save_widget.update_document_title();
295 that.save_widget.update_document_title();
291 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
296 $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead');
292 knw.danger(short, undefined, showMsg);
297 knw.danger(short, undefined, showMsg);
293 });
298 });
294
299
295 this.events.on('status_starting.Kernel', function () {
300 this.events.on('status_starting.Kernel', function () {
296 window.document.title='(Starting) '+window.document.title;
301 window.document.title='(Starting) '+window.document.title;
297 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
302 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
298 knw.set_message("Kernel starting, please wait...");
303 knw.set_message("Kernel starting, please wait...");
299 });
304 });
300
305
301 this.events.on('status_ready.Kernel', function () {
306 this.events.on('status_ready.Kernel', function () {
302 that.save_widget.update_document_title();
307 that.save_widget.update_document_title();
303 $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle');
308 $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle');
304 knw.info("Kernel ready", 500);
309 knw.info("Kernel ready", 500);
305 });
310 });
306
311
307 this.events.on('status_idle.Kernel', function () {
312 this.events.on('status_idle.Kernel', function () {
308 that.save_widget.update_document_title();
313 that.save_widget.update_document_title();
309 $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle');
314 $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle');
310 });
315 });
311
316
312 this.events.on('status_busy.Kernel', function () {
317 this.events.on('status_busy.Kernel', function () {
313 window.document.title='(Busy) '+window.document.title;
318 window.document.title='(Busy) '+window.document.title;
314 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
319 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
315 });
320 });
316
321
317 // Start the kernel indicator in the busy state, and send a kernel_info request.
322 // Start the kernel indicator in the busy state, and send a kernel_info request.
318 // When the kernel_info reply arrives, the kernel is idle.
323 // When the kernel_info reply arrives, the kernel is idle.
319 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
324 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
320 };
325 };
321
326
322 /**
327 /**
323 * Initialize the notification widget for notebook status messages.
328 * Initialize the notification widget for notebook status messages.
324 *
329 *
325 * @method init_notebook_notification_widget
330 * @method init_notebook_notification_widget
326 */
331 */
327 NotificationArea.prototype.init_notebook_notification_widget = function () {
332 NotificationArea.prototype.init_notebook_notification_widget = function () {
328 var nnw = this.new_notification_widget('notebook');
333 var nnw = this.new_notification_widget('notebook');
329
334
330 // Notebook events
335 // Notebook events
331 this.events.on('notebook_loading.Notebook', function () {
336 this.events.on('notebook_loading.Notebook', function () {
332 nnw.set_message("Loading notebook",500);
337 nnw.set_message("Loading notebook",500);
333 });
338 });
334 this.events.on('notebook_loaded.Notebook', function () {
339 this.events.on('notebook_loaded.Notebook', function () {
335 nnw.set_message("Notebook loaded",500);
340 nnw.set_message("Notebook loaded",500);
336 });
341 });
337 this.events.on('notebook_saving.Notebook', function () {
342 this.events.on('notebook_saving.Notebook', function () {
338 nnw.set_message("Saving notebook",500);
343 nnw.set_message("Saving notebook",500);
339 });
344 });
340 this.events.on('notebook_saved.Notebook', function () {
345 this.events.on('notebook_saved.Notebook', function () {
341 nnw.set_message("Notebook saved",2000);
346 nnw.set_message("Notebook saved",2000);
342 });
347 });
343 this.events.on('notebook_save_failed.Notebook', function (evt, xhr, status, data) {
348 this.events.on('notebook_save_failed.Notebook', function (evt, xhr, status, data) {
344 nnw.warning(data || "Notebook save failed");
349 nnw.warning(data || "Notebook save failed");
345 });
350 });
346
351
347 // Checkpoint events
352 // Checkpoint events
348 this.events.on('checkpoint_created.Notebook', function (evt, data) {
353 this.events.on('checkpoint_created.Notebook', function (evt, data) {
349 var msg = "Checkpoint created";
354 var msg = "Checkpoint created";
350 if (data.last_modified) {
355 if (data.last_modified) {
351 var d = new Date(data.last_modified);
356 var d = new Date(data.last_modified);
352 msg = msg + ": " + moment(d).format("HH:mm:ss");
357 msg = msg + ": " + moment(d).format("HH:mm:ss");
353 }
358 }
354 nnw.set_message(msg, 2000);
359 nnw.set_message(msg, 2000);
355 });
360 });
356 this.events.on('checkpoint_failed.Notebook', function () {
361 this.events.on('checkpoint_failed.Notebook', function () {
357 nnw.warning("Checkpoint failed");
362 nnw.warning("Checkpoint failed");
358 });
363 });
359 this.events.on('checkpoint_deleted.Notebook', function () {
364 this.events.on('checkpoint_deleted.Notebook', function () {
360 nnw.set_message("Checkpoint deleted", 500);
365 nnw.set_message("Checkpoint deleted", 500);
361 });
366 });
362 this.events.on('checkpoint_delete_failed.Notebook', function () {
367 this.events.on('checkpoint_delete_failed.Notebook', function () {
363 nnw.warning("Checkpoint delete failed");
368 nnw.warning("Checkpoint delete failed");
364 });
369 });
365 this.events.on('checkpoint_restoring.Notebook', function () {
370 this.events.on('checkpoint_restoring.Notebook', function () {
366 nnw.set_message("Restoring to checkpoint...", 500);
371 nnw.set_message("Restoring to checkpoint...", 500);
367 });
372 });
368 this.events.on('checkpoint_restore_failed.Notebook', function () {
373 this.events.on('checkpoint_restore_failed.Notebook', function () {
369 nnw.warning("Checkpoint restore failed");
374 nnw.warning("Checkpoint restore failed");
370 });
375 });
371
376
372 // Autosave events
377 // Autosave events
373 this.events.on('autosave_disabled.Notebook', function () {
378 this.events.on('autosave_disabled.Notebook', function () {
374 nnw.set_message("Autosave disabled", 2000);
379 nnw.set_message("Autosave disabled", 2000);
375 });
380 });
376 this.events.on('autosave_enabled.Notebook', function (evt, interval) {
381 this.events.on('autosave_enabled.Notebook', function (evt, interval) {
377 nnw.set_message("Saving every " + interval / 1000 + "s", 1000);
382 nnw.set_message("Saving every " + interval / 1000 + "s", 1000);
378 });
383 });
379 };
384 };
380
385
381 IPython.NotificationArea = NotificationArea;
386 IPython.NotificationArea = NotificationArea;
382
387
383 return {'NotificationArea': NotificationArea};
388 return {'NotificationArea': NotificationArea};
384 });
389 });
General Comments 0
You need to be logged in to leave comments. Login now