Show More
@@ -636,8 +636,26 var IPython = (function (IPython) { | |||||
636 |
|
636 | |||
637 |
|
637 | |||
638 | Notebook.prototype.restart_kernel = function () { |
|
638 | Notebook.prototype.restart_kernel = function () { | |
|
639 | var that = this; | |||
639 | var notebook_id = IPython.save_widget.get_notebook_id(); |
|
640 | var notebook_id = IPython.save_widget.get_notebook_id(); | |
640 | this.kernel.restart($.proxy(this.kernel_started, this)); |
|
641 | ||
|
642 | var dialog = $('<div/>'); | |||
|
643 | dialog.html('Do you want to restart the current kernel? You will lose all variables defined in it.'); | |||
|
644 | $(document).append(dialog); | |||
|
645 | dialog.dialog({ | |||
|
646 | resizable: false, | |||
|
647 | modal: true, | |||
|
648 | title: "Restart kernel or continue running?", | |||
|
649 | buttons : { | |||
|
650 | "Restart": function () { | |||
|
651 | that.kernel.restart($.proxy(that.kernel_started, that)); | |||
|
652 | $(this).dialog('close'); | |||
|
653 | }, | |||
|
654 | "Continue running": function () { | |||
|
655 | $(this).dialog('close'); | |||
|
656 | } | |||
|
657 | } | |||
|
658 | }); | |||
641 | }; |
|
659 | }; | |
642 |
|
660 | |||
643 |
|
661 |
General Comments 0
You need to be logged in to leave comments.
Login now