Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function startApp(path: string, manager: ServiceManager.IManager) {
console.log('starting app');
// Initialize the command registry with the key bindings.
let commands = new CommandRegistry();
// Setup the keydown listener for the document.
document.addEventListener('keydown', event => {
commands.processKeydownEvent(event);
});
let rendermime = new RenderMimeRegistry({ initialFactories });
let editorFactory = editorServices.factoryService.newInlineEditor;
let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
let consolePanel = new ConsolePanel({
rendermime,
manager,
path,
contentFactory,
mimeTypeService: editorServices.mimeTypeService
});
consolePanel.title.label = TITLE;
let palette = new CommandPalette({ commands });
let panel = new SplitPanel();
panel.id = 'main';
panel.orientation = 'horizontal';
panel.spacing = 0;
SplitPanel.setStretch(palette, 0);
SplitPanel.setStretch(consolePanel, 1);
async function createConsole(options: ICreateOptions): Promise {
await manager.ready;
const panel = new ConsolePanel({
manager,
contentFactory,
mimeTypeService: editorServices.mimeTypeService,
rendermime,
setBusy: status ? status.setBusy.bind(status) : undefined,
...(options as Partial)
});
const interactionMode: string = (await settingRegistry.get(
'@jupyterlab/console-extension:tracker',
'interactionMode'
)).composite as string;
panel.console.node.dataset.jpInteractionMode = interactionMode;
// Add the console panel to the tracker and wait for it to be ready.
await Promise.all([tracker.add(panel), panel.session.ready]);
function startApp(path: string, manager: ServiceManager.IManager) {
// Initialize the command registry with the key bindings.
let commands = new CommandRegistry();
// Setup the keydown listener for the document.
document.addEventListener('keydown', event => {
commands.processKeydownEvent(event);
});
let rendermime = new RenderMimeRegistry({ initialFactories });
let editorFactory = editorServices.factoryService.newInlineEditor;
let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
let consolePanel = new ConsolePanel({
rendermime,
manager,
path,
contentFactory,
mimeTypeService: editorServices.mimeTypeService
});
consolePanel.title.label = TITLE;
let palette = new CommandPalette({ commands });
let panel = new SplitPanel();
panel.id = 'main';
panel.orientation = 'horizontal';
panel.spacing = 0;
SplitPanel.setStretch(palette, 0);
SplitPanel.setStretch(consolePanel, 1);
let commands = new CommandRegistry();
// Setup the keydown listener for the document.
document.addEventListener('keydown', event => {
commands.processKeydownEvent(event);
});
let editorFactory = editorServices.factoryService.newInlineEditor;
let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
// let consoleWidget = new CodeConsole({
// contentFactory,
// rendermime,
// mimeTypeService: editorServices.mimeTypeService,
// session:
// })
let consolePanel = new ConsolePanel({
rendermime,
manager,
contentFactory,
mimeTypeService: editorServices.mimeTypeService
});
let panel = new SplitPanel();
panel.id = 'console-panel';
panel.orientation = 'horizontal';
panel.spacing = 0;
SplitPanel.setStretch(consolePanel, 1);
panel.addWidget(consolePanel);
// Attach the panel to the DOM.
// Widget.attach(panel, app);
// Initialize the command registry with the key bindings.
let commands = new CommandRegistry();
// Setup the keydown listener for the document.
document.addEventListener('keydown', event => {
commands.processKeydownEvent(event);
});
let rendermime = new RenderMime({
initialFactories: defaultRendererFactories
});
let editorFactory = editorServices.factoryService.newInlineEditor.bind(
editorServices.factoryService);
let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
let consolePanel = new ConsolePanel({
rendermime,
manager,
path,
contentFactory,
mimeTypeService: editorServices.mimeTypeService
});
consolePanel.title.label = TITLE;
let palette = new CommandPalette({ commands });
let panel = new SplitPanel();
panel.id = 'main';
panel.orientation = 'horizontal';
panel.spacing = 0;
SplitPanel.setStretch(palette, 0);
SplitPanel.setStretch(consolePanel, 1);
async function createConsole(options: ICreateOptions): Promise {
await manager.ready;
const panel = new ConsolePanel({
manager,
contentFactory,
mimeTypeService: editorServices.mimeTypeService,
rendermime,
setBusy: status ? status.setBusy.bind(status) : undefined,
...(options as Partial)
});
const interactionMode: string = (await settingRegistry.get(
'@jupyterlab/console-extension:tracker',
'interactionMode'
)).composite as string;
panel.console.node.dataset.jpInteractionMode = interactionMode;
await panel.session.ready;