From 16b9150151ed50078742e20bd9ee28952a561aa3 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Fri, 21 Nov 2014 12:03:18 -0500 Subject: [PATCH 1/2] DEV: Add various events. --- IPython/html/static/notebook/js/codecell.js | 1 + IPython/html/static/tree/js/notebooklist.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js index 7d06188a2..37931bc87 100644 --- a/IPython/html/static/notebook/js/codecell.js +++ b/IPython/html/static/notebook/js/codecell.js @@ -338,6 +338,7 @@ define([ } CodeCell.msg_cells[this.last_msg_id] = this; this.render(); + this.events.trigger('execute.CodeCell'); }; /** diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 0447e615f..c1f6cfd9e 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -6,7 +6,8 @@ define([ 'jquery', 'base/js/utils', 'base/js/dialog', -], function(IPython, $, utils, dialog) { + 'base/js/events', +], function(IPython, $, utils, dialog, events) { "use strict"; var NotebookList = function (selector, options) { @@ -187,6 +188,8 @@ define([ item = this.new_item(i+offset); this.add_link(model, item); } + // Trigger an event when we've finished drawing the notebook list. + events.trigger('draw_notebook_list.NotebookList'); }; @@ -380,6 +383,7 @@ define([ var element = $(this); if (element.data("path") == path) { element.remove(); + events.trigger('notebook_deleted.NotebookList'); } }); }; From 4ed34d4f9d81909e2eca8bb740ef9fb5c288a8bd Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Sun, 23 Nov 2014 20:59:22 -0500 Subject: [PATCH 2/2] DEV: Pass current cell to the execute cell event. --- IPython/html/static/notebook/js/codecell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js index 37931bc87..df8ec2625 100644 --- a/IPython/html/static/notebook/js/codecell.js +++ b/IPython/html/static/notebook/js/codecell.js @@ -338,7 +338,7 @@ define([ } CodeCell.msg_cells[this.last_msg_id] = this; this.render(); - this.events.trigger('execute.CodeCell'); + this.events.trigger('execute.CodeCell', {cell: this}); }; /**