@ -1923,7 +1923,7 @@ define([
this . contents . save _file ( this . notebook _path , this . notebook _name , model , {
extra _settings : extra _settings ,
success : $ . proxy ( this . save _notebook _success , this , start ) ,
error : function ( xhr, status , error) {
error : function ( error) {
that . events . trigger ( 'notebook_save_failed.Notebook' ) ;
}
} ) ;
@ -1935,10 +1935,8 @@ define([
* @ method save _notebook _success
* @ param { Integer } start Time when the save request start
* @ param { Object } data JSON representation of a notebook
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* /
Notebook . prototype . save _notebook _success = function ( start , data , status , xhr ) {
Notebook . prototype . save _notebook _success = function ( start , data ) {
this . set _dirty ( false ) ;
if ( data . message ) {
// save succeeded, but validation failed.
@ -2078,7 +2076,7 @@ define([
var that = this ;
this . contents . rename _file ( this . notebook _path , this . notebook _name ,
this . notebook _path , new _name , {
success : function ( json , status , xhr ) {
success : function ( json ) {
var name = that . notebook _name = json . name ;
that . session . rename _notebook ( name , json . path ) ;
that . events . trigger ( 'notebook_renamed.Notebook' , json ) ;
@ -2091,12 +2089,12 @@ define([
this . contents . delete _file ( this . notebook _name , this . notebook _path ) ;
} ;
Notebook . prototype . rename _error = function ( xhr, status , error) {
Notebook . prototype . rename _error = function ( error) {
var that = this ;
var dialog _body = $ ( '<div/>' ) . append (
$ ( "<p/>" ) . text ( 'This notebook name already exists.' )
) ;
this . events . trigger ( 'notebook_rename_failed.Notebook' , [ xhr , status , error ] ) ;
this . events . trigger ( 'notebook_rename_failed.Notebook' , error ) ;
dialog . modal ( {
notebook : this ,
keyboard _manager : this . keyboard _manager ,
@ -2146,10 +2144,8 @@ define([
*
* @ method load _notebook _success
* @ param { Object } data JSON representation of a notebook
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* /
Notebook . prototype . load _notebook _success = function ( data , status , xhr ) {
Notebook . prototype . load _notebook _success = function ( data ) {
var failed ;
try {
this . fromJSON ( data ) ;
@ -2281,20 +2277,18 @@ define([
* Failure callback for loading a notebook from the server .
*
* @ method load _notebook _error
* @ param { jqXHR } xhr jQuery Ajax object
* @ param { String } status Description of response status
* @ param { String } error HTTP error message
* /
Notebook . prototype . load _notebook _error = function ( xhr , status , error ) {
this . events . trigger ( 'notebook_load_failed.Notebook' , [ xhr , status , error ] ) ;
utils . log _ajax _error ( xhr , status , error ) ;
var msg = $ ( "<div>" ) ;
if ( xhr . status === 400 ) {
msg . text ( utils . ajax _error _msg ( xhr ) ) ;
} else if ( xhr . status === 500 ) {
msg . text ( "An unknown error occurred while loading this notebook. " +
* @ param { Error } error
* /
Notebook . prototype . load _notebook _error = function ( error ) {
this . events . trigger ( 'notebook_load_failed.Notebook' , error ) ;
var msg ;
if ( error . name = utils . XHR _ERROR && error . xhr . status === 500 ) {
utils . log _ajax _error ( error . xhr , error . xhr _status , error . xhr _error ) ;
msg = "An unknown error occurred while loading this notebook. " +
"This version can load notebook formats " +
"v" + this . nbformat + " or earlier. See the server log for details." ) ;
"v" + this . nbformat + " or earlier. See the server log for details." ;
} else {
msg = error . message ;
}
dialog . modal ( {
notebook : this ,
@ -2350,7 +2344,7 @@ define([
var that = this ;
this . contents . list _checkpoints ( this . notebook _path , this . notebook _name , {
success : $ . proxy ( this . list _checkpoints _success , this ) ,
error : function ( xhr, status , error_msg ) {
error : function ( error) {
that . events . trigger ( 'list_checkpoints_failed.Notebook' ) ;
}
} ) ;
@ -2361,10 +2355,8 @@ define([
*
* @ method list _checkpoint _success
* @ param { Object } data JSON representation of a checkpoint
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* /
Notebook . prototype . list _checkpoints _success = function ( data , status , xhr ) {
Notebook . prototype . list _checkpoints _success = function ( data ) {
data = $ . parseJSON ( data ) ;
this . checkpoints = data ;
if ( data . length ) {
@ -2384,7 +2376,7 @@ define([
var that = this ;
this . contents . create _checkpoint ( this . notebook _path , this . notebook _name , {
success : $ . proxy ( this . create _checkpoint _success , this ) ,
error : function ( xhr, status , error_msg ) {
error : function ( error) {
that . events . trigger ( 'checkpoint_failed.Notebook' ) ;
}
} ) ;
@ -2395,10 +2387,8 @@ define([
*
* @ method create _checkpoint _success
* @ param { Object } data JSON representation of a checkpoint
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* /
Notebook . prototype . create _checkpoint _success = function ( data , status , xhr ) {
Notebook . prototype . create _checkpoint _success = function ( data ) {
data = $ . parseJSON ( data ) ;
this . add _checkpoint ( data ) ;
this . events . trigger ( 'checkpoint_created.Notebook' , data ) ;
@ -2457,7 +2447,7 @@ define([
this . contents . restore _checkpoint ( this . notebook _path , this . notebook _name ,
checkpoint , {
success : $ . proxy ( this . create _checkpoint _success , this ) ,
error : function ( xhr, status , error_msg ) {
error : function ( error) {
that . events . trigger ( 'checkpoint_restore_failed.Notebook' ) ;
}
} ) ;
@ -2467,11 +2457,8 @@ define([
* Success callback for restoring a notebook to a checkpoint .
*
* @ method restore _checkpoint _success
* @ param { Object } data ( ignored , should be empty )
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* /
Notebook . prototype . restore _checkpoint _success = function ( data , status , xhr ) {
Notebook . prototype . restore _checkpoint _success = function ( ) {
this . events . trigger ( 'checkpoint_restored.Notebook' ) ;
this . load _notebook ( this . notebook _name , this . notebook _path ) ;
} ;
@ -2488,8 +2475,8 @@ define([
this . contents . delete _checkpoint ( this . notebook _path , this . notebook _name ,
checkpoint , {
success : $ . proxy ( this . create _checkpoint _success , this ) ,
error : function ( xhr, status , error_msg ) {
that . events . trigger ( 'checkpoint_delete_failed.Notebook' , [ xhr , status , error ] ) ;
error : function ( error) {
that . events . trigger ( 'checkpoint_delete_failed.Notebook' , error ) ;
}
} ) ;
} ;
@ -2498,12 +2485,9 @@ define([
* Success callback for deleting a notebook checkpoint
*
* @ method delete _checkpoint _success
* @ param { Object } data ( ignored , should be empty )
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* /
Notebook . prototype . delete _checkpoint _success = function ( data , status , xhr ) {
this . events . trigger ( 'checkpoint_deleted.Notebook' , data );
Notebook . prototype . delete _checkpoint _success = function ( ) {
this . events . trigger ( 'checkpoint_deleted.Notebook' ) ;
this . load _notebook ( this . notebook _name , this . notebook _path ) ;
} ;