Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
activate: (app: JupyterLab, palette: ICommandPalette): IMainMenu => {
let menu = new MainMenu(app.commands);
menu.id = 'jp-MainMenu';
let logo = new Widget();
logo.addClass('jp-MainAreaPortraitIcon');
logo.addClass('jp-JupyterIcon');
logo.id = 'jp-MainLogo';
let quitButton = PageConfig.getOption('quit_button');
menu.fileMenu.quitEntry = quitButton === 'True';
// Create the application menus.
createEditMenu(app, menu.editMenu);
createFileMenu(app, menu.fileMenu);
createKernelMenu(app, menu.kernelMenu);
createRunMenu(app, menu.runMenu);
createSettingsMenu(app, menu.settingsMenu);
activate: (
app: JupyterFrontEnd,
palette: ICommandPalette,
router: IRouter,
inspector: IInspector | null,
labShell: ILabShell | null
): IMainMenu => {
const { commands } = app;
let menu = new MainMenu(commands);
menu.id = 'jp-MainMenu';
let logo = new Widget();
logo.addClass('jp-MainAreaPortraitIcon');
logo.addClass('jp-JupyterIcon');
logo.id = 'jp-MainLogo';
// Only add quit button if the back-end supports it by checking page config.
let quitButton = PageConfig.getOption('quitButton');
menu.fileMenu.quitEntry = quitButton === 'True';
// Create the application menus.
createEditMenu(app, menu.editMenu);
createFileMenu(app, menu.fileMenu, router, inspector);
createKernelMenu(app, menu.kernelMenu);
createRunMenu(app, menu.runMenu);
it('should construct a new main menu', () => {
const menu = new MainMenu(new CommandRegistry());
expect(menu).to.be.an.instanceof(MainMenu);
});
});
beforeEach(() => {
mainMenu = new MainMenu(commands);
});
function buildPhosphorMenu(app: ElectronJupyterLab): IMainMenu {
let menu = new MainMenu(app.commands);
let titleBar = buildTitleBar(app);
menu.id = 'jpe-MainMenu-widget';
titleBar.id = 'jpe-TitleBar-widget';
titleBar.addClass('jpe-mod-' + app.info.uiState);
let logo = new Widget();
logo.addClass('jp-MainAreaPortraitIcon');
logo.addClass('jpe-JupyterIcon');
logo.id = 'jp-MainLogo';
app.shell.addToTopArea(logo);
app.shell.addToTopArea(menu);
app.shell.addToTopArea(titleBar);