1
1
import '@jupyterlab/application/style/index.css' ;
2
2
import '@jupyterlab/theme-light-extension/style/index.css' ;
3
3
import '@jupyterlab/notebook/style/index.css' ;
4
- import '@jupyterlab/notebook/style/base.css' ;
5
4
import '../styles/notebook.css' ;
6
5
import '../styles/index.css' ;
7
6
@@ -30,8 +29,6 @@ export class ClarityWidget extends Widget {
30
29
this . addShortcuts ( ) ;
31
30
this . layout = new BoxLayout ( { spacing :0 , direction :"top-to-bottom" } ) ;
32
31
this . setup ( ) ;
33
- this . _content ;
34
- this . _toolbar ;
35
32
}
36
33
37
34
setup = ( ) => {
@@ -41,13 +38,8 @@ export class ClarityWidget extends Widget {
41
38
this . addClass ( "jp-Document" ) ;
42
39
this . addClass ( "jp-NotebookPanel" ) ;
43
40
let children = this . nbWidget . children ( ) ;
44
- const toolbar = ( this . _toolbar = children . next ( ) as Toolbar ) ;
45
- //let toolChild = tools.children();
46
- //let tool = toolChild.next();
47
- // while (!tool.node.className.includes("jp-KernelName")) {
48
- // tool = toolChild.next();
49
- // }
50
- const content = ( this . _content = children . next ( ) as Notebook ) ;
41
+ const toolbar = children . next ( ) as Toolbar ;
42
+ const content = children . next ( ) as Notebook ;
51
43
BoxLayout . setStretch ( toolbar , 0 ) ;
52
44
BoxLayout . setStretch ( content , 1 ) ;
53
45
layout . addWidget ( toolbar ) ;
@@ -74,7 +66,6 @@ export class ClarityWidget extends Widget {
74
66
const commandMode = '.jp-Notebook.jp-mod-commandMode:focus' ;
75
67
const editMode = '.jp-Notebook.jp-mod-editMode' ;
76
68
let bindings = [
77
- // Tab / code completor shortcuts
78
69
{
79
70
selector : editModeWithCompleter ,
80
71
keys : [ 'Tab' ] ,
@@ -85,20 +76,16 @@ export class ClarityWidget extends Widget {
85
76
keys : [ 'Enter' ] ,
86
77
command : CmdIds . selectNotebook
87
78
} ,
88
- // General shortcut available at all times
89
79
{ selector : all , keys : [ 'Shift Enter' ] , command : CmdIds . runAndAdvance } ,
90
80
] ;
91
81
const editModeShortcuts = [
92
- // Shortcuts available in edit mode
93
82
{ keys : [ 'Ctrl Shift -' ] , command : CmdIds . split } ,
94
83
{ keys : [ 'Escape' ] , command : CmdIds . commandMode }
95
84
] ;
96
85
97
86
const commandModeShortcuts = [
98
- // Kernel related shortcuts
99
87
{ keys : [ 'I' , 'I' ] , command : CmdIds . interrupt } ,
100
88
{ keys : [ '0' , '0' ] , command : CmdIds . restart } ,
101
- // Cell operation shortcuts
102
89
{ keys : [ 'Enter' ] , command : CmdIds . editMode } ,
103
90
{ keys : [ 'Shift M' ] , command : CmdIds . merge } ,
104
91
{ keys : [ 'Shift K' ] , command : CmdIds . extendAbove } ,
@@ -107,12 +94,10 @@ export class ClarityWidget extends Widget {
107
94
{ keys : [ 'B' ] , command : CmdIds . insertBelow } ,
108
95
{ keys : [ 'R' , 'R' ] , command : CmdIds . restartAndRunAll } ,
109
96
{ keys : [ 'D' , 'D' ] , command : CmdIds . deleteCell } ,
110
- // Cell movement shortcuts
111
97
{ keys : [ 'J' ] , command : CmdIds . selectBelow } ,
112
98
{ keys : [ 'ArrowDown' ] , command : CmdIds . selectBelow } ,
113
99
{ keys : [ 'K' ] , command : CmdIds . selectAbove } ,
114
100
{ keys : [ 'ArrowUp' ] , command : CmdIds . selectAbove } ,
115
- // Other shortcuts
116
101
{ keys : [ 'Z' ] , command : CmdIds . undo } ,
117
102
{ keys : [ 'Y' ] , command : CmdIds . redo }
118
103
] ;
@@ -239,8 +224,6 @@ export class ClarityWidget extends Widget {
239
224
240
225
private commands : CommandRegistry ;
241
226
private nbWidget : NotebookPanel ;
242
- private _toolbar : Toolbar ;
243
- private _content : Notebook ;
244
227
}
245
228
246
229
const CmdIds = {
0 commit comments