diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js
index a080fa12d..a65be89b0 100644
--- a/IPython/frontend/html/notebook/static/js/notebook.js
+++ b/IPython/frontend/html/notebook/static/js/notebook.js
@@ -973,15 +973,12 @@ var IPython = (function (IPython) {
Notebook.prototype.notebook_saved = function (data, status, xhr) {
this.dirty = false;
IPython.save_widget.notebook_saved();
- IPython.save_widget.status_save();
+ IPython.save_widget.status_last_saved();
};
Notebook.prototype.notebook_save_failed = function (xhr, status, error_msg) {
- // Notify the user and reset the save button
- // TODO: Handle different types of errors (timeout etc.)
- alert('An unexpected error occured while saving the notebook.');
- IPython.save_widget.reset_status();
+ IPython.save_widget.status_save_failed();
};
@@ -1013,7 +1010,7 @@ var IPython = (function (IPython) {
if (this.ncells() === 0) {
this.insert_code_cell_below();
};
- IPython.save_widget.status_save();
+ IPython.save_widget.status_last_saved();
IPython.save_widget.set_notebook_name(data.metadata.name);
this.dirty = false;
if (! this.read_only) {
diff --git a/IPython/frontend/html/notebook/static/js/savewidget.js b/IPython/frontend/html/notebook/static/js/savewidget.js
index 7f8d5322b..9688a31de 100644
--- a/IPython/frontend/html/notebook/static/js/savewidget.js
+++ b/IPython/frontend/html/notebook/static/js/savewidget.js
@@ -28,6 +28,8 @@ var IPython = (function (IPython) {
SaveWidget.prototype.style = function () {
this.element.find('span#save_widget').addClass('ui-widget');
this.element.find('span#notebook_name').addClass('ui-widget ui-widget-content');
+ this.element.find('span#save_status').addClass('ui-widget ui-widget-content')
+ .css({border: 'none', 'margin-left': '20px'});
};
@@ -137,24 +139,34 @@ var IPython = (function (IPython) {
};
+ SaveWidget.prototype.set_last_saved = function () {
+ var d = new Date();
+ $('#save_status').html('Last saved: '+d.format('mmm dd h:MM TT'));
+
+ };
+
SaveWidget.prototype.reset_status = function () {
- this.is_renaming();
+ this.element.find('span#save_status').html('');
};
- SaveWidget.prototype.status_save = function () {
+ SaveWidget.prototype.status_last_saved = function () {
+ this.set_last_saved();
};
SaveWidget.prototype.status_saving = function () {
+ this.element.find('span#save_status').html('Saving...');
};
- SaveWidget.prototype.status_loading = function () {
+ SaveWidget.prototype.status_save_failed = function () {
+ this.element.find('span#save_status').html('Save failed');
};
- SaveWidget.prototype.status_rename = function () {
+ SaveWidget.prototype.status_loading = function () {
+ this.element.find('span#save_status').html('Loading...');
};
diff --git a/IPython/frontend/html/notebook/templates/notebook.html b/IPython/frontend/html/notebook/templates/notebook.html
index 161945cd1..f51ecece3 100644
--- a/IPython/frontend/html/notebook/templates/notebook.html
+++ b/IPython/frontend/html/notebook/templates/notebook.html
@@ -45,6 +45,7 @@

+
@@ -159,6 +160,7 @@
+