From cdd2ae7cc6f92c48759419e1ef8055be92072e99 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Tue, 17 Nov 2015 11:25:08 -0800 Subject: [PATCH] Add debug statements for #484 --- notebook/static/notebook/js/notebook.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 54a889b61..1844ce6c8 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -58,6 +58,8 @@ define(function (require) { this.ws_url = options.ws_url; this._session_starting = false; this.last_modified = null; + // debug 484 + this._last_modified = 'init'; // Create default scroll manager. this.scroll_manager = new scrollmanager.ScrollManager(this); @@ -2320,6 +2322,8 @@ define(function (require) { function (data) { var last_modified = new Date(data.last_modified); if (last_modified > that.last_modified) { + console.warn("Last saving was done on `"+that.last_modified+"`("+that._last_modified+"), "+ + "while the current file seem to have been saved on `"+data.last_modified+"`") dialog.modal({ notebook: that, keyboard_manager: that.keyboard_manager, @@ -2365,6 +2369,8 @@ define(function (require) { Notebook.prototype.save_notebook_success = function (start, data) { this.set_dirty(false); this.last_modified = new Date(data.last_modified); + // debug 484 + this._last_modified = 'save-success:'+data.last_modified; if (data.message) { // save succeeded, but validation failed. var body = $("
"); @@ -2513,6 +2519,8 @@ define(function (require) { that.notebook_name = json.name; that.notebook_path = json.path; that.last_modified = new Date(json.last_modified); + // debug 484 + _that.last_modified = json.last_modified; that.session.rename_notebook(json.path); that.events.trigger('notebook_renamed.Notebook', json); } @@ -2610,6 +2618,8 @@ define(function (require) { this.scroll_to_top(); this.writable = data.writable || false; this.last_modified = new Date(data.last_modified); + // debug 484 + this._last_modified = 'load-success:'+data.last_modified var nbmodel = data.content; var orig_nbformat = nbmodel.metadata.orig_nbformat; var orig_nbformat_minor = nbmodel.metadata.orig_nbformat_minor;