当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript coreutils.PageConfig类代码示例

本文整理汇总了TypeScript中@jupyterlab/coreutils.PageConfig的典型用法代码示例。如果您正苦于以下问题:TypeScript PageConfig类的具体用法?TypeScript PageConfig怎么用?TypeScript PageConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PageConfig类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

 it('should be the server settings', () => {
   expect(defaultKernel.serverSettings.baseUrl).to.be(PageConfig.getBaseUrl());
 });
开发者ID:groutr,项目名称:jupyterlab,代码行数:3,代码来源:ikernel.spec.ts

示例2: after

 after(() => {
   PageConfig.setOption('notebookVersion', prevNotebookVersion);
 });
开发者ID:dalejung,项目名称:jupyterlab,代码行数:3,代码来源:model.spec.ts

示例3: it

 it('should return an empty string for an unknown option', () => {
   expect(PageConfig.getOption('bar')).to.equal('');
 });
开发者ID:afshin,项目名称:jupyterlab,代码行数:3,代码来源:pageconfig.spec.ts

示例4:

 execute: () => { window.open(PageConfig.getBaseUrl() + 'tree'); }
开发者ID:charnpreetsingh185,项目名称:jupyterlab,代码行数:1,代码来源:index.ts

示例5: MainMenu

  activate: (
    app: JupyterFrontEnd,
    palette: ICommandPalette,
    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, inspector);
    createKernelMenu(app, menu.kernelMenu);
    createRunMenu(app, menu.runMenu);
    createSettingsMenu(app, menu.settingsMenu);
    createViewMenu(app, menu.viewMenu);

    // The tabs menu relies on lab shell functionality.
    if (labShell) {
      createTabsMenu(app, menu.tabsMenu, labShell);
    }

    // Create commands to open the main application menus.
    const activateMenu = (item: Menu) => {
      menu.activeMenu = item;
      menu.openActiveMenu();
    };

    commands.addCommand(CommandIDs.openEdit, {
      label: 'Open Edit Menu',
      execute: () => activateMenu(menu.editMenu.menu)
    });
    commands.addCommand(CommandIDs.openFile, {
      label: 'Open File Menu',
      execute: () => activateMenu(menu.fileMenu.menu)
    });
    commands.addCommand(CommandIDs.openKernel, {
      label: 'Open Kernel Menu',
      execute: () => activateMenu(menu.kernelMenu.menu)
    });
    commands.addCommand(CommandIDs.openRun, {
      label: 'Open Run Menu',
      execute: () => activateMenu(menu.runMenu.menu)
    });
    commands.addCommand(CommandIDs.openView, {
      label: 'Open View Menu',
      execute: () => activateMenu(menu.viewMenu.menu)
    });
    commands.addCommand(CommandIDs.openSettings, {
      label: 'Open Settings Menu',
      execute: () => activateMenu(menu.settingsMenu.menu)
    });
    commands.addCommand(CommandIDs.openTabs, {
      label: 'Open Tabs Menu',
      execute: () => activateMenu(menu.tabsMenu.menu)
    });
    commands.addCommand(CommandIDs.openHelp, {
      label: 'Open Help Menu',
      execute: () => activateMenu(menu.helpMenu.menu)
    });
    commands.addCommand(CommandIDs.openFirst, {
      label: 'Open First Menu',
      execute: () => {
        menu.activeIndex = 0;
        menu.openActiveMenu();
      }
    });

    // Add some of the commands defined here to the command palette.
    if (menu.fileMenu.quitEntry) {
      palette.addItem({
        command: CommandIDs.quit,
        category: 'Main Area'
      });
    }

    palette.addItem({
      command: CommandIDs.shutdownAllKernels,
      category: 'Kernel Operations'
    });

    palette.addItem({
      command: CommandIDs.activatePreviouslyUsedTab,
      category: 'Main Area'
    });

    app.shell.add(logo, 'top');
    app.shell.add(menu, 'top');

//.........这里部分代码省略.........
开发者ID:ellisonbg,项目名称:jupyterlab,代码行数:101,代码来源:index.ts

示例6: isAvailable

 /**
  * Test whether the build service is available.
  */
 get isAvailable(): boolean {
   return PageConfig.getOption('buildAvailable').toLowerCase() === 'true';
 }
开发者ID:AlbertHilb,项目名称:jupyterlab,代码行数:6,代码来源:index.ts

示例7: encodeURIComponent

    execute: () => {
      const path = encodeURIComponent(browser.selectedItems().next().path);
      const tree = PageConfig.getTreeUrl();

      Clipboard.copyToSystem(URLExt.join(tree, path));
    },
开发者ID:7125messi,项目名称:jupyterlab,代码行数:6,代码来源:index.ts


注:本文中的@jupyterlab/coreutils.PageConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。