浏览代码

Remove unused files

Steven Silvester 8 年之前
父节点
当前提交
ebe0b42b58

+ 0 - 72
packages/csvwidget-extension/src/index.ts

@@ -1,72 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  JupyterLab, JupyterLabPlugin
-} from '@jupyterlab/application';
-
-import {
-  ILayoutRestorer, InstanceTracker
-} from '@jupyterlab/apputils';
-
-import {
-  CSVViewer, CSVViewerFactory
-} from '@jupyterlab/csvviewer';
-
-import {
-  IDocumentRegistry
-} from '@jupyterlab/docregistry';
-
-
-/**
- * The name of the factory that creates CSV widgets.
- */
-const FACTORY = 'Table';
-
-
-/**
- * The table file handler extension.
- */
-const plugin: JupyterLabPlugin<void> = {
-  activate,
-  id: 'jupyter.extensions.csv-handler',
-  requires: [IDocumentRegistry, ILayoutRestorer],
-  autoStart: true
-};
-
-
-/**
- * Export the plugin as default.
- */
-export default plugin;
-
-
-/**
- * Activate the table widget extension.
- */
-function activate(app: JupyterLab, registry: IDocumentRegistry, restorer: ILayoutRestorer): void {
-  const factory = new CSVViewerFactory({
-    name: FACTORY,
-    fileExtensions: ['.csv'],
-    defaultFor: ['.csv']
-  });
-  const tracker = new InstanceTracker<CSVViewer>({
-    namespace: 'csvviewer',
-    shell: app.shell
-  });
-
-  // Handle state restoration.
-  restorer.restore(tracker, {
-    command: 'file-operations:open',
-    args: widget => ({ path: widget.context.path, factory: FACTORY }),
-    name: widget => widget.context.path
-  });
-
-  registry.addWidgetFactory(factory);
-  factory.widgetCreated.connect((sender, widget) => {
-    // Track the widget.
-    tracker.add(widget);
-    // Notify the instance tracker if restore data needs to update.
-    widget.context.pathChanged.connect(() => { tracker.save(widget); });
-  });
-}

+ 0 - 75
packages/csvwidget/style/index.css

@@ -1,75 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-
-:root {
-  --jp-private-csvviewer-toolbar-height: 24px;
-}
-
-.jp-CSVViewer {
-  display: flex;
-  flex-direction: column;
-  outline: none;
-}
-
-.jp-CSVViewer-toolbar {
-    display: flex;
-    flex: 0 0 auto;
-    flex-direction: row;
-    border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
-    /* Add the border width because this is border-box sized */
-    height: calc(var(--jp-private-csvviewer-toolbar-height) + var(--jp-border-width));
-    background: var(--jp-layout-color1);
-    font-size: var(--jp-code-font-size);
-}
-
-.jp-CSVViewer-toolbar span {
-    color: var(--jp-ui-font-color1);
-    font-size: var(--jp-ui-font-size1);
-    line-height: var(--jp-private-csvviewer-toolbar-height);
-    padding-left: 8px;
-    padding-right: 8px;
-}
-
-.jp-CSVViewer-toolbar select {
-    background: transparent;
-}
-
-.jp-CSVToolbar .jp-CSVToolbar-dropdown {
-    flex: 0 0 auto;
-    padding-left: 8px;
-    padding-right: 8px;
-    vertical-align: middle;
-    border: var(--jp-border-width) solid var(--jp-border-color1);
-    border-radius: 0;
-    outline: none;
-    width: 60px;
-    height: 20px;
-    font-size: var(--jp-ui-font-size0);
-    color: var(--jp-ui-font-color1);
-    margin-top: 2px;
-    margin-bottom: 2px;
-}
-
-
-.jp-CSVTable {
-  flex: 1 1 auto;
-  overflow: auto;
-}
-
-.jp-CSVTable.jp-RenderedHTMLCommon table {
-  margin-left: 0px;
-  margin-right: 0px;
-}
-
-
-.jp-CSVViewer-warning {
-  flex: 0 0 auto;
-  padding-left: 4px;
-  overflow: auto;
-  color: var(--jp-warn-color1);
-  line-height: 1.5;
-  font-size: var(--jp-ui-font-size1);
-}

+ 0 - 99
packages/imagewidget-extension/src/index.ts

