瀏覽代碼

Merge pull request #63 from blink1073/updates

Update filebrowser and cleanup
Dave Willmer 9 年之前
父節點
當前提交
c858b22dd8
共有 4 個文件被更改,包括 14 次插入6 次删除
  1. 9 1
      examples/lab/webpack.conf.js
  2. 2 2
      package.json
  3. 1 1
      src/filebrowser/plugin.ts
  4. 2 2
      src/services/plugin.ts

+ 9 - 1
examples/lab/webpack.conf.js

@@ -1,4 +1,6 @@
 
+var ContextReplacementPlugin = require("webpack/lib/ContextReplacementPlugin");
+
 module.exports = {
   entry: './index.js',
   output: {
@@ -28,5 +30,11 @@ module.exports = {
       "base/js/namespace": "base/js/namespace",
       "notebook/js/outputarea": "notebook/js/outputarea",
       "services/kernels/comm": "services/kernels/comm"
-  }
+  },
+  plugins: [
+    new ContextReplacementPlugin(
+      /codemirror\/mode.*$/,
+      /codemirror\/mode.*\.js$/
+    )
+  ]
 }

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jupyter-js-plugins",
-  "version": "0.4.0",
+  "version": "0.4.3",
   "description": "Plugins for JupyterLab",
   "main": "lib/index.js",
   "typings": "lib/index.d.ts",
@@ -9,7 +9,7 @@
     "jquery": "^2.2.0",
     "jquery-ui": "^1.10.5",
     "jupyter-js-docmanager": "0.0.1",
-    "jupyter-js-filebrowser": "^0.8.0",
+    "jupyter-js-filebrowser": "^0.8.5",
     "jupyter-js-notebook": "^0.5.0",
     "jupyter-js-services": "^0.5.0",
     "jupyter-js-terminal": "^0.1.15",

+ 1 - 1
src/filebrowser/plugin.ts

@@ -44,7 +44,7 @@ function register(container: Container): void {
       let menu = createMenu(widget);
 
       // Add a context menu to the dir listing.
-      let node = widget.node.getElementsByClassName('jp-DirListing-list')[0];
+      let node = widget.node.getElementsByClassName('jp-DirListing-container')[0];
       node.addEventListener('contextmenu', (event: MouseEvent) => {
         event.preventDefault();
         let x = event.clientX;

+ 2 - 2
src/services/plugin.ts

@@ -3,7 +3,7 @@
 'use strict';
 
 import {
-  getConfigOption
+  getBaseUrl, getConfigOption
 } from 'jupyter-js-utils';
 
 import {
@@ -46,7 +46,7 @@ class ServicesProvider implements IServicesProvider {
    * Construct a new services provider.
    */
   constructor() {
-    let baseUrl = getConfigOption('baseUrl');
+    let baseUrl = getBaseUrl();
     let ajaxSettings = getConfigOption('ajaxSettings');
     let options = { baseUrl, ajaxSettings };
     this._kernelManager = new KernelManager(options);