diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 309506c4d..587087f6a 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -228,6 +228,11 @@ var IPython = (function (IPython) { }; + CodeCell.prototype.clear_input = function () { + this.code_mirror.setValue(''); + }; + + CodeCell.prototype.collapse = function () { this.element.find('div.output').hide(); }; diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js index 8c9a7a0a5..a3947474b 100644 --- a/IPython/frontend/html/notebook/static/js/notebook.js +++ b/IPython/frontend/html/notebook/static/js/notebook.js @@ -59,6 +59,10 @@ var IPython = (function (IPython) { } else if (event.which === 13 && event.shiftKey) { that.execute_selected_cell(true); return false; + } else if (event.which === 13 && event.ctrlKey) { + that.execute_selected_cell(false); + that.selected_cell().clear_input(); + return false; }; });