Browse Source

Fix new notebook command and landing commands

Steven Silvester 8 years ago
parent
commit
7da21e1e5f
2 changed files with 22 additions and 6 deletions
  1. 1 1
      src/filebrowser/index.ts
  2. 21 5
      src/landing/widget.ts

+ 1 - 1
src/filebrowser/index.ts

@@ -36,7 +36,7 @@ namespace CommandIDs {
   const newTextFile = 'file-operations:new-text-file';
   const newTextFile = 'file-operations:new-text-file';
 
 
   export
   export
-  const newNotebook = 'file-operations:new-notebook-file';
+  const newNotebook = 'file-operations:new-notebook';
 
 
   export
   export
   const showBrowser = 'file-browser:activate';
   const showBrowser = 'file-browser:activate';

+ 21 - 5
src/landing/widget.ts

@@ -9,6 +9,10 @@ import {
   h, VNode
   h, VNode
 } from 'phosphor/lib/ui/vdom';
 } from 'phosphor/lib/ui/vdom';
 
 
+import {
+  CommandIDs as AboutCommandIDs
+} from '../about';
+
 import {
 import {
   JupyterLab
   JupyterLab
 } from '../application';
 } from '../application';
@@ -17,6 +21,18 @@ import {
   VDomModel, VDomWidget
   VDomModel, VDomWidget
 } from '../common/vdom';
 } from '../common/vdom';
 
 
+import {
+  CommandIDs as ConsoleCommandIDs
+} from '../console';
+
+import {
+  CommandIDs as FileBrowserCommandIDs
+} from '../filebrowser';
+
+import {
+  CommandIDs as TerminalCommandIDs
+} from '../terminal';
+
 
 
 /**
 /**
  * The class name added to the landing scroll wrapper.
  * The class name added to the landing scroll wrapper.
@@ -136,13 +152,13 @@ class LandingModel extends VDomModel {
     ];
     ];
     this.headerText = 'Start a new activity';
     this.headerText = 'Start a new activity';
     this.activities =
     this.activities =
-    [['Notebook', 'file-operations:new-notebook'],
-     ['Code Console', `console:create`],
-     ['Text Editor', 'file-operations:new-text-file']];
+    [['Notebook', FileBrowserCommandIDs.newNotebook],
+     ['Code Console', ConsoleCommandIDs.create],
+     ['Text Editor', FileBrowserCommandIDs.newTextFile]];
 
 
     if (terminalsAvailable) {
     if (terminalsAvailable) {
       this.activities.push(
       this.activities.push(
-        ['Terminal', 'terminal:create-new']
+        ['Terminal', TerminalCommandIDs.createNew]
       );
       );
     }
     }
     this._path = 'home';
     this._path = 'home';
@@ -223,7 +239,7 @@ class LandingWidget extends VDomWidget<LandingModel> {
     let tour =
     let tour =
     h.span({className: TOUR_ICON_CLASS,
     h.span({className: TOUR_ICON_CLASS,
       onclick: () => {
       onclick: () => {
-        this._app.commands.execute('about-jupyterlab:show', void 0);
+        this._app.commands.execute(AboutCommandIDs.open, void 0);
       }}
       }}
     );
     );
     let header = h.span({
     let header = h.span({