##// END OF EJS Templates
Add the "Duplicate" button in the main dashboard...
Add the "Duplicate" button in the main dashboard so we can copy an existing notebook without having to start it's instance

File last commit:

r17535:920c0ba6
r18927:b405f2c8
Show More
kernellist.js
52 lines | 1.5 KiB | application/javascript | JavascriptLexer
// Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
define([
'base/js/namespace',
'jquery',
'tree/js/notebooklist',
], function(IPython, $, notebooklist) {
"use strict";
var KernelList = function (selector, options) {
// Constructor
//
// Parameters:
// selector: string
// options: dictionary
// Dictionary of keyword arguments.
// session_list: SessionList instance
// base_url: string
// notebook_path: string
notebooklist.NotebookList.call(this, selector, $.extend({
element_name: 'running'},
options));
};
KernelList.prototype = Object.create(notebooklist.NotebookList.prototype);
KernelList.prototype.sessions_loaded = function (d) {
this.sessions = d;
this.clear_list();
var item, path_name;
for (path_name in d) {
if (!d.hasOwnProperty(path_name)) {
// nothing is safe in javascript
continue;
}
item = this.new_item(-1);
this.add_link({
name: path_name,
path: '',
type: 'notebook',
}, item);
this.add_shutdown_button(item, this.sessions[path_name]);
}
$('#running_list_header').toggle($.isEmptyObject(d));
};
// Backwards compatability.
IPython.KernelList = KernelList;
return {'KernelList': KernelList};
});