Browse Source

Merge pull request #841 from jasongrout/legacy

Add command to open legacy notebook.
Brian E. Granger 8 years ago
parent
commit
046e7dea4b
1 changed files with 14 additions and 0 deletions
  1. 14 0
      src/help/plugin.ts

+ 14 - 0
src/help/plugin.ts

@@ -1,6 +1,10 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  getBaseUrl
+} from 'jupyter-js-services/lib/utils';
+
 import {
   Menu
 } from 'phosphor/lib/ui/menu';
@@ -140,6 +144,15 @@ function activateHelpHandler(app: JupyterLab, mainMenu: IMainMenu, palette: ICom
     category: 'Help'
   }));
 
+  let openClassicNotebookId = 'classic-notebook:open';
+  app.commands.addCommand(openClassicNotebookId, {
+    label: 'Open Classic Notebook',
+    execute: () => {
+      window.open(getBaseUrl()+'tree');
+    }
+  });
+  palette.addItem({ command: openClassicNotebookId, category: 'Help'});
+
   let menu = Private.createMenu(app);
   mainMenu.addMenu(menu, {});
 
@@ -161,6 +174,7 @@ namespace Private {
     menu.title.label = 'Help';
     menu.addItem({ command: 'about-jupyterlab:show' });
     menu.addItem({ command: 'faq-jupyterlab:show' });
+    menu.addItem({ command: 'classic-notebook:open'})
 
     COMMANDS.forEach(item => menu.addItem({ command: item.id }));
     return menu;