|
@@ -39,7 +39,7 @@ import {
|
|
|
} from '@phosphor/messaging';
|
|
|
|
|
|
import {
|
|
|
- Menu, Widget
|
|
|
+ Menu, Panel, Widget
|
|
|
} from '@phosphor/widgets';
|
|
|
|
|
|
|
|
@@ -69,6 +69,9 @@ namespace CommandIDs {
|
|
|
export
|
|
|
const createConsole = 'notebook:create-console';
|
|
|
|
|
|
+ export
|
|
|
+ const createCellView = 'notebook:create-cell-view';
|
|
|
+
|
|
|
export
|
|
|
const clearAllOutputs = 'notebook:clear-all-cell-outputs';
|
|
|
|
|
@@ -463,6 +466,10 @@ function activateNotebookHandler(app: JupyterLab, mainMenu: IMainMenu, palette:
|
|
|
command: CommandIDs.split,
|
|
|
selector: '.jp-Notebook .jp-Cell'
|
|
|
});
|
|
|
+ app.contextMenu.addItem({
|
|
|
+ command: CommandIDs.createCellView,
|
|
|
+ selector: '.jp-Notebook .jp-Cell'
|
|
|
+ });
|
|
|
app.contextMenu.addItem({
|
|
|
type: 'separator',
|
|
|
selector: '.jp-Notebook',
|
|
@@ -1006,6 +1013,25 @@ function addCommands(app: JupyterLab, services: ServiceManager, tracker: Noteboo
|
|
|
},
|
|
|
isEnabled: hasWidget
|
|
|
});
|
|
|
+ commands.addCommand(CommandIDs.createCellView, {
|
|
|
+ label: 'Create New View for Cell',
|
|
|
+ execute: args => {
|
|
|
+ const current = getCurrent(args);
|
|
|
+ let nb = current.notebook;
|
|
|
+ let index = nb.activeCellIndex;
|
|
|
+ let cellwidget = nb.widgets[index];
|
|
|
+
|
|
|
+ let p = new Panel();
|
|
|
+ p.id = `Cell-${Math.random()}`;
|
|
|
+ p.title.closable = true;
|
|
|
+ p.title.label = 'Cell';
|
|
|
+
|
|
|
+ let newCell = nb.createCell(cellwidget.model);
|
|
|
+ p.addWidget(newCell);
|
|
|
+ shell.addToMainArea(p);
|
|
|
+ },
|
|
|
+ isEnabled: hasWidget
|
|
|
+ });
|
|
|
commands.addCommand(CommandIDs.createConsole, {
|
|
|
label: 'Create Console for Notebook',
|
|
|
execute: args => {
|