Show More
@@ -52,6 +52,23 b' define([' | |||
|
52 | 52 | $('#running_list_header').toggle($.isEmptyObject(d)); |
|
53 | 53 | }; |
|
54 | 54 | |
|
55 | KernelList.prototype.add_link = function (model, item) { | |
|
56 | notebooklist.NotebookList.prototype.add_link.apply(this, [model, item]) | |
|
57 | ||
|
58 | var running_indicator = item.find(".item_buttons") | |
|
59 | .text(''); | |
|
60 | ||
|
61 | var that = this; | |
|
62 | var shutdown_button = $('<button/>') | |
|
63 | .addClass('btn btn-warning btn-xs') | |
|
64 | .text('Shutdown') | |
|
65 | .click(function() { | |
|
66 | var path = $(this).parent().parent().parent().data('path'); | |
|
67 | that.shutdown_notebook(path); | |
|
68 | }) | |
|
69 | .appendTo(running_indicator); | |
|
70 | }; | |
|
71 | ||
|
55 | 72 | // Backwards compatability. |
|
56 | 73 | IPython.KernelList = KernelList; |
|
57 | 74 |
@@ -431,6 +431,15 b' define([' | |||
|
431 | 431 | |
|
432 | 432 | NotebookList.prototype.shutdown_selected = function() { |
|
433 | 433 | var that = this; |
|
434 | this.selected.forEach(function(item) { | |
|
435 | if (item.type == 'notebook') { | |
|
436 | that.shutdown_notebook(item.path); | |
|
437 | } | |
|
438 | }); | |
|
439 | }; | |
|
440 | ||
|
441 | NotebookList.prototype.shutdown_notebook = function(path) { | |
|
442 | var that = this; | |
|
434 | 443 | var settings = { |
|
435 | 444 | processData : false, |
|
436 | 445 | cache : false, |
@@ -442,20 +451,16 b' define([' | |||
|
442 | 451 | error : utils.log_ajax_error, |
|
443 | 452 | }; |
|
444 | 453 | |
|
445 | this.selected.forEach(function(item) { | |
|
446 | if (item.type == 'notebook') { | |
|
447 | var session = that.sessions[item.path]; | |
|
454 | var session = this.sessions[path]; | |
|
448 | 455 |
|
|
449 | 456 |
|
|
450 |
|
|
|
457 | this.base_url, | |
|
451 | 458 |
|
|
452 | 459 |
|
|
453 | 460 |
|
|
454 | 461 |
|
|
455 | 462 |
|
|
456 | 463 | } |
|
457 | }); | |
|
458 | }; | |
|
459 | 464 | |
|
460 | 465 | NotebookList.prototype.rename_selected = function() { |
|
461 | 466 | if (this.selected.length != 1) return; |
General Comments 0
You need to be logged in to leave comments.
Login now