@@ -1,99 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  JupyterLab, JupyterLabPlugin
-} from '@jupyterlab/application';
-
-import {
-  ICommandPalette, ILayoutRestorer, InstanceTracker
-} from '@jupyterlab/apputils';
-
-import {
-  IDocumentRegistry
-} from '@jupyterlab/docregistry';
-
-import {
-  ImageViewer, ImageViewerFactory, IImageTracker
-} from '@jupyterlab/imageviewer';
-
-
-/**
- * The command IDs used by the image widget plugin.
- */
-namespace CommandIDs {
-  export
-  const zoomIn = 'imageviewer:zoom-in';
-
-  export
-  const zoomOut = 'imageviewer:zoom-out';
-
-  export
-  const resetZoom = 'imageviewer:reset-zoom';
-};
-
-
-/**
- * The list of file extensions for images.
- */
-const EXTENSIONS = ['.png', '.gif', '.jpeg', '.jpg', '.svg', '.bmp', '.ico',
-  '.xbm', '.tiff', '.tif'];
-
-/**
- * The name of the factory that creates image widgets.
- */
-const FACTORY = 'Image';
-
-/**
- * The image file handler extension.
- */
-const plugin: JupyterLabPlugin<IImageTracker> = {
-  activate,
-  id: 'jupyter.extensions.image-handler',
-  provides: IImageTracker,
-  requires: [IDocumentRegistry, ICommandPalette, ILayoutRestorer],
-  autoStart: true
-};
-
-
-/**
- * Export the plugin as default.
- */
-export default plugin;
-
-
-/**
- * Activate the image widget extension.
- */
-function activate(app: JupyterLab, registry: IDocumentRegistry, palette: ICommandPalette, restorer: ILayoutRestorer): IImageTracker {
-  const namespace = 'image-widget';
-  const factory = new ImageViewerFactory({
-    name: FACTORY,
-    modelName: 'base64',
-    fileExtensions: EXTENSIONS,
-    defaultFor: EXTENSIONS
-  });
-  const { shell } = app;
-  const tracker = new InstanceTracker<ImageViewer>({ namespace, shell });
-
-  // Handle state restoration.
-  restorer.restore(tracker, {
-    command: 'file-operations:open',
-    args: widget => ({ path: widget.context.path, factory: FACTORY }),
-    name: widget => widget.context.path
-  });
-
-  registry.addWidgetFactory(factory);
-
-  factory.widgetCreated.connect((sender, widget) => {
-    // Notify the instance tracker if restore data needs to update.
-    widget.context.pathChanged.connect(() => { tracker.save(widget); });
-    tracker.add(widget);
-  });
-
-  let category = 'Image Widget';
-  [CommandIDs.zoomIn, CommandIDs.zoomOut, CommandIDs.resetZoom]
-    .forEach(command => { palette.addItem({ command, category }); });
-
-  return tracker;
-}

+ 0 - 90
packages/imagewidget/src/index.ts

@@ -1,90 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  CommandRegistry
-} from '@phosphor/commands';
-
-import {
-  Token
-} from '@phosphor/coreutils';
-
-import {
-  IInstanceTracker
-} from '@jupyterlab/apputils';
-
-import {
-  ImageViewer
-} from './widget';
-
-export * from './widget';
-
-
-/**
- * A class that tracks editor widgets.
- */
-export
-interface IImageTracker extends IInstanceTracker<ImageViewer> {}
-
-
-/* tslint:disable */
-/**
- * The editor tracker token.
- */
-export
-const IImageTracker = new Token<IImageTracker>('jupyter.services.image-tracker');
-/* tslint:enable */
-
-
-/**
- * Add the default commands for the image widget.
- */
-export
-function addDefaultCommands(tracker: IImageTracker, commands: CommandRegistry) {
-  commands.addCommand('imageviewer:zoom-in', {
-    execute: zoomIn,
-    label: 'Zoom In'
-  });
-
-  commands.addCommand('imageviewer:zoom-out', {
-    execute: zoomOut,
-    label: 'Zoom Out'
-  });
-
-  commands.addCommand('imageviewer:reset-zoom', {
-    execute: resetZoom,
-    label: 'Reset Zoom'
-  });
-
-  function zoomIn(): void {
-    let widget = tracker.currentWidget;
-    if (!widget) {
-      return;
-    }
-    if (widget.scale > 1) {
-      widget.scale += .5;
-    } else {
-      widget.scale *= 2;
-    }
-  }
-
-  function zoomOut(): void {
-    let widget = tracker.currentWidget;
-    if (!widget) {
-      return;
-    }
-    if (widget.scale > 1) {
-      widget.scale -= .5;
-    } else {
-      widget.scale /= 2;
-    }
-  }
-
-  function resetZoom(): void {
-    let widget = tracker.currentWidget;
-    if (!widget) {
-      return;
-    }
-    widget.scale = 1;
-  }
-}

+ 0 - 140
packages/imagewidget/src/widget.ts

