@@ -26,7 +26,9 @@ var IPython = (function (IPython) {
2626 SaveWidget . prototype . style = function ( ) {
2727 this . element . find ( 'span#save_widget' ) . addClass ( 'ui-widget' ) ;
2828 this . element . find ( 'span#notebook_name' ) . addClass ( 'ui-widget' ) ;
29- this . element . find ( 'span#save_status' ) . addClass ( 'ui-widget' )
29+ this . element . find ( 'span#autosave_status' ) . addClass ( 'ui-widget' )
30+ . css ( { border : 'none' } ) ;
31+ this . element . find ( 'span#checkpoint_status' ) . addClass ( 'ui-widget' )
3032 . css ( { border : 'none' , 'margin-left' : '20px' } ) ;
3133 } ;
3234
@@ -54,6 +56,13 @@ var IPython = (function (IPython) {
5456 $ ( [ IPython . events ] ) . on ( 'notebook_save_failed.Notebook' , function ( ) {
5557 that . set_save_status ( 'Last Save Failed!' ) ;
5658 } ) ;
59+ $ ( [ IPython . events ] ) . on ( 'checkpoints_listed.Notebook' , function ( event , data ) {
60+ that . set_last_checkpoint ( data ) ;
61+ } ) ;
62+
63+ $ ( [ IPython . events ] ) . on ( 'checkpoint_created.Notebook' , function ( event , data ) {
64+ that . set_last_checkpoint ( data ) ;
65+ } ) ;
5766 } ;
5867
5968
@@ -121,13 +130,23 @@ var IPython = (function (IPython) {
121130
122131
123132 SaveWidget . prototype . set_save_status = function ( msg ) {
124- this . element . find ( 'span#save_status' ) . html ( msg ) ;
133+ this . element . find ( 'span#autosave_status' ) . html ( msg ) ;
134+ }
135+
136+ SaveWidget . prototype . set_checkpoint_status = function ( msg ) {
137+ this . element . find ( 'span#checkpoint_status' ) . html ( msg ) ;
125138 }
126139
140+ SaveWidget . prototype . set_last_checkpoint = function ( checkpoint ) {
141+ var d = new Date ( checkpoint . last_modified ) ;
142+ this . set_checkpoint_status (
143+ "Last Checkpoint: " + d . format ( 'mmm dd HH:MM' )
144+ ) ;
145+ }
127146
128147 SaveWidget . prototype . set_last_saved = function ( ) {
129148 var d = new Date ( ) ;
130- this . set_save_status ( 'Last saved : ' + d . format ( 'mmm dd HH:MM' ) ) ;
149+ this . set_save_status ( '(autosaved : ' + d . format ( 'mmm dd HH:MM' ) + ')' ) ;
131150 } ;
132151
133152
0 commit comments