##// END OF EJS Templates
Notify the user of errors when saving a notebook.
Felix Werner -
Show More
@@ -871,7 +871,8 b' var IPython = (function (IPython) {'
871 type : "PUT",
871 type : "PUT",
872 data : JSON.stringify(data),
872 data : JSON.stringify(data),
873 headers : {'Content-Type': 'application/json'},
873 headers : {'Content-Type': 'application/json'},
874 success : $.proxy(this.notebook_saved,this)
874 success : $.proxy(this.notebook_saved,this),
875 error : $.proxy(this.notebook_save_failed,this)
875 };
876 };
876 IPython.save_widget.status_saving();
877 IPython.save_widget.status_saving();
877 $.ajax("/notebooks/" + notebook_id, settings);
878 $.ajax("/notebooks/" + notebook_id, settings);
@@ -886,6 +887,14 b' var IPython = (function (IPython) {'
886 }
887 }
887
888
888
889
890 Notebook.prototype.notebook_save_failed = function (xhr, status, error_msg) {
891 // Notify the user and reset the save button
892 // TODO: Handle different types of errors (timeout etc.)
893 alert('An unexpected error occured while saving the notebook.');
894 setTimeout($.proxy(IPython.save_widget.reset_status,IPython.save_widget),500);
895 }
896
897
889 Notebook.prototype.load_notebook = function (callback) {
898 Notebook.prototype.load_notebook = function (callback) {
890 var that = this;
899 var that = this;
891 var notebook_id = IPython.save_widget.get_notebook_id();
900 var notebook_id = IPython.save_widget.get_notebook_id();
@@ -115,6 +115,11 b' var IPython = (function (IPython) {'
115 };
115 };
116
116
117
117
118 SaveWidget.prototype.reset_status = function () {
119 this.is_renaming();
120 };
121
122
118 SaveWidget.prototype.status_save = function () {
123 SaveWidget.prototype.status_save = function () {
119 this.element.find('button#save_notebook').button('option', 'label', '<u>S</u>ave');
124 this.element.find('button#save_notebook').button('option', 'label', '<u>S</u>ave');
120 this.element.find('button#save_notebook').button('enable');
125 this.element.find('button#save_notebook').button('enable');
General Comments 0
You need to be logged in to leave comments. Login now