diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index fd53ecf..dbe4108 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -20,7 +20,7 @@ var IPython = (function (IPython) { "use strict"; /** - * A MenuBar Class to generate the menubar of IPython noteboko + * A MenuBar Class to generate the menubar of IPython notebook * @Class MenuBar * * @constructor @@ -110,8 +110,8 @@ var IPython = (function (IPython) { this.element.find('#restore_checkpoint').click(function () { }); this.element.find('#kill_and_exit').click(function () { - IPython.notebook.kernel.kill(); - setTimeout(function(){window.close();}, 200); + IPython.notebook.session.delete_session(); + setTimeout(function(){window.close();}, 500); }); // Edit this.element.find('#cut_cell').click(function () { diff --git a/IPython/html/static/services/sessions/js/session.js b/IPython/html/static/services/sessions/js/session.js index c09bf96..fe8be64 100644 --- a/IPython/html/static/services/sessions/js/session.js +++ b/IPython/html/static/services/sessions/js/session.js @@ -17,6 +17,7 @@ var IPython = (function (IPython) { this.session_id = null; this.notebook_path = notebook_path; this.notebook = Notebook; + this._baseProjectUrl = Notebook.baseProjectUrl() }; Session.prototype.start = function(){ @@ -64,7 +65,22 @@ var IPython = (function (IPython) { Session.prototype.interrupt_kernel = function() { this.kernel.interrupt(); - } + }; + + Session.prototype.delete_session = function() { + var settings = { + processData : false, + cache : false, + type : "DELETE", + dataType : "json", + }; + var url = this._baseProjectUrl + 'api/sessions/' + this.session_id; + $.ajax(url, settings); + }; + + Session.prototype.kill_kernel = function() { + this.kernel.kill(); + }; IPython.Session = Session; diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 0be68c0..9622ec2 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -111,7 +111,6 @@ var IPython = (function (IPython) { success : $.proxy(this.sessions_loaded, this) }; var url = this.baseProjectUrl() + 'api/sessions'; - console.log("THIS IS A TEST"); $.ajax(url,settings); };