From 29320b298396957c980607b52bb0b19956536ea7 2013-10-17 21:09:05 From: Zachary Sailer Date: 2013-10-17 21:09:05 Subject: [PATCH] redirect url after notebook rename --- diff --git a/IPython/html/services/sessions/handlers.py b/IPython/html/services/sessions/handlers.py index a292272..60dfdbe 100644 --- a/IPython/html/services/sessions/handlers.py +++ b/IPython/html/services/sessions/handlers.py @@ -21,7 +21,6 @@ from tornado import web from zmq.utils import jsonapi from IPython.utils.jsonutil import date_default - from ...base.handlers import IPythonHandler, authenticate_unless_readonly #----------------------------------------------------------------------------- diff --git a/IPython/html/static/notebook/js/savewidget.js b/IPython/html/static/notebook/js/savewidget.js index 2b982a1..1d99d08 100644 --- a/IPython/html/static/notebook/js/savewidget.js +++ b/IPython/html/static/notebook/js/savewidget.js @@ -47,8 +47,7 @@ var IPython = (function (IPython) { that.update_document_title(); }); $([IPython.events]).on('notebook_renamed.Notebook', function () { - that.update_notebook_name(); - that.update_document_title(); + that.update_address_bar(); }); $([IPython.events]).on('notebook_save_failed.Notebook', function () { that.set_save_status('Autosave Failed!'); @@ -123,6 +122,12 @@ var IPython = (function (IPython) { var nbname = IPython.notebook.get_notebook_name(); document.title = nbname; }; + + SaveWidget.prototype.update_address_bar = function(){ + var nbname = IPython.notebook.notebook_name; + var path = IPython.notebook.notebookPath(); + window.location = path + nbname; + } SaveWidget.prototype.set_save_status = function (msg) { diff --git a/IPython/html/tree/handlers.py b/IPython/html/tree/handlers.py index cb97f38..0ceabad 100644 --- a/IPython/html/tree/handlers.py +++ b/IPython/html/tree/handlers.py @@ -53,7 +53,7 @@ class ProjectPathDashboardHandler(IPythonHandler): project=project, project_component=project.split('/'), notebook_path=path, - notebook_name=quote(name))) + notebook_name=name)) class TreeRedirectHandler(IPythonHandler):