kernellist.js
45 lines
| 1.4 KiB
| application/javascript
|
JavascriptLexer
|
r15382 | //---------------------------------------------------------------------------- | ||
// Copyright (C) 2014 The IPython Development Team | ||||
// | ||||
// Distributed under the terms of the BSD License. The full license is in | ||||
// the file COPYING, distributed as part of this software. | ||||
//---------------------------------------------------------------------------- | ||||
//============================================================================ | ||||
// Running Kernels List | ||||
//============================================================================ | ||||
var IPython = (function (IPython) { | ||||
"use strict"; | ||||
|
r15454 | var utils = IPython.utils; | ||
|
r15382 | var KernelList = function (selector, options) { | ||
|
r15454 | IPython.NotebookList.call(this, selector, options, 'running'); | ||
|
r15382 | }; | ||
|
r15454 | KernelList.prototype = Object.create(IPython.NotebookList.prototype); | ||
|
r15382 | |||
|
r15454 | KernelList.prototype.sessions_loaded = function (d) { | ||
|
r15479 | this.sessions = d; | ||
|
r15454 | // clear out the previous list | ||
this.clear_list(); | ||||
var item; | ||||
|
r15479 | for (var path in d) { | ||
item = this.new_notebook_item(-1); | ||||
|
r15457 | this.add_link('', path, item); | ||
|
r15454 | this.add_shutdown_button(item,this.sessions[path]); | ||
} | ||||
|
r15479 | if ($.isEmptyObject(d)) { | ||
|
r15454 | $('#' + this.element_name + '_list_header').show(); | ||
|
r15479 | } else { | ||
$('#' + this.element_name + '_list_header').hide(); | ||||
|
r15454 | } | ||
} | ||||
|
r15382 | IPython.KernelList = KernelList; | ||
return IPython; | ||||
}(IPython)); | ||||