##// END OF EJS Templates
More work updating the notebook to use dynamics resizing.
Brian E. Granger -
Show More
@@ -72,17 +72,14 b' body {'
72 overflow: hidden;
72 overflow: hidden;
73 }
73 }
74
74
75 div#wrapper {
76 /* This is needed to make sure the wrapper fills the body */
77 width: 100%;
78 height: 100%;
79 }
80
75
81 span#ipython_notebook h1 {
76 span#ipython_notebook h1 {
82 font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
77 font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
83 font-size: 22pt;
78 font-size: 22pt;
84 padding: 10px;
79 height: 35px;
85 margin: 10px;
80 padding: 5px;
81 margin: 0px;
82
86 }
83 }
87
84
88 div#tools {
85 div#tools {
@@ -110,35 +107,53 b' span#kernel_status {'
110
107
111 div#notebook_app {
108 div#notebook_app {
112 width: 100%;
109 width: 100%;
110 position: relative;
113 }
111 }
114
112
115 div#left_panel {
113 div#left_panel {
116 width: 200px;
114 width: 200px;
115 min-height: 300px;
117 overflow-y: auto;
116 overflow-y: auto;
118 }
117 top: 0px;
119
118 left: 0px;
120 div#pager_splitter {
119 margin: 0px;
121 height: 7px;
120 padding: 0px;
121 position: absolute;
122 }
122 }
123
123
124 div#left_panel_splitter {
124 div#left_panel_splitter {
125 width: 7px;
125 width: 7px;
126 top: 0px;
127 left: 202px;
128 margin: 0px;
129 padding: 0px;
130 position: absolute;
126 }
131 }
127
132
128 div#pager {
133 div#notebook_panel {
129 height: 200px;
134 margin: 0px 0px 0px 211px;
130 overflow: auto;
135 padding: 0px;
131 padding: 15px;
132 }
136 }
133
137
134 div#notebook {
138 div#notebook {
135 overflow-y: scroll;
139 overflow-y: scroll;
136 overflow-x: auto;
140 overflow-x: auto;
137 padding: 0px 15px;
141 width: 100%;
142 padding: 0px 0px;
143 margin: 0px
138 background-color: white;
144 background-color: white;
139 font-size: 12pt;
145 font-size: 12pt;
140 }
146 }
141
147
148 div#pager_splitter {
149 height: 7px;
150 }
151
152 div#pager {
153 height: 200px;
154 overflow: auto;
155 }
156
142 .monospace-font {
157 .monospace-font {
143 font-family: monospace;
158 font-family: monospace;
144 font-size: 12pt;
159 font-size: 12pt;
@@ -146,10 +161,9 b' div#notebook {'
146
161
147 div.cell {
162 div.cell {
148 width: 100%;
163 width: 100%;
149 padding: 5px;
164 padding: 0px;
150 /* This acts as a spacer between cells, that is outside the border */
165 /* This acts as a spacer between cells, that is outside the border */
151 margin: 15px 0px 15px 0px;
166 margin: 15px 0px 15px 0px;
152 position: relative;
153 }
167 }
154
168
155 div.code_cell {
169 div.code_cell {
@@ -18,17 +18,17 b' var IPython = (function (IPython) {'
18
18
19
19
20 CodeCell.prototype.create_element = function () {
20 CodeCell.prototype.create_element = function () {
21 var cell = $('<div></div>').addClass('cell code_cell vbox border-box-sizing');
21 var cell = $('<div></div>').addClass('cell code_cell vbox');
22 var input = $('<div></div>').addClass('input hbox border-box-sizing');
22 var input = $('<div></div>').addClass('input hbox');
23 input.append($('<div/>').addClass('prompt input_prompt monospace-font'));
23 input.append($('<div/>').addClass('prompt input_prompt monospace-font'));
24 var input_area = $('<div/>').addClass('input_area box-flex1 border-box-sizing');
24 var input_area = $('<div/>').addClass('input_area box-flex1');
25 this.code_mirror = CodeMirror(input_area.get(0), {
25 this.code_mirror = CodeMirror(input_area.get(0), {
26 indentUnit : 4,
26 indentUnit : 4,
27 enterMode : 'flat',
27 enterMode : 'flat',
28 tabMode: 'shift'
28 tabMode: 'shift'
29 });
29 });
30 input.append(input_area);
30 input.append(input_area);
31 var output = $('<div></div>').addClass('output vbox border-box-sizing');
31 var output = $('<div></div>').addClass('output vbox');
32 cell.append(input).append(output);
32 cell.append(input).append(output);
33 this.element = cell;
33 this.element = cell;
34 this.collapse()
34 this.collapse()
@@ -25,9 +25,6 b' var IPython = (function (IPython) {'
25
25
26
26
27 Notebook.prototype.style = function () {
27 Notebook.prototype.style = function () {
28 // With vbox here Chrome exhibits the CodeMirror scroll bug.
29 // Without the vbox here, Firefox won't scroll the notebook div.
30 this.element.addClass('vbox box-flex1 border-box-sizing');
31 };
28 };
32
29
33
30
@@ -6,11 +6,11 b''
6
6
7 $(document).ready(function () {
7 $(document).ready(function () {
8
8
9 $('div#wrapper').addClass('vbox border-box-sizing')
9
10 $('div#notebook_app').addClass('hbox box-flex1 border-box-sizing')
10 $('div#notebook_app').addClass('ui-widget ui-widget-content')
11 $('div#left_panel').addClass('vbox border-box-sizing ui-widget ui-widget-content')
11 $('div#left_panel').addClass('ui-widget')
12 $('div#left_panel_splitter').addClass('border-box-sizing ui-widget ui-widget-header')
12 $('div#left_panel_splitter').addClass('ui-widget ui-widget-content')
13 $('div#notebook_panel').addClass('vbox box-flex1 border-box-sizing ui-widget ui-widget-content')
13 $('div#notebook_panel').addClass('ui-widget')
14
14
15 $('div#left_panel_splitter').click(function () {
15 $('div#left_panel_splitter').click(function () {
16 $('div#left_panel').toggle('fast');
16 $('div#left_panel').toggle('fast');
@@ -36,16 +36,27 b' $(document).ready(function () {'
36 }
36 }
37 });
37 });
38
38
39 // $('div#notebook').scroll(function (e) {
39 var do_resize = function () {
40 // console.log(e);
40 var win = $(window);
41 // e.preventDefault();
41 var w = win.width();
42 // });
42 var h = win.height();
43 var app_height = h - 50;
44 $('div#notebook_app').height(app_height);
45 $('div#left_panel').height(app_height);
46 $('div#left_panel_splitter').height(app_height);
47 $('div#notebook_panel').height(app_height);
48 $('div#notebook').height(app_height-211);
49 };
50
51 $(window).resize(do_resize);
43
52
44 IPython.notebook = new IPython.Notebook('div#notebook');
53 IPython.notebook = new IPython.Notebook('div#notebook');
45 IPython.notebook.insert_code_cell_after();
54 IPython.notebook.insert_code_cell_after();
46
55
47 IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
56 IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
48
57
58 do_resize();
59
49 // $("#menu_tabs").tabs();
60 // $("#menu_tabs").tabs();
50
61
51 // $("#help_toolbar").buttonset();
62 // $("#help_toolbar").buttonset();
@@ -17,8 +17,8 b' var IPython = (function (IPython) {'
17
17
18
18
19 Pager.prototype.style = function () {
19 Pager.prototype.style = function () {
20 this.pager_toggle_element.addClass('border-box-sizing ui-widget ui-widget-header')
20 this.pager_toggle_element.addClass('ui-widget ui-widget-content')
21 this.pager_element.addClass('border-box-sizing')
21 this.pager_element.addClass('')
22 };
22 };
23
23
24
24
@@ -29,8 +29,6 b''
29
29
30 <body>
30 <body>
31
31
32 <div id="wrapper">
33
34 <div id="header">
32 <div id="header">
35 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
33 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
36 </div>
34 </div>
@@ -47,8 +45,6 b''
47
45
48 </div>
46 </div>
49
47
50 </div>
51
52 <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script>
48 <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script>
53 <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
49 <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
54 <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script>
50 <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script>
General Comments 0
You need to be logged in to leave comments. Login now