From b1ac6f2591cc63e817eabdae792161b75f91fa82 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Wed, 9 Dec 2015 11:17:34 -0800 Subject: [PATCH] Deprecate move cell up/down --- notebook/static/notebook/js/notebook.js | 6 ++++++ notebook/static/notebook/js/notificationarea.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 14c8b42aa..6125d1890 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -846,6 +846,9 @@ define(function (require) { * @return {Notebook} This notebook */ Notebook.prototype.move_cell_up = function (index) { + console.warn('Notebook.move_cell_up is deprecated'); + this.events.trigger('deprecated.Notebook', 'Move cell up is deprecated'); + var i = this.index_or_selected(index); if (this.is_valid_cell_index(i) && i > 0) { var pivot = this.get_cell_element(i-1); @@ -870,6 +873,9 @@ define(function (require) { * @return {Notebook} This notebook */ Notebook.prototype.move_cell_down = function (index) { + console.warn('Notebook.move_cell_down is deprecated'); + this.events.trigger('deprecated.Notebook', 'Move cell down is deprecated'); + var i = this.index_or_selected(index); if (this.is_valid_cell_index(i) && this.is_valid_cell_index(i+1)) { var pivot = this.get_cell_element(i+1); diff --git a/notebook/static/notebook/js/notificationarea.js b/notebook/static/notebook/js/notificationarea.js index 8f010c9e5..b3feeaaf7 100644 --- a/notebook/static/notebook/js/notificationarea.js +++ b/notebook/static/notebook/js/notificationarea.js @@ -305,6 +305,9 @@ define([ this.events.on('notebook_copy_failed.Notebook', function (evt, error) { nnw.warning(error.message || "Notebook copy failed"); }); + this.events.on('deprecated.Notebook', function (evt, message) { + nnw.warning(message, 2000); + }); // Checkpoint events this.events.on('checkpoint_created.Notebook', function (evt, data) {