Ver Fonte

work in progress

Afshin Darian há 8 anos atrás
pai
commit
9de10e52b2
3 ficheiros alterados com 67 adições e 0 exclusões
  1. 8 0
      src/tooltip/index.css
  2. 28 0
      src/tooltip/index.ts
  3. 31 0
      src/tooltip/plugin.ts

+ 8 - 0
src/tooltip/index.css

@@ -0,0 +1,8 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+.jp-Tooltip {
+  background: var(--jp-info-color0);
+}

+ 28 - 0
src/tooltip/index.ts

@@ -0,0 +1,28 @@
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
+
+import {
+  Widget
+} from 'phosphor/lib/ui/widget';
+
+
+/**
+ * The class name added to each tooltip.
+ */
+const TOOLTIP_CLASS = 'jp-Tooltip';
+
+
+/**
+ * A tooltip widget.
+ */
+export
+class TooltipWidget extends Widget {
+  /**
+   * Instantiate a tooltip.
+   */
+  constructor() {
+    super();
+    this.addClass(TOOLTIP_CLASS);
+  }
+
+}

+ 31 - 0
src/tooltip/plugin.ts

@@ -0,0 +1,31 @@
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
+
+import {
+  JupyterLab, JupyterLabPlugin
+} from '../application';
+
+import {
+  TooltipWidget
+} from './index';
+
+
+/**
+ * The tooltip extension.
+ */
+const plugin: JupyterLabPlugin<void> = {
+  activate,
+  id: 'jupyter.extensions.tooltip',
+  autoStart: true
+};
+
+
+/**
+ * Export the plugin as default.
+ */
+export default plugin;
+
+
+function activate(app: JupyterLab): void {
+  console.log('initialized tooltip plugin', TooltipWidget);
+}