Show More
@@ -1,48 +1,47 | |||||
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 | // clear out the previous list |
|
24 | // clear out the previous list | |
25 | this.clear_list(); |
|
25 | this.clear_list(); | |
26 | var len = d.length; |
|
26 | var len = d.length; | |
27 | var item; |
|
27 | var item; | |
28 | for (var i=0; i < d.length; i++) { |
|
28 | for (var i=0; i < d.length; i++) { | |
29 |
var path |
|
29 | var path= utils.url_path_join(d[i].notebook.path, d[i].notebook.name); | |
30 | var name = d[i].name; |
|
|||
31 | item = this.new_notebook_item(i); |
|
30 | item = this.new_notebook_item(i); | |
32 |
this.add_link( |
|
31 | this.add_link('', path, item); | |
33 | this.sessions[path] = d[i].id; |
|
32 | this.sessions[path] = d[i].id; | |
34 | this.add_shutdown_button(item,this.sessions[path]); |
|
33 | this.add_shutdown_button(item,this.sessions[path]); | |
35 | } |
|
34 | } | |
36 |
|
35 | |||
37 | if (len > 0) { |
|
36 | if (len > 0) { | |
38 | $('#' + this.element_name + '_list_header').hide(); |
|
37 | $('#' + this.element_name + '_list_header').hide(); | |
39 | } else { |
|
38 | } else { | |
40 | $('#' + this.element_name + '_list_header').show(); |
|
39 | $('#' + this.element_name + '_list_header').show(); | |
41 | } |
|
40 | } | |
42 | } |
|
41 | } | |
43 |
|
42 | |||
44 | IPython.KernelList = KernelList; |
|
43 | IPython.KernelList = KernelList; | |
45 |
|
44 | |||
46 | return IPython; |
|
45 | return IPython; | |
47 |
|
46 | |||
48 | }(IPython)); |
|
47 | }(IPython)); |
General Comments 0
You need to be logged in to leave comments.
Login now