Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function activateChatbox(app: JupyterLab, rendermime: IRenderMime, palette: ICommandPalette, editorServices: IEditorServices, docManager: IDocumentManager, restorer: ILayoutRestorer): void {
const id = 'chatbox';
let { commands, shell } = app;
let category = 'Chatbox';
let command: string;
/**
* Create a chatbox for a given path.
*/
let editorFactory = editorServices.factoryService.newInlineEditor.bind(
editorServices.factoryService);
let contentFactory = new ChatboxPanel.ContentFactory({ editorFactory });
let panel = new ChatboxPanel({
rendermime: rendermime.clone(),
contentFactory
});
// Add the chatbox panel to the tracker.
panel.title.label = 'Chat';
panel.id = id;
restorer.add(panel, 'chatbox');
command = CommandIDs.clear;
commands.addCommand(command, {
label: 'Clear Chat',
execute: args => {
panel.chatbox.clear();
}