From 3870a30ce486474cdd7a865fee2a6e33ff889ea5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 10 Nov 2014 17:29:53 -0800 Subject: [PATCH] contents.new_untitled to match Python API --- IPython/html/static/notebook/js/menubar.js | 2 +- IPython/html/static/services/contents.js | 6 +++--- IPython/html/static/tree/js/main.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index b96f18f33..0b54e9008 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -91,7 +91,7 @@ define([ // Create a new notebook in the same path as the current // notebook's path. var parent = utils.url_path_split(that.notebook.notebook_path)[0]; - that.contents.new(parent, { + that.contents.new_untitled(parent, { type: "notebook", extra_settings: {async: false}, // So we can open a new window afterwards success: function (data) { diff --git a/IPython/html/static/services/contents.js b/IPython/html/static/services/contents.js index 97e0839a4..481015c42 100644 --- a/IPython/html/static/services/contents.js +++ b/IPython/html/static/services/contents.js @@ -92,15 +92,15 @@ define([ /** - * Creates a new file at the specified directory path. + * Creates a new untitled file or directory in the specified directory path. * * @method new - * @param {String} path The path to create the new notebook at + * @param {String} path: the directory in which to create the new file/directory * @param {Object} options: * ext: file extension to use * type: model type to create ('notebook', 'file', or 'directory') */ - Contents.prototype.new = function(path, options) { + Contents.prototype.new_untitled = function(path, options) { var data = JSON.stringify({ ext: options.ext, type: options.type diff --git a/IPython/html/static/tree/js/main.js b/IPython/html/static/tree/js/main.js index ea820d492..25ce90510 100644 --- a/IPython/html/static/tree/js/main.js +++ b/IPython/html/static/tree/js/main.js @@ -64,7 +64,7 @@ require([ var login_widget = new loginwidget.LoginWidget('#login_widget', common_options); $('#new_notebook').click(function (e) { - contents.new(common_options.notebook_path, { + contents.new_untitled(common_options.notebook_path, { type: "notebook", extra_settings: {async: false}, // So we can open a new window afterwards success: function (data) {