@@ -1,140 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  Message
-} from '@phosphor/messaging';
-
-import {
-  Widget
-} from '@phosphor/widgets';
-
-import {
-  ABCWidgetFactory, DocumentRegistry
-} from '@jupyterlab/docregistry';
-
-/**
- * The class name added to a imageviewer.
- */
-const IMAGE_CLASS = 'jp-ImageViewer';
-
-
-/**
- * A widget for images.
- */
-export
-class ImageViewer extends Widget {
-  /**
-   * Construct a new image widget.
-   */
-  constructor(context: DocumentRegistry.Context) {
-    super({ node: Private.createNode() });
-    this._context = context;
-    this.node.tabIndex = -1;
-    this.addClass(IMAGE_CLASS);
-
-    this._onTitleChanged();
-    context.pathChanged.connect(this._onTitleChanged, this);
-
-    context.ready.then(() => {
-      this.update();
-      context.model.contentChanged.connect(this.update, this);
-      context.fileChanged.connect(this.update, this);
-    });
-  }
-
-  /**
-   * The image widget's context.
-   */
-  get context(): DocumentRegistry.Context {
-    return this._context;
-  }
-
-  /**
-   * The scale factor for the image.
-   */
-  get scale(): number {
-    return this._scale;
-  }
-  set scale(value: number) {
-    if (value === this._scale) {
-      return;
-    }
-    this._scale = value;
-    let scaleNode = this.node.querySelector('div') as HTMLElement;
-    let transform: string;
-    transform = `scale(${value})`;
-    scaleNode.style.transform = transform;
-  }
-
-  /**
-   * Dispose of the resources used by the widget.
-   */
-  dispose(): void {
-    this._context = null;
-    super.dispose();
-  }
-
-  /**
-   * Handle `update-request` messages for the widget.
-   */
-  protected onUpdateRequest(msg: Message): void {
-    let context = this._context;
-    if (this.isDisposed || !context.isReady) {
-      return;
-    }
-    let cm = context.contentsModel;
-    let content = context.model.toString();
-    let src = `data:${cm.mimetype};${cm.format},${content}`;
-    this.node.querySelector('img').setAttribute('src', src);
-  }
-
-  /**
-   * Handle `'activate-request'` messages.
-   */
-  protected onActivateRequest(msg: Message): void {
-    this.node.focus();
-  }
-
-  /**
-   * Handle a change to the title.
-   */
-  private _onTitleChanged(): void {
-    this.title.label = this._context.path.split('/').pop();
-  }
-
-  private _context: DocumentRegistry.Context;
-  private _scale = 1;
-}
-
-
-/**
- * A widget factory for images.
- */
-export
-class ImageViewerFactory extends ABCWidgetFactory<ImageViewer, DocumentRegistry.IModel> {
-  /**
-   * Create a new widget given a context.
-   */
-  protected createNewWidget(context: DocumentRegistry.IContext<DocumentRegistry.IModel>): ImageViewer {
-    return new ImageViewer(context);
-  }
-}
-
-/**
- * A namespace for image widget private data.
- */
-namespace Private {
-  /**
-   * Create the node for the image widget.
-   */
-  export
-  function createNode(): HTMLElement {
-    let node = document.createElement('div');
-    let innerNode = document.createElement('div');
-    let image = document.createElement('img');
-    node.appendChild(innerNode);
-    innerNode.appendChild(image);
-    return node;
-  }
-}

+ 0 - 81
packages/markdownwidget-extension/src/index.ts

@@ -1,81 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  JupyterLab, JupyterLabPlugin
-} from '@jupyterlab/application';
-
-import {
-  ILayoutRestorer, InstanceTracker
-} from '@jupyterlab/apputils';
-
-import {
-  IDocumentRegistry
-} from '@jupyterlab/docregistry';
-
-import {
-  IRenderMime
-} from '@jupyterlab/rendermime';
-
-import {
-  MarkdownViewer, MarkdownViewerFactory
-} from '@jupyterlab/markdownviewer';
-
-
-/**
- * The class name for the text editor icon from the default theme.
- */
-const TEXTEDITOR_ICON_CLASS = 'jp-ImageTextEditor';
-
-/**
- * The name of the factory that creates markdown widgets.
- */
-const FACTORY = 'Rendered Markdown';
-
-
-/**
- * The markdown handler extension.
- */
-const plugin: JupyterLabPlugin<void> = {
-  activate,
-  id: 'jupyter.extensions.rendered-markdown',
-  requires: [IDocumentRegistry, IRenderMime, ILayoutRestorer],
-  autoStart: true
-};
-
-
-/**
- * Activate the markdown plugin.
- */
-function activate(app: JupyterLab, registry: IDocumentRegistry, rendermime: IRenderMime, restorer: ILayoutRestorer) {
-    const factory = new MarkdownViewerFactory({
-      name: FACTORY,
-      fileExtensions: ['.md'],
-      rendermime
-    });
-    const shell = app.shell;
-    const namespace = 'rendered-markdown';
-    const tracker = new InstanceTracker<MarkdownViewer>({ namespace, shell });
-
-    // Handle state restoration.
-    restorer.restore(tracker, {
-      command: 'file-operations:open',
-      args: widget => ({ path: widget.context.path, factory: FACTORY }),
-      name: widget => widget.context.path
-    });
-
-    factory.widgetCreated.connect((sender, widget) => {
-      widget.title.icon = TEXTEDITOR_ICON_CLASS;
-      // Notify the instance tracker if restore data needs to update.
-      widget.context.pathChanged.connect(() => { tracker.save(widget); });
-      tracker.add(widget);
-    });
-
-    registry.addWidgetFactory(factory);
-  }
-
-
-/**
- * Export the plugin as default.
- */
-export default plugin;