本文整理汇总了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());
});
示例2: after
after(() => {
PageConfig.setOption('notebookVersion', prevNotebookVersion);
});
示例3: it
it('should return an empty string for an unknown option', () => {
expect(PageConfig.getOption('bar')).to.equal('');
});
示例4:
execute: () => { window.open(PageConfig.getBaseUrl() + 'tree'); }
示例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');
//.........这里部分代码省略.........
示例6: isAvailable
/**
* Test whether the build service is available.
*/
get isAvailable(): boolean {
return PageConfig.getOption('buildAvailable').toLowerCase() === 'true';
}
示例7: encodeURIComponent
execute: () => {
const path = encodeURIComponent(browser.selectedItems().next().path);
const tree = PageConfig.getTreeUrl();
Clipboard.copyToSystem(URLExt.join(tree, path));
},