##// END OF EJS Templates
Merge pull request #6065 from atteroTheGreatest/i1673...
Merge pull request #6065 from atteroTheGreatest/i1673 #1673 Display of chained exception

File last commit:

r16913:9218ca55
r17170:2bf35f92 merge
Show More
default.js
46 lines | 1.5 KiB | application/javascript | JavascriptLexer
Matthias BUSSONNIER
add default celltoolbar UI
r9078 //----------------------------------------------------------------------------
// Copyright (C) 2012 The IPython Development Team
//
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
//============================================================================
// CellToolbar Default
//============================================================================
/**
* Example Use for the CellToolbar library
*/
// IIFE without asignement, we don't modifiy the IPython namespace
(function (IPython) {
"use strict";
var CellToolbar = IPython.CellToolbar;
var raw_edit = function(cell){
MinRK
move edit_metadata to IPython.dialog
r12872 IPython.dialog.edit_metadata(cell.metadata, function (md) {
cell.metadata = md;
Matthias BUSSONNIER
add default celltoolbar UI
r9078 });
MinRK
move edit_metadata to IPython.dialog
r12872 };
Matthias BUSSONNIER
add default celltoolbar UI
r9078
var add_raw_edit_button = function(div, cell) {
MinRK
fix cell toolbar
r10935 var button_container = div;
var button = $('<button/>')
Jonathan Frederic
Ran jdfreder/bootstrap2to3
r16913 .addClass("btn btn-default btn-xs")
MinRK
clarify name of 'default' cell toolbar
r13669 .text("Edit Metadata")
MinRK
fix cell toolbar
r10935 .click( function () {
raw_edit(cell);
return false;
});
Matthias BUSSONNIER
add default celltoolbar UI
r9078 button_container.append(button);
MinRK
move edit_metadata to IPython.dialog
r12872 };
Matthias BUSSONNIER
add default celltoolbar UI
r9078
MinRK
move edit_metadata to IPython.dialog
r12872 CellToolbar.register_callback('default.rawedit', add_raw_edit_button);
var example_preset = [];
Matthias BUSSONNIER
add default celltoolbar UI
r9078 example_preset.push('default.rawedit');
MinRK
clarify name of 'default' cell toolbar
r13669 CellToolbar.register_preset('Edit Metadata', example_preset);
console.log('Default extension for cell metadata editing loaded.');
Matthias BUSSONNIER
add default celltoolbar UI
r9078
}(IPython));