From a4bec7e65db070ad142e9093d6ffc48c1ac480e2 Mon Sep 17 00:00:00 2001 From: Felix Werner Date: Sun, 16 Oct 2011 19:35:18 +0200 Subject: [PATCH] Fixed testing of new notebook name before saving. --- IPython/frontend/html/notebook/static/js/savewidget.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IPython/frontend/html/notebook/static/js/savewidget.js b/IPython/frontend/html/notebook/static/js/savewidget.js index e3c9844f7..8aafca8d7 100644 --- a/IPython/frontend/html/notebook/static/js/savewidget.js +++ b/IPython/frontend/html/notebook/static/js/savewidget.js @@ -15,7 +15,7 @@ var IPython = (function (IPython) { var SaveWidget = function (selector) { this.selector = selector; - this.notebook_name_re = /[^/\\]+/ + this.notebook_name_blacklist_re = /[\/\\]/ this.last_saved_name = ''; if (this.selector !== undefined) { this.element = $(selector); @@ -100,14 +100,14 @@ var IPython = (function (IPython) { SaveWidget.prototype.test_notebook_name = function () { var nbname = this.get_notebook_name(); - if (this.notebook_name_re.test(nbname)) { + if (this.notebook_name_blacklist_re.test(nbname) == false) { return true; } else { var bad_name = $('
'); bad_name.html( "The notebook name you entered (" + nbname + - ") is not valid. Notebook names can contain any characters except / and \\" + ") is not valid. Notebook names can contain any characters except / and \\." ); bad_name.dialog({title: 'Invalid name', modal: true}); return false;