##// END OF EJS Templates
use one-off notification widget for match notification...
Min RK -
Show More
@@ -201,6 +201,12 b' define(['
201 }
201 }
202 if (matches.length === 1) {
202 if (matches.length === 1) {
203 ks = kernelspecs[matches[0]];
203 ks = kernelspecs[matches[0]];
204 console.log("No exact match found for " + selected.name +
205 ", using only kernel that matches language=" + selected.language, ks);
206 this.events.trigger("spec_match_found.Kernel", {
207 selected: selected,
208 found: ks,
209 });
204 }
210 }
205 // if still undefined, trigger failure event
211 // if still undefined, trigger failure event
206 if (ks === undefined) {
212 if (ks === undefined) {
@@ -14,7 +14,7 b' define(['
14 this.save_widget = options.save_widget;
14 this.save_widget = options.save_widget;
15 this.notebook = options.notebook;
15 this.notebook = options.notebook;
16 this.keyboard_manager = options.keyboard_manager;
16 this.keyboard_manager = options.keyboard_manager;
17 }
17 };
18
18
19 NotebookNotificationArea.prototype = Object.create(NotificationArea.prototype);
19 NotebookNotificationArea.prototype = Object.create(NotificationArea.prototype);
20
20
@@ -38,7 +38,7 b' define(['
38 var knw = this.new_notification_widget('kernel');
38 var knw = this.new_notification_widget('kernel');
39 var $kernel_ind_icon = $("#kernel_indicator_icon");
39 var $kernel_ind_icon = $("#kernel_indicator_icon");
40 var $modal_ind_icon = $("#modal_indicator");
40 var $modal_ind_icon = $("#modal_indicator");
41 var $body = $('body')
41 var $body = $('body');
42
42
43 // Command/Edit mode
43 // Command/Edit mode
44 this.events.on('edit_mode.Notebook', function () {
44 this.events.on('edit_mode.Notebook', function () {
@@ -57,7 +57,7 b' define(['
57
57
58 // Implicitly start off in Command mode, switching to Edit mode will trigger event
58 // Implicitly start off in Command mode, switching to Edit mode will trigger event
59 $modal_ind_icon.addClass('modal_indicator').attr('title','Command Mode');
59 $modal_ind_icon.addClass('modal_indicator').attr('title','Command Mode');
60 $body.addClass('command_mode')
60 $body.addClass('command_mode');
61
61
62 // Kernel events
62 // Kernel events
63
63
@@ -105,7 +105,7 b' define(['
105 }
105 }
106 }
106 }
107 });
107 });
108 };
108 }
109
109
110 that.save_widget.update_document_title();
110 that.save_widget.update_document_title();
111 knw.danger("Dead kernel");
111 knw.danger("Dead kernel");
@@ -256,6 +256,13 b' define(['
256 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
256 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
257 });
257 });
258
258
259 this.events.on('spec_match_found.Kernel', function (evt, data) {
260 that.widget('kernelspec').info("Using kernel: " + data.found.spec.display_name, 3000, undefined, {
261 title: "Only candidate for language: " + data.selected.language + " was " + data.found.spec.display_name
262 });
263 });
264
265
259 // Start the kernel indicator in the busy state, and send a kernel_info request.
266 // Start the kernel indicator in the busy state, and send a kernel_info request.
260 // When the kernel_info reply arrives, the kernel is idle.
267 // When the kernel_info reply arrives, the kernel is idle.
261 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
268 $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy');
General Comments 0
You need to be logged in to leave comments. Login now