當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。