Skip to content
Browse files

Fixed testing of new notebook name before saving.

  • Loading branch information...
1 parent 294bd09 commit c0c597c50849241159f7ff5b611bf484683c8dac Felix Werner committed Oct 16, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 IPython/frontend/html/notebook/static/js/savewidget.js
View
6 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 = $('<div/>');
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;

0 comments on commit c0c597c

Please sign in to comment.
Something went wrong with that request. Please try again.