Browse Source

Update cell handling

Steven Silvester 9 years ago
parent
commit
9945e90e4f
5 changed files with 27 additions and 14 deletions
  1. 17 0
      examples/lab/index.css
  2. 1 0
      examples/lab/index.html
  3. 1 1
      package.json
  4. 2 12
      src/default-theme/notebook.css
  5. 6 1
      src/notebook/plugin.ts

+ 17 - 0
examples/lab/index.css

@@ -0,0 +1,17 @@
+.jp-Cell.jp-selected-cell {
+  border-color: #66BB6A;
+  border-left-width: 1px;
+  padding-left: 10px;
+  background: linear-gradient(to right, #66BB6A -40px, #66BB6A 5px, transparent 5px, transparent 100%);
+}
+
+
+.jp-Cell {
+  padding-top: 10px;
+  padding-bottom: 10px;
+  padding-left: 10px;
+  padding-right: 10px;
+  border-width: 1px;
+  border-style: solid;
+  border-color: transparent;
+}

+ 1 - 0
examples/lab/index.html

@@ -6,6 +6,7 @@
   <script id='jupyter-config-data' type="application/json">{ "baseUrl": "{{base_url}}", "wsUrl": "{{ws_url}}" }</script>
   <script src="build/bundle.js" main="index"></script>
   <link rel="stylesheet" type="text/css" href="build/index.css">
+  <link rel="stylesheet" type="text/css" href="index.css">
 </head>
 <body>
 </body>

+ 1 - 1
package.json

@@ -10,7 +10,7 @@
     "jquery-ui": "^1.10.5",
     "jupyter-js-docmanager": "^0.2.1",
     "jupyter-js-filebrowser": "^0.9.0",
-    "jupyter-js-notebook": "^0.5.10",
+    "jupyter-js-notebook": "^0.5.13",
     "jupyter-js-services": "^0.5.0",
     "jupyter-js-terminal": "^0.1.15",
     "jupyter-js-utils": "^0.3.0",

+ 2 - 12
src/default-theme/notebook.css

@@ -27,16 +27,6 @@
 }
 
 
-.jp-Cell.jp-selected-cell {
-  border-color: #ababab;
-  border-left-width: 0px;
-  padding-left: 6px;
-  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 5px, transparent 5px, transparent 100%);
-}
-
-
-.jp-Cell {
-  padding-top: 10px;
-  padding-left: 10px;
-  padding-right: 10px;
+.jp-MarkdownCell {
+  outline: 0;
 }

+ 6 - 1
src/notebook/plugin.ts

@@ -185,6 +185,11 @@ function renderSelectedCell(model: INotebookModel)  {
   if (isMarkdownCellModel(cell)) {
     cell.rendered = true;
   }
+  if (model.selectedCellIndex === model.cells.length - 1) {
+    let cell = model.createCodeCell();
+    model.cells.add(cell);
+  }
+  model.selectNextCell();
 }
 
 
@@ -234,7 +239,7 @@ class NotebookContainer extends Panel {
   setSession(value: INotebookSession) {
     this._session = value;
 
-    this._session.kernel.registerCommTarget('jupyter.widget', (comm, msg) => {
+    this._session.kernel.registerCommTarget('ipython.widget', (comm, msg) => {
       console.log('comm message', msg);
 
       let modelPromise = this._manager.handle_comm_open(comm, msg);