Browse Source

Refactor about plugin

Steven Silvester 8 years ago
parent
commit
ab16e4e5f0

+ 1 - 1
examples/lab/index.js

@@ -11,7 +11,7 @@ require('jupyterlab/lib/default-theme/index.css');
 
 
 var mods = [
-  require('jupyterlab/lib/about/plugin'),
+  require('jupyterlab/lib/plugin-about'),
   require('jupyterlab/lib/application/plugin'),
   require('jupyterlab/lib/codemirror/plugin'),
   require('jupyterlab/lib/commandlinker/plugin'),

+ 1 - 1
jupyterlab/src/main.ts

@@ -18,7 +18,7 @@ polyfill();
 
 /* tslint:disable */
 const mods: JupyterLab.IPluginModule[] = [
-  require('../../lib/about/plugin'),
+  require('../../lib/plugin-about'),
   require('../../lib/application/plugin'),
   require('../../lib/codemirror/plugin'),
   require('../../lib/commandlinker/plugin'),

+ 1 - 1
src/default-theme/index.css

@@ -18,7 +18,7 @@
 
 
 /* Individual plugins */
-@import '../about/index.css';
+@import '../plugin-about/index.css';
 @import '../cells/index.css';
 @import '../codemirror/index.css';
 @import '../commandpalette/index.css';

+ 1 - 5
src/faq/widget.ts

@@ -9,10 +9,6 @@ import {
   h, VirtualNode
 } from '@phosphor/virtualdom';
 
-import {
-  CommandIDs as AboutCommandIDs
-} from '../about';
-
 import {
   ICommandLinker
 } from '../commandlinker';
@@ -268,7 +264,7 @@ class FaqWidget extends VDomWidget<FaqModel> {
           'Check out the JupyterLab tour ',
           h.a({
             className: ANCHOR_CLASS,
-            dataset: linker.populateVNodeDataset(AboutCommandIDs.open, null)
+            dataset: linker.populateVNodeDataset('about-jupyterlab:open', null)
           }, 'here')
         )
       ),

+ 1 - 5
src/help/plugin.ts

@@ -13,10 +13,6 @@ import {
   Menu
 } from '@phosphor/widgets';
 
-import {
-  CommandIDs as AboutCommandIDs
-} from '../about';
-
 import {
   InstanceTracker, JupyterLab, JupyterLabPlugin
 } from '../application';
@@ -191,7 +187,7 @@ function activate(app: JupyterLab, mainMenu: IMainMenu, palette: ICommandPalette
     let menu = new Menu({ commands });
     menu.title.label = category;
 
-    menu.addItem({ command: AboutCommandIDs.open });
+    menu.addItem({ command: 'about-jupyterlab:open' });
     menu.addItem({ command: FAQCommandIDs.open });
     menu.addItem({ command: CommandIDs.launchClassic });
     menu.addItem({ type: 'separator' });

+ 1 - 5
src/landing/widget.ts

@@ -9,10 +9,6 @@ import {
   h, VirtualNode
 } from '@phosphor/virtualdom';
 
-import {
-  CommandIDs as AboutCommandIDs
-} from '../about';
-
 import {
   JupyterLab
 } from '../application';
@@ -239,7 +235,7 @@ class LandingWidget extends VDomWidget<LandingModel> {
     let tour =
     h.span({className: TOUR_ICON_CLASS,
       onclick: () => {
-        this._app.commands.execute(AboutCommandIDs.open, void 0);
+        this._app.commands.execute('about-jupyterlab:open', void 0);
       }}
     );
     let header = h.span({

+ 0 - 0
src/about/images/command.svg → src/plugin-about/images/command.svg


+ 0 - 0
src/about/images/file-browser.svg → src/plugin-about/images/file-browser.svg


+ 0 - 0
src/about/images/jl-About-cp.gif → src/plugin-about/images/jl-About-cp.gif


+ 0 - 0
src/about/images/jl-About-fb.gif → src/plugin-about/images/jl-About-fb.gif


+ 0 - 0
src/about/images/jl-About-hero-nb.svg → src/plugin-about/images/jl-About-hero-nb.svg


+ 0 - 0
src/about/images/jl-About-ma.gif → src/plugin-about/images/jl-About-ma.gif


+ 0 - 0
src/about/images/jl-About-nb.svg → src/plugin-about/images/jl-About-nb.svg


+ 0 - 0
src/about/images/logo.svg → src/plugin-about/images/logo.svg


+ 0 - 0
src/about/images/main-area.svg → src/plugin-about/images/main-area.svg


+ 0 - 0
src/about/images/next-arrow-sprite.svg → src/plugin-about/images/next-arrow-sprite.svg


+ 0 - 0
src/about/images/next-arrow.svg → src/plugin-about/images/next-arrow.svg


+ 0 - 0
src/about/index.css → src/plugin-about/index.css


+ 12 - 2
src/about/plugin.ts → src/plugin-about/index.ts

@@ -18,8 +18,18 @@ import {
 } from '../instancerestorer';
 
 import {
-  AboutModel, AboutWidget, CommandIDs
-} from './';
+  AboutModel, AboutWidget
+} from './widget';
+
+
+/**
+ * The command IDs used by the about plugin.
+ */
+namespace CommandIDs {
+  export
+  const open = 'about-jupyterlab:open';
+}
+
 
 /**
  * The about page extension.

+ 0 - 10
src/about/index.ts → src/plugin-about/widget.ts

@@ -220,16 +220,6 @@ const NOTEBOOK_DESC = [
 ];
 
 
-/**
- * The command IDs used by the about plugin.
- */
-export
-namespace CommandIDs {
-  export
-  const open = 'about-jupyterlab:open';
-}
-
-
 /**
  * AboutModel holds data which the AboutWidgetwill render.
  */