// Copyright (c) IPython Development Team. // Distributed under the terms of the Modified BSD License. define([ 'require', 'base/js/namespace', 'jquery', './toolbar', './celltoolbar' ], function(require, IPython, $, toolbar, celltoolbar) { "use strict"; var MainToolBar = function (selector, options) { /** * Constructor * * Parameters: * selector: string * options: dictionary * Dictionary of keyword arguments. * events: $(Events) instance * notebook: Notebook instance **/ toolbar.ToolBar.apply(this, [selector, options] ); this.events = options.events; this.notebook = options.notebook; this._make(); Object.seal(this); }; MainToolBar.prototype = Object.create(toolbar.ToolBar.prototype); MainToolBar.prototype._make = function () { var grps = [ [ ['ipython.save-notebook'], 'save-notbook' ], [ ['ipython.insert-cell-after'], 'insert_above_below'], [ ['ipython.cut-selected-cell', 'ipython.copy-selected-cell', 'ipython.paste-cell-after' ] , 'cut_copy_paste'], [ ['ipython.move-selected-cell-up', 'ipython.move-selected-cell-down' ], 'move_up_down'], [ ['ipython.run-select-next', 'ipython.interrupt-kernel', 'ipython.restart-kernel' ], 'run_int'], [''], [''] ]; this.construct(grps); }; // add a cell type drop down to the maintoolbar. // triggered when the pseudo action `` is // encountered when building a toolbar. MainToolBar.prototype._pseudo_actions.add_celltype_list = function () { var that = this; var sel = $('') .attr('id', 'ctb_select') .addClass('form-control select-xs') .append($('