فهرست منبع

Merge pull request #98 from blink1073/about-tab

Add stub for about plugin
Kyle Kelley 9 سال پیش
والد
کامیت
9b6516a632
2فایلهای تغییر یافته به همراه30 افزوده شده و 1 حذف شده
  1. 2 1
      examples/lab/index.js
  2. 28 0
      src/about/plugin.ts

+ 2 - 1
examples/lab/index.js

@@ -16,7 +16,8 @@ var app = new phosphide.Application({
     require('jupyter-js-plugins/lib/imagehandler/plugin').imageHandlerExtension,
     require('jupyter-js-plugins/lib/help/plugin').helpHandlerExtension,
     require('jupyter-js-plugins/lib/notebook/plugin').notebookHandlerExtension,
-    require('jupyter-js-plugins/lib/shortcuts/plugin').shortcutsExtension
+    require('jupyter-js-plugins/lib/shortcuts/plugin').shortcutsExtension,
+    require('jupyter-js-plugins/lib/about/plugin').aboutExtension,
   ],
   providers: [
     require('jupyter-js-plugins/lib/documentmanager/plugin').documentManagerProvider,

+ 28 - 0
src/about/plugin.ts

@@ -0,0 +1,28 @@
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
+'use strict';
+
+import {
+  Application
+} from 'phosphide/lib/core/application';
+
+import {
+  Widget
+} from 'phosphor-widget';
+
+
+/**
+ * The about page extension.
+ */
+export
+const aboutExtension = {
+  id: 'jupyter.extensions.about',
+  activate: (app: Application) => {
+    let widget = new Widget();
+    widget.id = 'about-jupyterlab';
+    widget.title.text = 'About';
+    widget.title.closable = false;
+    widget.node.textContent = 'hello, world';
+    app.shell.addToMainArea(widget);
+  }
+}