Skip to content

Commit

Permalink
[skip-traceback] make copy-buttons optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jcb91 committed Apr 11, 2017
1 parent 1a38ab9 commit 3eead7b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ define([
use_toolbar_button: false,
button_icon: 'fa-warning',
animation_duration: 100,
show_copy_buttons: true,
};

// this will be filled as they're registered
Expand Down Expand Up @@ -101,9 +102,12 @@ define([
.addClass('skip-traceback-summary')
.css('cursor', 'pointer')
.text(': ' + json.evalue + ' ')
.prepend($('<span class=ansired/>').text(json.ename))
.prepend(' ')
.prepend(copy_btn)
.prepend($('<span class=ansired/>').text(json.ename));

if (cfg.show_copy_buttons) {
sum.prepend(' ').prepend(copy_btn);
}
sum
.append('<i class="fa fa-caret-right" title="Expand traceback"/>')
.append('\n')
.on('click', function (evt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ The available options are:
class name, used for the action and toolbar button.
Defaults to `fa-warning`.

* `skip-traceback.show_copy_buttons` - add buttons to headings to copy the
full traceback to the clipboard. Defaults to `true`.

* `skip-traceback.use_toolbar_button` - add a button to the toolbar which can
be used to toggle on or off the contracted display of all cells' tracebacks.
Defaults to `false`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Parameters:
input_type: text
default: fa-warning

- name: skip-traceback.show_copy_buttons
description: |
Add buttons to headings to copy the full traceback to the clipboard
input_type: checkbox
default: true

- name: skip-traceback.enable
description: |
enable collapsing tracebacks on loading the nbextension
Expand Down

0 comments on commit 3eead7b

Please sign in to comment.