Show More
@@ -44,21 +44,21 b' var IPython = (function (IPython) {' | |||||
44 | }; |
|
44 | }; | |
45 |
|
45 | |||
46 | NotificationArea.prototype.widget = function(name) { |
|
46 | NotificationArea.prototype.widget = function(name) { | |
47 | if(this.widget_dict[name] == undefined) { |
|
47 | if(this.widget_dict[name] === undefined) { | |
48 | return this.new_notification_widget(name); |
|
48 | return this.new_notification_widget(name); | |
49 | } |
|
49 | } | |
50 | return this.get_widget(name); |
|
50 | return this.get_widget(name); | |
51 | }; |
|
51 | }; | |
52 |
|
52 | |||
53 | NotificationArea.prototype.get_widget = function(name) { |
|
53 | NotificationArea.prototype.get_widget = function(name) { | |
54 | if(this.widget_dict[name] == undefined) { |
|
54 | if(this.widget_dict[name] === undefined) { | |
55 | throw('no widgets with this name'); |
|
55 | throw('no widgets with this name'); | |
56 | } |
|
56 | } | |
57 | return this.widget_dict[name]; |
|
57 | return this.widget_dict[name]; | |
58 | }; |
|
58 | }; | |
59 |
|
59 | |||
60 | NotificationArea.prototype.new_notification_widget = function(name) { |
|
60 | NotificationArea.prototype.new_notification_widget = function(name) { | |
61 | if(this.widget_dict[name] != undefined) { |
|
61 | if(this.widget_dict[name] !== undefined) { | |
62 | throw('widget with that name already exists ! '); |
|
62 | throw('widget with that name already exists ! '); | |
63 | } |
|
63 | } | |
64 | var div = $('<div/>').attr('id','notification_'+name); |
|
64 | var div = $('<div/>').attr('id','notification_'+name); | |
@@ -75,26 +75,26 b' var IPython = (function (IPython) {' | |||||
75 | // Command/Edit mode |
|
75 | // Command/Edit mode | |
76 | $([IPython.events]).on('edit_mode.Notebook',function () { |
|
76 | $([IPython.events]).on('edit_mode.Notebook',function () { | |
77 | IPython.save_widget.update_document_title(); |
|
77 | IPython.save_widget.update_document_title(); | |
78 |
$modal_ind_icon.attr('class',' |
|
78 | $modal_ind_icon.attr('class','edit_mode_icon').attr('title','Edit Mode'); | |
79 | }); |
|
79 | }); | |
80 |
|
80 | |||
81 | $([IPython.events]).on('command_mode.Notebook',function () { |
|
81 | $([IPython.events]).on('command_mode.Notebook',function () { | |
82 | IPython.save_widget.update_document_title(); |
|
82 | IPython.save_widget.update_document_title(); | |
83 |
$modal_ind_icon.attr('class',' |
|
83 | $modal_ind_icon.attr('class','command_mode_icon').attr('title','Command Mode'); | |
84 | }); |
|
84 | }); | |
85 |
|
85 | |||
86 | // Implicitly start off in Command mode, switching to Edit mode will trigger event |
|
86 | // Implicitly start off in Command mode, switching to Edit mode will trigger event | |
87 |
$modal_ind_icon.attr('class',' |
|
87 | $modal_ind_icon.attr('class','command-mode_icon').attr('title','Command Mode'); | |
88 |
|
88 | |||
89 | // Kernel events |
|
89 | // Kernel events | |
90 | $([IPython.events]).on('status_idle.Kernel',function () { |
|
90 | $([IPython.events]).on('status_idle.Kernel',function () { | |
91 | IPython.save_widget.update_document_title(); |
|
91 | IPython.save_widget.update_document_title(); | |
92 |
$kernel_ind_icon.attr('class',' |
|
92 | $kernel_ind_icon.attr('class','kernel_idle_icon').attr('title','Kernel Idle'); | |
93 | }); |
|
93 | }); | |
94 |
|
94 | |||
95 | $([IPython.events]).on('status_busy.Kernel',function () { |
|
95 | $([IPython.events]).on('status_busy.Kernel',function () { | |
96 | window.document.title='(Busy) '+window.document.title; |
|
96 | window.document.title='(Busy) '+window.document.title; | |
97 |
$kernel_ind_icon.attr('class',' |
|
97 | $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy'); | |
98 | }); |
|
98 | }); | |
99 |
|
99 | |||
100 | $([IPython.events]).on('status_restarting.Kernel',function () { |
|
100 | $([IPython.events]).on('status_restarting.Kernel',function () { | |
@@ -108,7 +108,7 b' var IPython = (function (IPython) {' | |||||
108 |
|
108 | |||
109 | // Start the kernel indicator in the busy state, and send a kernel_info request. |
|
109 | // Start the kernel indicator in the busy state, and send a kernel_info request. | |
110 | // When the kernel_info reply arrives, the kernel is idle. |
|
110 | // When the kernel_info reply arrives, the kernel is idle. | |
111 |
$kernel_ind_icon.attr('class',' |
|
111 | $kernel_ind_icon.attr('class','kernel_busy_icon').attr('title','Kernel Busy'); | |
112 |
|
112 | |||
113 | $([IPython.events]).on('status_started.Kernel', function (evt, data) { |
|
113 | $([IPython.events]).on('status_started.Kernel', function (evt, data) { | |
114 | data.kernel.kernel_info(function () { |
|
114 | data.kernel.kernel_info(function () { | |
@@ -151,7 +151,7 b' var IPython = (function (IPython) {' | |||||
151 | }, 5000); |
|
151 | }, 5000); | |
152 | return; |
|
152 | return; | |
153 | } |
|
153 | } | |
154 | console.log('WebSocket connection failed: ', ws_url) |
|
154 | console.log('WebSocket connection failed: ', ws_url); | |
155 | msg = "A WebSocket connection could not be established." + |
|
155 | msg = "A WebSocket connection could not be established." + | |
156 | " You will NOT be able to run code. Check your" + |
|
156 | " You will NOT be able to run code. Check your" + | |
157 | " network connection or notebook server configuration."; |
|
157 | " network connection or notebook server configuration."; |
@@ -16,19 +16,19 b'' | |||||
16 | margin-right: -16px; |
|
16 | margin-right: -16px; | |
17 | } |
|
17 | } | |
18 |
|
18 | |||
19 |
. |
|
19 | .edit_mode_icon:before { | |
20 | .icon(@pencil); |
|
20 | .icon(@pencil); | |
21 | } |
|
21 | } | |
22 |
|
22 | |||
23 |
. |
|
23 | .command_mode_icon:before { | |
24 | .icon(' '); |
|
24 | .icon(' '); | |
25 | } |
|
25 | } | |
26 |
|
26 | |||
27 |
. |
|
27 | .kernel_idle_icon:before { | |
28 | .icon(@circle-blank); |
|
28 | .icon(@circle-blank); | |
29 | } |
|
29 | } | |
30 |
|
30 | |||
31 |
. |
|
31 | .kernel_busy_icon:before { | |
32 | .icon(@circle); |
|
32 | .icon(@circle); | |
33 | } |
|
33 | } | |
34 |
|
34 |
General Comments 0
You need to be logged in to leave comments.
Login now