contents.new_untitled to match Python API

Min RK 11 years ago
parent da832ef59f
commit 3870a30ce4

@ -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) {

@ -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

@ -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) {

Loading…
Cancel
Save