Files
jupyter_contrib_nbextensions/usability/hide_input_all.js
T
juhasch 217e59e69d Update copyright notice
Remove IPython Development Team copyright notice
2014-06-12 17:56:13 +02:00

33 lines
849 B
JavaScript

// toggle display of all code cells
"using strict";
var toggle_codecells_extension = (function() {
var show=true;
function toggle(){
if (show){
$('div.input').hide();
IPython.notebook.metadata.hide_input = true;
}else{
$('div.input').show();
IPython.notebook.metadata.hide_input = false;
}
show = !show;
}
/**
* Add run control buttons to toolbar and initialize codecells
*
*/
IPython.toolbar.add_buttons_group([
{
id : 'toggle_codecells',
label : 'Toggle codecell display',
icon : 'icon-list-alt',
callback : toggle
}
]);
if (IPython.notebook.metadata.hide_input == true) toggle();
})();