mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Rename methods to remove _file suffix
This commit is contained in:
parent
5279418acf
commit
a4f869aa8b
@ -1918,7 +1918,7 @@ define([
|
||||
var start = new Date().getTime();
|
||||
|
||||
var that = this;
|
||||
this.contents.save_file(this.notebook_path, this.notebook_name, model, {
|
||||
this.contents.save(this.notebook_path, this.notebook_name, model, {
|
||||
extra_settings: extra_settings,
|
||||
success: $.proxy(this.save_notebook_success, this, start),
|
||||
error: function (error) {
|
||||
@ -2040,7 +2040,7 @@ define([
|
||||
|
||||
Notebook.prototype.copy_notebook = function(){
|
||||
var base_url = this.base_url;
|
||||
this.contents.copy_file(this.notebook_path, null, this.notebook_name, {
|
||||
this.contents.copy(this.notebook_path, null, this.notebook_name, {
|
||||
// synchronous so we can open a new window on success
|
||||
extra_settings: {async: false},
|
||||
success: function (data) {
|
||||
@ -2058,8 +2058,8 @@ define([
|
||||
}
|
||||
|
||||
var that = this;
|
||||
this.contents.rename_file(this.notebook_path, this.notebook_name,
|
||||
this.notebook_path, new_name, {
|
||||
this.contents.rename(this.notebook_path, this.notebook_name,
|
||||
this.notebook_path, new_name, {
|
||||
success: function (json) {
|
||||
var name = that.notebook_name = json.name;
|
||||
that.session.rename_notebook(name, json.path);
|
||||
@ -2070,7 +2070,7 @@ define([
|
||||
};
|
||||
|
||||
Notebook.prototype.delete = function () {
|
||||
this.contents.delete_file(this.notebook_name, this.notebook_path);
|
||||
this.contents.delete(this.notebook_name, this.notebook_path);
|
||||
};
|
||||
|
||||
Notebook.prototype.rename_error = function (error) {
|
||||
|
@ -121,7 +121,7 @@ define([
|
||||
$.ajax(this.api_url(path), settings);
|
||||
};
|
||||
|
||||
Contents.prototype.delete_file = function(name, path, options) {
|
||||
Contents.prototype.delete = function(name, path, options) {
|
||||
var error_callback = options.error || function() {};
|
||||
var that = this;
|
||||
var settings = {
|
||||
@ -142,7 +142,7 @@ define([
|
||||
$.ajax(url, settings);
|
||||
};
|
||||
|
||||
Contents.prototype.rename_file = function(path, name, new_path, new_name, options) {
|
||||
Contents.prototype.rename = function(path, name, new_path, new_name, options) {
|
||||
var data = {name: new_name, path: new_path};
|
||||
var settings = {
|
||||
processData : false,
|
||||
@ -157,7 +157,7 @@ define([
|
||||
$.ajax(url, settings);
|
||||
};
|
||||
|
||||
Contents.prototype.save_file = function(path, name, model, options) {
|
||||
Contents.prototype.save = function(path, name, model, options) {
|
||||
// We do the call with settings so we can set cache to false.
|
||||
var settings = {
|
||||
processData : false,
|
||||
@ -174,7 +174,7 @@ define([
|
||||
$.ajax(url, settings);
|
||||
};
|
||||
|
||||
Contents.prototype.copy_file = function(to_path, to_name, from, options) {
|
||||
Contents.prototype.copy = function(to_path, to_name, from, options) {
|
||||
var url, method;
|
||||
if (to_name) {
|
||||
url = this.api_url(to_path, to_name);
|
||||
|
@ -330,7 +330,7 @@ define([
|
||||
Delete : {
|
||||
class: "btn-danger",
|
||||
click: function() {
|
||||
notebooklist.contents.delete_file(name, path, {
|
||||
notebooklist.contents.delete(name, path, {
|
||||
success: function() {
|
||||
notebooklist.notebook_deleted(path, name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user