@ -191,6 +191,13 @@ define([
that . rename _error ( data [ 0 ] , data [ 1 ] , data [ 2 ] ) ;
} ) ;
this . content _manager . events . on ( 'notebook_save_success.ContentManager' ,
$ . proxy ( this . save _notebook _success , this ) ) ;
this . content _manager . events . on ( 'notebook_save_error.ContentManager' ,
$ . proxy ( this . events . trigger , this . events ,
'notebook_save_failed.Notebook' ) ) ;
this . events . on ( 'set_next_input.Notebook' , function ( event , data ) {
var index = that . find _cell _index ( data . cell ) ;
var new _cell = that . insert _cell _below ( 'code' , index ) ;
@ -1918,19 +1925,25 @@ define([
* @ method save _notebook
* /
Notebook . prototype . save _notebook = function ( extra _settings ) {
this . content _manager . save _notebook ( this , extra _settings ) ;
var content = $ . extend ( this . toJSON ( ) , {
nbformat : this . nbformat ,
nbformat _minor : this . nbformat _minor
} )
this . content _manager . save _notebook ( this . notebook _path ,
this . notebook _name ,
content ,
extra _settings ) ;
} ;
/ * *
* Success callback for saving a notebook .
*
* @ method save _notebook _success
* @ param { Integer } start the time when the save request started
* @ param { Object } data JSON representation of a notebook
* @ param { String } status Description of response status
* @ param { jqXHR } xhr jQuery Ajax object
* @ param { Event } event The save notebook success event
* @ param { Object } data dictionary of event data
* data . options start the time when the save request started
* /
Notebook . prototype . save _notebook _success = function ( start, data , status , xhr ) {
Notebook . prototype . save _notebook _success = function ( event, data ) {
this . set _dirty ( false ) ;
if ( data . message ) {
// save succeeded, but validation failed.
@ -1957,7 +1970,7 @@ define([
} ) ;
}
this . events . trigger ( 'notebook_saved.Notebook' ) ;
this . _update _autosave _interval ( start) ;
this . _update _autosave _interval ( event. start) ;
if ( this . _checkpoint _after _save ) {
this . create _checkpoint ( ) ;
this . _checkpoint _after _save = false ;