Browse Source

Clean up.

Afshin Darian 8 năm trước cách đây
mục cha
commit
5151c7aabe

+ 1 - 1
src/commandpalette/plugin.ts

@@ -73,9 +73,9 @@ class Palette implements ICommandPalette {
  * The default commmand palette extension.
  */
 const plugin: JupyterLabPlugin<ICommandPalette> = {
+  activate,
   id: 'jupyter.services.commandpalette',
   provides: ICommandPalette,
-  activate: activate,
   requires: [IInstanceRestorer],
   autoStart: true
 };

+ 1 - 1
src/csvwidget/plugin.ts

@@ -32,9 +32,9 @@ const FACTORY = 'Table';
  * The table file handler extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.csv-handler',
   requires: [IDocumentRegistry, IInstanceRestorer],
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/editorwidget/plugin.ts

@@ -60,10 +60,10 @@ const cmdIds = {
  * The editor handler extension.
  */
 const plugin: JupyterLabPlugin<IEditorTracker> = {
+  activate,
   id: 'jupyter.services.editor-handler',
   requires: [IDocumentRegistry, IInstanceRestorer, IEditorServices],
   provides: IEditorTracker,
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/faq/plugin.ts

@@ -30,9 +30,9 @@ import {
  * The FAQ page extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.faq',
   requires: [ICommandPalette, ICommandLinker, IInstanceRestorer],
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/filebrowser/plugin.ts

@@ -54,6 +54,7 @@ import {
  * The default file browser provider.
  */
 const plugin: JupyterLabPlugin<IPathTracker> = {
+  activate,
   id: 'jupyter.services.file-browser',
   provides: IPathTracker,
   requires: [
@@ -65,7 +66,6 @@ const plugin: JupyterLabPlugin<IPathTracker> = {
     IInstanceRestorer,
     IStateDB
   ],
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/help/plugin.ts

@@ -106,9 +106,9 @@ const RESOURCES = [
  * The help handler extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.help-handler',
   requires: [IMainMenu, ICommandPalette, IInstanceRestorer],
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/imagewidget/plugin.ts

@@ -41,9 +41,9 @@ const FACTORY = 'Image';
  * The image file handler extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.image-handler',
   requires: [IDocumentRegistry, ICommandPalette, IInstanceRestorer],
-  activate: activate,
   autoStart: true
 };
 

+ 2 - 2
src/inspector/plugin.ts

@@ -27,10 +27,10 @@ import {
  * A service providing an inspector panel.
  */
 const plugin: JupyterLabPlugin<IInspector> = {
+  activate,
   id: 'jupyter.services.inspector',
   requires: [ICommandPalette, IInstanceRestorer],
-  provides: IInspector,
-  activate: activate
+  provides: IInspector
 };
 
 

+ 1 - 1
src/landing/plugin.ts

@@ -38,9 +38,9 @@ const LANDING_CLASS = 'jp-Landing';
  * The landing page extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.landing',
   requires: [IPathTracker, ICommandPalette, IServiceManager, IInstanceRestorer],
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/launcher/plugin.ts

@@ -34,10 +34,10 @@ import {
  * A service providing an interface to the the launcher.
  */
 const plugin: JupyterLabPlugin<ILauncher> = {
+  activate,
   id: 'jupyter.services.launcher',
   requires: [IServiceManager, IPathTracker, ICommandPalette, ICommandLinker, IInstanceRestorer],
   provides: ILauncher,
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/running/plugin.ts

@@ -22,9 +22,9 @@ import {
  * The default running sessions extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.running-sessions',
   requires: [IServiceManager, IInstanceRestorer],
-  activate: activate,
   autoStart: true
 };
 

+ 1 - 1
src/terminal/plugin.ts

@@ -53,11 +53,11 @@ const TERMINAL_ICON_CLASS = 'jp-ImageTerminal';
  * The default terminal extension.
  */
 const plugin: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.terminal',
   requires: [
     IServiceManager, IMainMenu, ICommandPalette, IInstanceRestorer
   ],
-  activate: activate,
   autoStart: true
 };
 

+ 3 - 3
tutorial/notebook.md

@@ -147,9 +147,9 @@ import {
  */
 export
 const widgetExtension: JupyterLabPlugin<void> = {
+  activate,
   id: 'jupyter.extensions.new-button',
-  requires: [IDocumentRegistry],
-  activate: activateExtension
+  requires: [IDocumentRegistry]
 };
 
 export
@@ -181,7 +181,7 @@ class ButtonExtension implements DocumentRegistry.IWidgetExtension<NotebookPanel
 /**
  * Activate the extension.
  */
-function activateExtension(lab: JupyterLab, registry: IDocumentRegistry) {
+function activate(lab: JupyterLab, registry: IDocumentRegistry) {
   registry.addWidgetExtension('Notebook', new ButtonExtension());
 }
 ```