mirror of
https://github.com/jupyter/notebook.git
synced 2024-11-21 01:11:21 +08:00
More renaming
This commit is contained in:
parent
8b6c8209ad
commit
6201b4b7e1
@ -515,13 +515,13 @@ const topVisibility: JupyterFrontEndPlugin<void> = {
|
||||
optional: [IMainMenu, ISettingRegistry],
|
||||
activate: (
|
||||
app: JupyterFrontEnd<JupyterFrontEnd.IShell>,
|
||||
retroShell: INotebookShell,
|
||||
notebookShell: INotebookShell,
|
||||
translator: ITranslator,
|
||||
menu: IMainMenu | null,
|
||||
settingRegistry: ISettingRegistry | null
|
||||
) => {
|
||||
const trans = translator.load('jupyter-notebook');
|
||||
const top = retroShell.top;
|
||||
const top = notebookShell.top;
|
||||
const pluginId = topVisibility.id;
|
||||
|
||||
app.commands.addCommand(CommandIDs.toggleTop, {
|
||||
@ -568,9 +568,9 @@ const topVisibility: JupyterFrontEndPlugin<void> = {
|
||||
return;
|
||||
}
|
||||
if (app.format === 'desktop') {
|
||||
retroShell.expandTop();
|
||||
notebookShell.expandTop();
|
||||
} else {
|
||||
retroShell.collapseTop();
|
||||
notebookShell.collapseTop();
|
||||
}
|
||||
};
|
||||
|
||||
@ -677,7 +677,7 @@ const zen: JupyterFrontEndPlugin<void> = {
|
||||
app: JupyterFrontEnd,
|
||||
translator: ITranslator,
|
||||
palette: ICommandPalette | null,
|
||||
retroShell: INotebookShell | null,
|
||||
notebookShell: INotebookShell | null,
|
||||
menu: IMainMenu | null
|
||||
): void => {
|
||||
const { commands } = app;
|
||||
@ -685,14 +685,14 @@ const zen: JupyterFrontEndPlugin<void> = {
|
||||
const trans = translator.load('jupyter-notebook');
|
||||
|
||||
const toggleOn = () => {
|
||||
retroShell?.collapseTop();
|
||||
retroShell?.menu.setHidden(true);
|
||||
notebookShell?.collapseTop();
|
||||
notebookShell?.menu.setHidden(true);
|
||||
zenModeEnabled = true;
|
||||
};
|
||||
|
||||
const toggleOff = () => {
|
||||
retroShell?.expandTop();
|
||||
retroShell?.menu.setHidden(false);
|
||||
notebookShell?.expandTop();
|
||||
notebookShell?.menu.setHidden(false);
|
||||
zenModeEnabled = false;
|
||||
};
|
||||
|
||||
|
@ -39,13 +39,13 @@ const disableShortcut: JupyterFrontEndPlugin<void> = {
|
||||
/**
|
||||
* A plugin to add document search functionalities.
|
||||
*/
|
||||
const retroShellWidgetListener: JupyterFrontEndPlugin<void> = {
|
||||
id: '@jupyter-notebook/documentsearch-extension:retroShellWidgetListener',
|
||||
const notebookShellWidgetListener: JupyterFrontEndPlugin<void> = {
|
||||
id: '@jupyter-notebook/documentsearch-extension:notebookShellWidgetListener',
|
||||
requires: [INotebookShell, ISearchProviderRegistry],
|
||||
autoStart: true,
|
||||
activate: (
|
||||
app: JupyterFrontEnd,
|
||||
retroShell: INotebookShell,
|
||||
notebookShell: INotebookShell,
|
||||
registry: ISearchProviderRegistry
|
||||
) => {
|
||||
// If a given widget is searchable, apply the searchable class.
|
||||
@ -67,15 +67,15 @@ const retroShellWidgetListener: JupyterFrontEndPlugin<void> = {
|
||||
// changes, in case a provider for the current widget was added
|
||||
// or removed
|
||||
registry.changed.connect(() =>
|
||||
transformWidgetSearchability(retroShell.currentWidget)
|
||||
transformWidgetSearchability(notebookShell.currentWidget)
|
||||
);
|
||||
|
||||
// Apply the searchable class only to the active widget if it is actually
|
||||
// searchable. Remove the searchable class from a widget when it's
|
||||
// no longer active.
|
||||
retroShell.currentChanged.connect((_, args) => {
|
||||
if (retroShell.currentWidget) {
|
||||
transformWidgetSearchability(retroShell.currentWidget);
|
||||
notebookShell.currentChanged.connect((_, args) => {
|
||||
if (notebookShell.currentWidget) {
|
||||
transformWidgetSearchability(notebookShell.currentWidget);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -86,7 +86,7 @@ const retroShellWidgetListener: JupyterFrontEndPlugin<void> = {
|
||||
*/
|
||||
const plugins: JupyterFrontEndPlugin<any>[] = [
|
||||
disableShortcut,
|
||||
retroShellWidgetListener
|
||||
notebookShellWidgetListener
|
||||
];
|
||||
|
||||
export default plugins;
|
||||
|
@ -74,7 +74,7 @@ const launchButtons: JupyterFrontEndPlugin<void> = {
|
||||
notebookTracker: INotebookTracker | null,
|
||||
palette: ICommandPalette | null,
|
||||
menu: IMainMenu | null,
|
||||
retroShell: INotebookShell | null,
|
||||
notebookShell: INotebookShell | null,
|
||||
labShell: ILabShell | null,
|
||||
toolbarRegistry: IToolbarWidgetRegistry | null
|
||||
) => {
|
||||
@ -132,7 +132,7 @@ const launchButtons: JupyterFrontEndPlugin<void> = {
|
||||
urlPrefix: `${baseUrl}tree/`
|
||||
});
|
||||
|
||||
if (!retroShell) {
|
||||
if (!notebookShell) {
|
||||
addInterface({
|
||||
command: 'jupyter-notebook:open-retro',
|
||||
commandLabel: trans.__('Open With %1', 'Jupyter Notebook'),
|
||||
|
@ -65,7 +65,7 @@ const checkpoints: JupyterFrontEndPlugin<void> = {
|
||||
app: JupyterFrontEnd,
|
||||
docManager: IDocumentManager,
|
||||
translator: ITranslator,
|
||||
retroShell: INotebookShell | null
|
||||
notebookShell: INotebookShell | null
|
||||
) => {
|
||||
const { shell } = app;
|
||||
const trans = translator.load('jupyter-notebook');
|
||||
@ -95,8 +95,8 @@ const checkpoints: JupyterFrontEndPlugin<void> = {
|
||||
);
|
||||
};
|
||||
|
||||
if (retroShell) {
|
||||
retroShell.currentChanged.connect(onChange);
|
||||
if (notebookShell) {
|
||||
notebookShell.currentChanged.connect(onChange);
|
||||
}
|
||||
|
||||
new Poll({
|
||||
|
Loading…
Reference in New Issue
Block a user