Show More
@@ -1,45 +1,41 b'' | |||||
1 | //---------------------------------------------------------------------------- |
|
1 | //---------------------------------------------------------------------------- | |
2 | // Copyright (C) 2014 The IPython Development Team |
|
2 | // Copyright (C) 2014 The IPython Development Team | |
3 | // |
|
3 | // | |
4 | // Distributed under the terms of the BSD License. The full license is in |
|
4 | // Distributed under the terms of the BSD License. The full license is in | |
5 | // the file COPYING, distributed as part of this software. |
|
5 | // the file COPYING, distributed as part of this software. | |
6 | //---------------------------------------------------------------------------- |
|
6 | //---------------------------------------------------------------------------- | |
7 |
|
7 | |||
8 | //============================================================================ |
|
8 | //============================================================================ | |
9 | // Running Kernels List |
|
9 | // Running Kernels List | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 | var IPython = (function (IPython) { |
|
12 | var IPython = (function (IPython) { | |
13 | "use strict"; |
|
13 | "use strict"; | |
14 |
|
14 | |||
15 | var utils = IPython.utils; |
|
15 | var utils = IPython.utils; | |
16 |
|
16 | |||
17 | var KernelList = function (selector, options) { |
|
17 | var KernelList = function (selector, options) { | |
18 | IPython.NotebookList.call(this, selector, options, 'running'); |
|
18 | IPython.NotebookList.call(this, selector, options, 'running'); | |
19 | }; |
|
19 | }; | |
20 |
|
20 | |||
21 | KernelList.prototype = Object.create(IPython.NotebookList.prototype); |
|
21 | KernelList.prototype = Object.create(IPython.NotebookList.prototype); | |
22 |
|
22 | |||
23 | KernelList.prototype.sessions_loaded = function (d) { |
|
23 | KernelList.prototype.sessions_loaded = function (d) { | |
24 | this.sessions = d; |
|
24 | this.sessions = d; | |
25 | // clear out the previous list |
|
25 | // clear out the previous list | |
26 | this.clear_list(); |
|
26 | this.clear_list(); | |
27 | var item; |
|
27 | var item; | |
28 | for (var path in d) { |
|
28 | for (var path in d) { | |
29 | item = this.new_notebook_item(-1); |
|
29 | item = this.new_notebook_item(-1); | |
30 | this.add_link('', path, item); |
|
30 | this.add_link('', path, item); | |
31 | this.add_shutdown_button(item,this.sessions[path]); |
|
31 | this.add_shutdown_button(item,this.sessions[path]); | |
32 | } |
|
32 | } | |
33 |
|
33 | |||
34 |
|
|
34 | $('#running_list_header').toggle($.isEmptyObject(d)); | |
35 | $('#' + this.element_name + '_list_header').show(); |
|
|||
36 | } else { |
|
|||
37 | $('#' + this.element_name + '_list_header').hide(); |
|
|||
38 | } |
|
|||
39 | } |
|
35 | } | |
40 |
|
36 | |||
41 | IPython.KernelList = KernelList; |
|
37 | IPython.KernelList = KernelList; | |
42 |
|
38 | |||
43 | return IPython; |
|
39 | return IPython; | |
44 |
|
40 | |||
45 | }(IPython)); |
|
41 | }(IPython)); |
General Comments 0
You need to be logged in to leave comments.
Login now