Skip to content

Commit

Permalink
Merge pull request #120 from SylvainCorlay/fixup-jlab-extension
Browse files Browse the repository at this point in the history
Fixup Jupyterlab extension for 0.4.0
  • Loading branch information
SylvainCorlay committed May 6, 2019
2 parents 03a95cd + d7e8b85 commit 6ba975e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 30 deletions.
16 changes: 8 additions & 8 deletions js/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

// Configure requirejs
if (window['require'] !== undefined) {
window['require'].config({
map: {
"*" : {
"ipysheet": "nbextensions/ipysheet/index",
"jupyter-js-widgets": "nbextensions/jupyter-js-widgets/extension"
}
}
});
window['require'].config({
map: {
"*" : {
"ipysheet": "nbextensions/ipysheet/index",
"jupyter-js-widgets": "nbextensions/jupyter-js-widgets/extension"
}
}
});
}

// Export the required load_ipython_extention
Expand Down
18 changes: 2 additions & 16 deletions js/src/labplugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as sheet from './sheet';
import * as renderer from './renderer';
import * as base from '@jupyter-widgets/base';
import {version} from './version';
import * as sheet from './sheet';

const ipysheetPlugin = {
id: 'ipysheet',
Expand All @@ -16,17 +15,4 @@ const ipysheetPlugin = {
autoStart: true
};

const rendererPlugin = {
id: 'ipysheet:renderer',
requires: [base.IJupyterWidgetRegistry],
activate: function(app, widgets) {
widgets.registerWidget({
name: 'ipysheet/renderer',
version: version,
exports: renderer
});
},
autoStart: true
};

export default [ipysheetPlugin, rendererPlugin];
export default ipysheetPlugin;
4 changes: 2 additions & 2 deletions js/src/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as widgets from '@jupyter-widgets/base';
import * as Handsontable from 'handsontable';
import {extend} from 'lodash';
import {version, semver_range} from './version';
import {semver_range} from './version';
import {safeEval} from './worker_eval';

let RendererModel = widgets.WidgetModel.extend({
Expand Down Expand Up @@ -29,5 +29,5 @@ let RendererModel = widgets.WidgetModel.extend({
});

export {
RendererModel, version
RendererModel
};
9 changes: 6 additions & 3 deletions js/src/sheet.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as widgets from '@jupyter-widgets/base';
import {cloneDeep, extend, includes as contains, each, debounce, times, map, unzip as transpose} from 'lodash';
import {semver_range} from './version';
import {RendererModel} from './renderer';
import './widget_cell_type';

// @ts-ignore
import * as Handsontable from 'handsontable';

// CSS
import 'pikaday/css/pikaday.css';
import 'handsontable/dist/handsontable.min.css';
import '@jupyter-widgets/controls/css/materialcolors.css'
import '@jupyter-widgets/controls/css/labvariables.css'
import '@jupyter-widgets/controls/css/materialcolors.css';
import '@jupyter-widgets/controls/css/labvariables.css';
import '../css/custom.css';


Expand Down Expand Up @@ -514,5 +517,5 @@ export {
SheetModel,
SheetView,
CellRangeModel,
Handsontable
RendererModel
};
2 changes: 1 addition & 1 deletion js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"inlineSourceMap": true
},
"include": [
"./src/**/*",
"./src/**/*"
],
"exclude": [
"node_modules",
Expand Down

0 comments on commit 6ba975e

Please sign in to comment.