//----------------------------------------------------------------------------1// Copyright (C) 2012 The IPython Development Team2//3// Distributed under the terms of the BSD License. The full license is in4// the file COPYING, distributed as part of this software.5//----------------------------------------------------------------------------67//============================================================================8// CellToolbar Default9//============================================================================1011/**12* Example Use for the CellToolbar library13*/14// IIFE without asignement, we don't modifiy the IPython namespace15(function (IPython) {16"use strict";1718var CellToolbar = IPython.CellToolbar;1920var raw_edit = function(cell){21IPython.dialog.edit_metadata(cell.metadata, function (md) {22cell.metadata = md;23});24};2526var add_raw_edit_button = function(div, cell) {27var button_container = div;28var button = $('<button/>')29.addClass("btn btn-mini")30.text("Edit Metadata")31.click( function () {32raw_edit(cell);33return false;34});35button_container.append(button);36};3738CellToolbar.register_callback('default.rawedit', add_raw_edit_button);39var example_preset = [];40example_preset.push('default.rawedit');4142CellToolbar.register_preset('Edit Metadata', example_preset);43console.log('Default extension for cell metadata editing loaded.');4445}(IPython));464748