diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index 825b8642d8..32a033c199 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -336,6 +336,16 @@ define([ env.notebook.select(index); } }, + 'mute-cell' : { + handler : function (env) { + env.notebook.mute_cell(); + } + }, + 'unmute-cell' : { + handler : function (env) { + env.notebook.unmute_cell(); + } + }, 'copy-cell' : { cmd: i18n.msg._('copy selected cells'), help: i18n.msg._('copy selected cells'), diff --git a/notebook/static/notebook/js/menubar.js b/notebook/static/notebook/js/menubar.js index aab86f79f5..2a1ac3b9d5 100644 --- a/notebook/static/notebook/js/menubar.js +++ b/notebook/static/notebook/js/menubar.js @@ -271,6 +271,8 @@ define([ '#insert_image': 'insert-image', '#keyboard_shortcuts' : 'show-keyboard-shortcuts', '#edit_keyboard_shortcuts' : 'edit-command-mode-keyboard-shortcuts', + '#mute_cell' : 'mute-cell', + '#unmute_cell' : 'unmute-cell', }; for(var idx in id_actions_dict){ diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 606851b965..333fcf0384 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -151,6 +151,7 @@ define([ this.trusted = null; this._changed_on_disk_dialog = null; this._fully_loaded = false; + this.mutedCells = []; // Trigger cell toolbar registration. default_celltoolbar.register(this); @@ -1639,6 +1640,30 @@ define([ this.delete_cell(); }; + /** + * Mute a cell + */ + Notebook.prototype.mute_cell = function () { + var cells = this.get_selected_cells_indices(); + this.mutedCells.push(cells.tabindex); + }; + + /** + * Unmute a cell + */ + Notebook.prototype.unmute_cell = function () { + var cells = this.get_selected_cells_indices(); + //console.log("muted cell == " + JSON.stringify(cells)); + for (var i = 0;j
  • {% trans %}Cut Cells{% endtrans %}
  • {% trans %}Copy Cells{% endtrans %}
  • +
  • {% trans %} Mute Cells {% endtrans }
  • +
  • {% trans %} Unmute Cells {% endtrans }
  • {% trans %}Paste Cells Above{% endtrans %}
  • {% trans %}Paste Cells Below{% endtrans %}
  • {% trans %}Paste Cells & Replace{% endtrans %}