Pārlūkot izejas kodu

Upgrade to js-notebook 0.12

Steven Silvester 9 gadi atpakaļ
vecāks
revīzija
6f100315c3
3 mainītis faili ar 8 papildinājumiem un 8 dzēšanām
  1. 1 1
      package.json
  2. 6 6
      src/notebook/plugin.ts
  3. 1 1
      src/readonly-notebook/plugin.ts

+ 1 - 1
package.json

@@ -8,7 +8,7 @@
     "codemirror": "^5.10.0",
     "jquery": "^2.2.0",
     "jquery-ui": "^1.10.5",
-    "jupyter-js-notebook": "^0.11.0",
+    "jupyter-js-notebook": "^0.12.0",
     "jupyter-js-services": "^0.5.0",
     "jupyter-js-ui": "^0.2.0",
     "jupyter-js-utils": "^0.3.0",

+ 6 - 6
src/notebook/plugin.ts

@@ -74,7 +74,7 @@ function activateNotebookHandler(app: Application, manager: DocumentManager, ser
   manager.register(handler);
   app.commands.add([{
     id: runCellCommandId,
-    handler: () => handler.runSelectedCell()
+    handler: () => handler.runActiveCell()
   }]);
   app.palette.add([{
     command: runCellCommandId,
@@ -94,9 +94,9 @@ class NotebookContainer extends Panel {
   /**
    * Construct a new NotebookContainer.
    */
-  constructor() {
+  constructor(manager: IContentsManager) {
     super();
-    this._model = new NotebookModel();
+    this._model = new NotebookModel(manager);
     let widgetarea = new Widget();
     this._manager = new WidgetManager(widgetarea.node);
     let widget = new NotebookWidget(this._model);
@@ -177,9 +177,9 @@ class NotebookFileHandler extends AbstractFileHandler<NotebookContainer> {
   /**
    * Run the selected cell on the active widget.
    */
-  runSelectedCell(): void {
+  runActiveCell(): void {
     let w = this.activeWidget;
-    if (w) w.model.runSelectedCell();
+    if (w) w.model.runActiveCell();
   }
 
   /**
@@ -223,7 +223,7 @@ class NotebookFileHandler extends AbstractFileHandler<NotebookContainer> {
    * Create the widget from an `IContentsModel`.
    */
   protected createWidget(contents: IContentsModel): NotebookContainer {
-    let panel = new NotebookContainer();
+    let panel = new NotebookContainer(this.manager);
     panel.model.stateChanged.connect(this._onModelChanged, this);
     panel.title.text = contents.name;
     panel.addClass(notebookContainerClass);

+ 1 - 1
src/readonly-notebook/plugin.ts

@@ -86,7 +86,7 @@ class NotebookFileHandler extends AbstractFileHandler<NotebookWidget> {
    * Create the widget from an `IContentsModel`.
    */
   protected createWidget(contents: IContentsModel): NotebookWidget {
-    let model = new NotebookModel();
+    let model = new NotebookModel(this.manager);
     model.readOnly = true;
     return new NotebookWidget(model);
   }