path with spaces completely fixed

Zachary Sailer 13 years ago committed by MinRK
parent eb1690255d
commit 1b2e41eea4

@ -52,15 +52,14 @@ class NamedNotebookHandler(IPythonHandler):
nbm = self.notebook_manager
name, path = nbm.named_notebook_path(notebook_path)
if name != None:
name = quote(name)
name = nbm.url_encode(name)
if path == None:
project = self.project + '/' + name
else:
project = self.project + '/' + path +'/'+ name
path = nbm.url_encode(path)
if not nbm.notebook_exists(notebook_path):
raise web.HTTPError(404, u'Notebook does not exist: %s' % name)
path = nbm.url_encode(path)
name = nbm.url_encode(name)
self.write(self.render_template('notebook.html',
project=project,
notebook_path=path,

@ -50,6 +50,7 @@ function (marked) {
var notebookPath = $('body').data('notebookPath');
var notebookName = $('body').data('notebookName');
notebookName = decodeURIComponent(notebookName);
notebookPath = decodeURIComponent(notebookPath);
console.log(notebookName);
if (notebookPath == 'None'){
notebookPath = "";

@ -85,6 +85,7 @@ var IPython = (function (IPython) {
Notebook.prototype.notebookPath = function() {
var path = $('body').data('notebookPath');
path = decodeURIComponent(path);
if (path != 'None') {
if (path[path.length-1] != '/') {
path = path.substring(0,path.length);

@ -28,6 +28,7 @@ var IPython = (function (IPython) {
NotebookList.prototype.notebookPath = function() {
var path = $('body').data('notebookPath');
path = decodeURIComponent(path);
if (path != "") {
if (path[path.length-1] != '/') {
path = path.substring(0,path.length);

Loading…
Cancel
Save