##// END OF EJS Templates
Rename methods to remove _file suffix
Thomas Kluyver -
Show More
@@ -1918,7 +1918,7 b' define(['
1918 var start = new Date().getTime();
1918 var start = new Date().getTime();
1919
1919
1920 var that = this;
1920 var that = this;
1921 this.contents.save_file(this.notebook_path, this.notebook_name, model, {
1921 this.contents.save(this.notebook_path, this.notebook_name, model, {
1922 extra_settings: extra_settings,
1922 extra_settings: extra_settings,
1923 success: $.proxy(this.save_notebook_success, this, start),
1923 success: $.proxy(this.save_notebook_success, this, start),
1924 error: function (error) {
1924 error: function (error) {
@@ -2040,7 +2040,7 b' define(['
2040
2040
2041 Notebook.prototype.copy_notebook = function(){
2041 Notebook.prototype.copy_notebook = function(){
2042 var base_url = this.base_url;
2042 var base_url = this.base_url;
2043 this.contents.copy_file(this.notebook_path, null, this.notebook_name, {
2043 this.contents.copy(this.notebook_path, null, this.notebook_name, {
2044 // synchronous so we can open a new window on success
2044 // synchronous so we can open a new window on success
2045 extra_settings: {async: false},
2045 extra_settings: {async: false},
2046 success: function (data) {
2046 success: function (data) {
@@ -2058,8 +2058,8 b' define(['
2058 }
2058 }
2059
2059
2060 var that = this;
2060 var that = this;
2061 this.contents.rename_file(this.notebook_path, this.notebook_name,
2061 this.contents.rename(this.notebook_path, this.notebook_name,
2062 this.notebook_path, new_name, {
2062 this.notebook_path, new_name, {
2063 success: function (json) {
2063 success: function (json) {
2064 var name = that.notebook_name = json.name;
2064 var name = that.notebook_name = json.name;
2065 that.session.rename_notebook(name, json.path);
2065 that.session.rename_notebook(name, json.path);
@@ -2070,7 +2070,7 b' define(['
2070 };
2070 };
2071
2071
2072 Notebook.prototype.delete = function () {
2072 Notebook.prototype.delete = function () {
2073 this.contents.delete_file(this.notebook_name, this.notebook_path);
2073 this.contents.delete(this.notebook_name, this.notebook_path);
2074 };
2074 };
2075
2075
2076 Notebook.prototype.rename_error = function (error) {
2076 Notebook.prototype.rename_error = function (error) {
@@ -121,7 +121,7 b' define(['
121 $.ajax(this.api_url(path), settings);
121 $.ajax(this.api_url(path), settings);
122 };
122 };
123
123
124 Contents.prototype.delete_file = function(name, path, options) {
124 Contents.prototype.delete = function(name, path, options) {
125 var error_callback = options.error || function() {};
125 var error_callback = options.error || function() {};
126 var that = this;
126 var that = this;
127 var settings = {
127 var settings = {
@@ -142,7 +142,7 b' define(['
142 $.ajax(url, settings);
142 $.ajax(url, settings);
143 };
143 };
144
144
145 Contents.prototype.rename_file = function(path, name, new_path, new_name, options) {
145 Contents.prototype.rename = function(path, name, new_path, new_name, options) {
146 var data = {name: new_name, path: new_path};
146 var data = {name: new_name, path: new_path};
147 var settings = {
147 var settings = {
148 processData : false,
148 processData : false,
@@ -157,7 +157,7 b' define(['
157 $.ajax(url, settings);
157 $.ajax(url, settings);
158 };
158 };
159
159
160 Contents.prototype.save_file = function(path, name, model, options) {
160 Contents.prototype.save = function(path, name, model, options) {
161 // We do the call with settings so we can set cache to false.
161 // We do the call with settings so we can set cache to false.
162 var settings = {
162 var settings = {
163 processData : false,
163 processData : false,
@@ -174,7 +174,7 b' define(['
174 $.ajax(url, settings);
174 $.ajax(url, settings);
175 };
175 };
176
176
177 Contents.prototype.copy_file = function(to_path, to_name, from, options) {
177 Contents.prototype.copy = function(to_path, to_name, from, options) {
178 var url, method;
178 var url, method;
179 if (to_name) {
179 if (to_name) {
180 url = this.api_url(to_path, to_name);
180 url = this.api_url(to_path, to_name);
@@ -330,7 +330,7 b' define(['
330 Delete : {
330 Delete : {
331 class: "btn-danger",
331 class: "btn-danger",
332 click: function() {
332 click: function() {
333 notebooklist.contents.delete_file(name, path, {
333 notebooklist.contents.delete(name, path, {
334 success: function() {
334 success: function() {
335 notebooklist.notebook_deleted(path, name);
335 notebooklist.notebook_deleted(path, name);
336 }
336 }
General Comments 0
You need to be logged in to leave comments. Login now