diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index 6be9966..8e14bc2 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -91,14 +91,14 @@ define([ // notebook's path. that.contents.new_notebook(that.notebook.notebook_path, { - success_callback: function (data, status, xhr) { + success: function (data, status, xhr) { window.open( utils.url_join_encode( that.base_url, 'notebooks', data.path, data.name ), '_blank'); }, - error_callback: function(xhr, status, error) { + error: function(xhr, status, error) { var msg; if (xhr.responseJSON && xhr.responseJSON.message) { msg = xhr.responseJSON.message; diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 9527f89..8a774f5 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -1922,8 +1922,8 @@ define([ var that = this; this.contents.save_file(this.notebook_path, this.notebook_name, model, { extra_settings: extra_settings, - success_callback: $.proxy(this.save_notebook_success, this, start), - error_callback: function (xhr, status, error) { + success: $.proxy(this.save_notebook_success, this, start), + error: function (xhr, status, error) { that.events.trigger('notebook_save_failed.Notebook'); } }); @@ -2078,12 +2078,12 @@ define([ var that = this; this.contents.rename_file(this.notebook_path, this.notebook_name, this.notebook_path, new_name, { - success_callback: function (json, status, xhr) { + success: function (json, status, xhr) { var name = that.notebook_name = json.name; that.session.rename_notebook(name, json.path); that.events.trigger('notebook_renamed.Notebook', json); }, - error_callback: $.proxy(this.rename_error, this) + error: $.proxy(this.rename_error, this) }); }; @@ -2134,8 +2134,8 @@ define([ this.notebook_path = notebook_path; this.events.trigger('notebook_loading.Notebook'); this.contents.load_file(notebook_path, notebook_name, { - success_callback: $.proxy(this.load_notebook_success, this), - error_callback: $.proxy(this.load_notebook_error, this) + success: $.proxy(this.load_notebook_success, this), + error: $.proxy(this.load_notebook_error, this) }); }; @@ -2349,8 +2349,8 @@ define([ Notebook.prototype.list_checkpoints = function () { var that = this; this.contents.list_checkpoints(this.notebook_path, this.notebook_name, { - success_callback: $.proxy(this.list_checkpoints_success, this), - error_callback: function(xhr, status, error_msg) { + success: $.proxy(this.list_checkpoints_success, this), + error: function(xhr, status, error_msg) { that.events.trigger('list_checkpoints_failed.Notebook'); } }); @@ -2383,8 +2383,8 @@ define([ Notebook.prototype.create_checkpoint = function () { var that = this; this.contents.create_checkpoint(this.notebook_path, this.notebook_name, { - success_callback: $.proxy(this.create_checkpoint_success, this), - error_callback: function (xhr, status, error_msg) { + success: $.proxy(this.create_checkpoint_success, this), + error: function (xhr, status, error_msg) { that.events.trigger('checkpoint_failed.Notebook'); } }); @@ -2456,8 +2456,8 @@ define([ var that = this; this.contents.restore_checkpoint(this.notebook_path, this.notebook_name, checkpoint, { - success_callback: $.proxy(this.create_checkpoint_success, this), - error_callback: function (xhr, status, error_msg) { + success: $.proxy(this.create_checkpoint_success, this), + error: function (xhr, status, error_msg) { that.events.trigger('checkpoint_restore_failed.Notebook'); } }); @@ -2487,8 +2487,8 @@ define([ var that = this; this.contents.delete_checkpoint(this.notebook_path, this.notebook_name, checkpoint, { - success_callback: $.proxy(this.create_checkpoint_success, this), - error_callback: function (xhr, status, error_msg) { + success: $.proxy(this.create_checkpoint_success, this), + error: function (xhr, status, error_msg) { that.events.trigger('checkpoint_delete_failed.Notebook', [xhr, status, error]); } }); diff --git a/IPython/html/static/services/contents.js b/IPython/html/static/services/contents.js index d953572..7dda2a3 100644 --- a/IPython/html/static/services/contents.js +++ b/IPython/html/static/services/contents.js @@ -34,13 +34,13 @@ define([ /** * Load a file. * - * Calls success_callback with file JSON model, or error_callback with error. + * Calls success with file JSON model, or error with error. * * @method load_notebook * @param {String} path * @param {String} name - * @param {Function} success_callback - * @param {Function} error_callback + * @param {Function} success + * @param {Function} error */ Contents.prototype.load_file = function (path, name, options) { // We do the call with settings so we can set cache to false. @@ -49,8 +49,8 @@ define([ cache : false, type : "GET", dataType : "json", - success : options.success_callback, - error : options.error_callback || function() {} + success : options.success, + error : options.error || function() {} }; var url = this.api_url(path, name); $.ajax(url, settings); @@ -64,30 +64,30 @@ define([ * @param {String} path The path to create the new notebook at */ Contents.prototype.new_notebook = function(path, options) { - var error_callback = options.error_callback || function() {}; + var error = options.error || function() {}; var settings = { processData : false, cache : false, type : "POST", dataType : "json", - success : options.success_callback || function() {}, - error : options.error_callback || function() {} + success : options.success || function() {}, + error : options.error || function() {} }; $.ajax(this.api_url(path), settings); }; Contents.prototype.delete_file = function(name, path, options) { - var error_callback = options.error_callback || function() {}; + var error = options.error || function() {}; var that = this; var settings = { processData : false, cache : false, type : "DELETE", dataType : "json", - success : options.success_callback || function() {}, + success : options.success || function() {}, error : function(xhr, status, error) { utils.log_ajax_error(xhr, status, error); - error_callback(xhr, status, error); + error(xhr, status, error); } }; var url = this.api_url(path, name); @@ -103,8 +103,8 @@ define([ data : JSON.stringify(data), dataType: "json", contentType: 'application/json', - success : options.success_callback || function() {}, - error : options.error_callback || function() {} + success : options.success || function() {}, + error : options.error || function() {} }; var url = this.api_url(path, name); $.ajax(url, settings); @@ -118,8 +118,8 @@ define([ type : "PUT", data : JSON.stringify(model), contentType: 'application/json', - success : options.success_callback || function() {}, - error : options.error_callback || function() {} + success : options.success || function() {}, + error : options.error || function() {} }; if (options.extra_settings) { $.extend(settings, options.extra_settings); @@ -136,8 +136,8 @@ define([ var url = this.api_url(path, name, 'checkpoints'); var settings = { type : "POST", - success: options.success_callback || function() {}, - error: options.error_callback || function() {} + success: options.success || function() {}, + error: options.error || function() {} }; $.ajax(url, settings); }; @@ -146,8 +146,8 @@ define([ var url = this.api_url(path, name, 'checkpoints'); var settings = { type : "GET", - success: options.success_callback, - error: options.error_callback || function() {} + success: options.success, + error: options.error || function() {} }; $.ajax(url, settings); }; @@ -156,8 +156,8 @@ define([ var url = this.api_url(path, name, 'checkpoints', checkpoint_id); var settings = { type : "POST", - success: options.success_callback || function() {}, - error: options.error_callback || function() {} + success: options.success || function() {}, + error: options.error || function() {} }; $.ajax(url, settings); }; @@ -166,8 +166,8 @@ define([ var url = this.api_url(path, name, 'checkpoints', checkpoint_id); var settings = { type : "DELETE", - success: options.success_callback || function() {}, - error: options.error_callback || function() {} + success: options.success || function() {}, + error: options.error || function() {} }; $.ajax(url, settings); }; @@ -190,7 +190,7 @@ define([ * @method list_notebooks * @param {String} path The path to list notebooks in * @param {Function} load_callback called with list of notebooks on success - * @param {Function} error_callback called with ajax results on error + * @param {Function} error called with ajax results on error */ Contents.prototype.list_contents = function(path, options) { var settings = { @@ -198,8 +198,8 @@ define([ cache : false, type : "GET", dataType : "json", - success : options.success_callback, - error : options.error_callback || function() {} + success : options.success, + error : options.error || function() {} }; $.ajax(this.api_url(path), settings); diff --git a/IPython/html/static/tree/js/main.js b/IPython/html/static/tree/js/main.js index 8244a1e..777f271 100644 --- a/IPython/html/static/tree/js/main.js +++ b/IPython/html/static/tree/js/main.js @@ -62,14 +62,14 @@ require([ $('#new_notebook').button().click(function (e) { contents.new_notebook(common_options.notebook_path, { - success_callback: function (data, status, xhr) { + success: function (data, status, xhr) { window.open( utils.url_join_encode( common_options.base_url, 'notebooks', data.path, data.name ), '_blank'); }, - error_callback: function(xhr, status, error) { + error: function(xhr, status, error) { var msg; if (xhr.responseJSON && xhr.responseJSON.message) { msg = xhr.responseJSON.message; diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 115bd84..2b5fba4 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -143,8 +143,8 @@ define([ NotebookList.prototype.load_list = function () { var that = this this.contents.list_contents(that.notebook_path, { - success_callback: $.proxy(this.draw_notebook_list, this), - error_callback: function(xhr, status, error) { + success: $.proxy(this.draw_notebook_list, this), + error: function(xhr, status, error) { utils.log_ajax_error(xhr, status, error); that.draw_notebook_list([], "Error connecting to server."); } @@ -332,7 +332,7 @@ define([ class: "btn-danger", click: function() { notebooklist.contents.delete_file(nbname, path, { - success_callback: function() { + success: function() { notebooklist.notebook_deleted(path, nbname); } });