diff --git a/IPython/html/static/notebook/js/keyboardmanager.js b/IPython/html/static/notebook/js/keyboardmanager.js index 42db5eb..1e6a50c 100644 --- a/IPython/html/static/notebook/js/keyboardmanager.js +++ b/IPython/html/static/notebook/js/keyboardmanager.js @@ -451,7 +451,7 @@ var IPython = (function (IPython) { } }, 'shift+o' : { - help : 'toggle output scroll', + help : 'toggle output scrolling', help_index : 'gc', handler : function (event) { IPython.notebook.toggle_output_scroll(); diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index eecbf56..622d76e 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -246,30 +246,27 @@ var IPython = (function (IPython) { this.element.find('#to_heading6').click(function () { IPython.notebook.to_heading(undefined, 6); }); - this.element.find('#collapse_current_output').click(function () { - IPython.notebook.collapse_output(); - }); - this.element.find('#scroll_current_output').click(function () { - IPython.notebook.scroll_output(); + + this.element.find('#toggle_current_output').click(function () { + IPython.notebook.toggle_output(); }); - this.element.find('#expand_current_output').click(function () { - IPython.notebook.expand_output(); + this.element.find('#toggle_current_output_scroll').click(function () { + IPython.notebook.toggle_output_scroll(); }); this.element.find('#clear_current_output').click(function () { IPython.notebook.clear_output(); }); - this.element.find('#collapse_all_output').click(function () { - IPython.notebook.collapse_all_output(); - }); - this.element.find('#scroll_all_output').click(function () { - IPython.notebook.scroll_all_output(); + + this.element.find('#toggle_all_output').click(function () { + IPython.notebook.toggle_all_output(); }); - this.element.find('#expand_all_output').click(function () { - IPython.notebook.expand_all_output(); + this.element.find('#toggle_all_output_scroll').click(function () { + IPython.notebook.toggle_all_output_scroll(); }); this.element.find('#clear_all_output').click(function () { IPython.notebook.clear_all_output(); }); + // Kernel this.element.find('#int_kernel').click(function () { IPython.notebook.session.interrupt_kernel(); diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index a0d304f..61c80e9 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -1296,6 +1296,21 @@ var IPython = (function (IPython) { }; /** + * Hide/show the output of all cells. + * + * @method toggle_all_output + */ + Notebook.prototype.toggle_all_output = function () { + $.map(this.get_cells(), function (cell, i) { + if (cell instanceof IPython.CodeCell) { + cell.toggle_output(); + } + }); + // this should not be set if the `collapse` key is removed from nbformat + this.set_dirty(true); + }; + + /** * Toggle a scrollbar for long cell outputs. * * @method toggle_output_scroll @@ -1310,6 +1325,20 @@ var IPython = (function (IPython) { } }; + /** + * Toggle the scrolling of long output on all cells. + * + * @method toggle_all_output_scrolling + */ + Notebook.prototype.toggle_all_output_scroll = function () { + $.map(this.get_cells(), function (cell, i) { + if (cell instanceof IPython.CodeCell) { + cell.toggle_output_scroll(); + } + }); + // this should not be set if the `collapse` key is removed from nbformat + this.set_dirty(true); + }; // Other cell functions: line numbers, ... diff --git a/IPython/html/templates/notebook.html b/IPython/html/templates/notebook.html index eb72cab..602ce2f 100644 --- a/IPython/html/templates/notebook.html +++ b/IPython/html/templates/notebook.html @@ -172,24 +172,34 @@ class="notebook_app"