Simplified Cell menu items related to output.

Brian E. Granger 12 years ago
parent 9538fb7d8f
commit 7c65e96941

@ -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();

@ -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();

@ -1295,6 +1295,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.
*
@ -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, ...

@ -172,24 +172,34 @@ class="notebook_app"
<li class="divider"></li>
<li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a>
<ul class="dropdown-menu">
<li id="collapse_current_output"><a href="#">Collapse</a></li>
<li id="expand_current_output"><a href="#">Expand</a></li>
<li id="toggle_current_output"
title="Hide/Show the output of the current cell">
<a href="#">Toggle</a>
</li>
<li id="toggle_current_output_scroll"
title="Scroll the output of the current cell">
<a href="#">Toggle Scrolling</a>
</li>
<li id="clear_current_output"
title="Clear the output portion of the current cell">
title="Clear the output of the current cell">
<a href="#">Clear</a>
</li>
<li id="scroll_current_output"><a href="#">Scroll Long</a></li>
</ul>
</li>
<li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a>
<ul class="dropdown-menu">
<li id="collapse_all_output"><a href="#">Collapse</a></li>
<li id="expand_all_output"><a href="#">Expand</a></li>
<li id="toggle_all_output"
title="Hide/Show the output of all cells">
<a href="#">Toggle</a>
</li>
<li id="toggle_all_output_scroll"
title="Scroll the output of all cells">
<a href="#">Toggle Scrolling</a>
</li>
<li id="clear_all_output"
title="Clear the output portion of all Code cells">
title="Clear the output of all cells">
<a href="#">Clear</a>
</li>
<li id="scroll_all_output"><a href="#">Scroll Long</a></li>
</ul>
</li>
</ul>

Loading…
Cancel
Save