Show More
@@ -20,7 +20,7 b' var IPython = (function (IPython) {' | |||
|
20 | 20 | "use strict"; |
|
21 | 21 | |
|
22 | 22 | /** |
|
23 |
* A MenuBar Class to generate the menubar of IPython notebo |
|
|
23 | * A MenuBar Class to generate the menubar of IPython notebook | |
|
24 | 24 | * @Class MenuBar |
|
25 | 25 | * |
|
26 | 26 | * @constructor |
@@ -110,8 +110,8 b' var IPython = (function (IPython) {' | |||
|
110 | 110 | this.element.find('#restore_checkpoint').click(function () { |
|
111 | 111 | }); |
|
112 | 112 | this.element.find('#kill_and_exit').click(function () { |
|
113 |
IPython.notebook. |
|
|
114 |
setTimeout(function(){window.close();}, |
|
|
113 | IPython.notebook.session.delete_session(); | |
|
114 | setTimeout(function(){window.close();}, 500); | |
|
115 | 115 | }); |
|
116 | 116 | // Edit |
|
117 | 117 | this.element.find('#cut_cell').click(function () { |
@@ -17,6 +17,7 b' var IPython = (function (IPython) {' | |||
|
17 | 17 | this.session_id = null; |
|
18 | 18 | this.notebook_path = notebook_path; |
|
19 | 19 | this.notebook = Notebook; |
|
20 | this._baseProjectUrl = Notebook.baseProjectUrl() | |
|
20 | 21 | }; |
|
21 | 22 | |
|
22 | 23 | Session.prototype.start = function(){ |
@@ -64,7 +65,22 b' var IPython = (function (IPython) {' | |||
|
64 | 65 | |
|
65 | 66 | Session.prototype.interrupt_kernel = function() { |
|
66 | 67 | this.kernel.interrupt(); |
|
67 | } | |
|
68 | }; | |
|
69 | ||
|
70 | Session.prototype.delete_session = function() { | |
|
71 | var settings = { | |
|
72 | processData : false, | |
|
73 | cache : false, | |
|
74 | type : "DELETE", | |
|
75 | dataType : "json", | |
|
76 | }; | |
|
77 | var url = this._baseProjectUrl + 'api/sessions/' + this.session_id; | |
|
78 | $.ajax(url, settings); | |
|
79 | }; | |
|
80 | ||
|
81 | Session.prototype.kill_kernel = function() { | |
|
82 | this.kernel.kill(); | |
|
83 | }; | |
|
68 | 84 | |
|
69 | 85 | IPython.Session = Session; |
|
70 | 86 |
General Comments 0
You need to be logged in to leave comments.
Login now