Skip to content

Commit

Permalink
Added missing hide code toolbar button. Removed .pyc files and hide_c…
Browse files Browse the repository at this point in the history
…ode.py from project root directory.
  • Loading branch information
kirbs- committed Sep 20, 2015
1 parent c0e46a4 commit 6547ca7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 37 deletions.
37 changes: 0 additions & 37 deletions hide_code.py

This file was deleted.

Binary file removed hide_code/__init__.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions hide_code/hide_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@ function ($, celltoolbar){
}
}

/**
* Add a toolbar button to toggle visibility of all code cells, input/output prompts, and remove any highlighting for the selected cell.
**/
function addHideCodeButtonToToolbar(){
IPython.toolbar.add_buttons_group([
{
'label' : 'Hide/show code',
'icon' : 'fa-code',
'callback' : function() {
$('.input').toggle();
$('.prompt').toggle();
$('.ctb_show').toggle();
$('.selected').removeClass('selected').addClass('unselected');
}
}
]);
}

var hideCodeCallback = ctb.utils.checkbox_ui_generator( 'Hide Code ', hideCodeSetter, hideCodeGetter);

var hidePromptCallback = ctb.utils.checkbox_ui_generator('Hide Prompts ', hidePromptSetter, hidePromptGetter);
Expand All @@ -67,6 +85,7 @@ function ($, celltoolbar){
ctb.register_callback('hide_code.hideCode', hideCodeCallback);
ctb.register_callback('hide_code.hidePrompts', hidePromptCallback);
ctb.register_preset('Hide',['hide_code.hidePrompts','hide_code.hideCode']);
addHideCodeButtonToToolbar();
}

setup();
Expand Down
Binary file removed hide_code/hide_code.pyc
Binary file not shown.

0 comments on commit 6547ca7

Please sign in to comment.