##// END OF EJS Templates
Starting to refactor the notebook layout
Brian E. Granger -
Show More
@@ -1,220 +1,238 b''
1 1 /**
2 2 * HTML5 ✰ Boilerplate
3 3 *
4 4 * style.css contains a reset, font normalization and some base styles.
5 5 *
6 6 * Credit is left where credit is due.
7 7 * Much inspiration was taken from these projects:
8 8 * - yui.yahooapis.com/2.8.1/build/base/base.css
9 9 * - camendesign.com/design/
10 10 * - praegnanz.de/weblog/htmlcssjs-kickstart
11 11 */
12 12
13 13
14 14 /**
15 15 * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
16 16 * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
17 17 * html5doctor.com/html-5-reset-stylesheet/
18 18 */
19 19
20 20 html, body, div, span, object, iframe,
21 21 h1, h2, h3, h4, h5, h6, p, blockquote, pre,
22 22 abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
23 23 small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
24 24 fieldset, form, label, legend,
25 25 table, caption, tbody, tfoot, thead, tr, th, td,
26 26 article, aside, canvas, details, figcaption, figure,
27 27 footer, header, hgroup, menu, nav, section, summary,
28 28 time, mark, audio, video {
29 29 margin: 0;
30 30 padding: 0;
31 31 border: 0;
32 32 /* font-size: 100%;*/
33 33 font: inherit;
34 34 vertical-align: baseline;
35 35 }
36 36
37 37 article, aside, details, figcaption, figure,
38 38 footer, header, hgroup, menu, nav, section {
39 39 display: block;
40 40 }
41 41
42 42 blockquote, q { quotes: none; }
43 43
44 44 blockquote:before, blockquote:after,
45 45 q:before, q:after { content: ""; content: none; }
46 46
47 47 ins { background-color: #ff9; color: #000; text-decoration: none; }
48 48
49 49 mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
50 50
51 51 del { text-decoration: line-through; }
52 52
53 53 abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
54 54
55 55 table { border-collapse: collapse; border-spacing: 0; }
56 56
57 57 hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
58 58
59 59 input, select { vertical-align: middle; }
60 60
61 61 body {
62 62 background-color: white;
63 63 /* This won't propagate to all children so we also set it below */
64 64 font-size: 12pt;
65 65 /* This makes sure that the body covers the entire window and needs to
66 66 be in a different element than the display: box in wrapper below */
67 67 position: absolute;
68 68 left: 0px;
69 69 right: 0px;
70 70 top: 0px;
71 71 bottom: 0px;
72 overflow: hidden;
72 73 }
73 74
74 75 div#wrapper {
75 76 /* This is needed to make sure the wrapper fills the body */
76 77 width: 100%;
77 78 height: 100%;
78 79 }
79 80
80 81 span#ipython_notebook h1 {
81 82 font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
82 font-size: 26pt;
83 font-size: 22pt;
83 84 padding: 10px;
84 85 margin: 10px;
85 86 }
86 87
87 88 div#tools {
88 89 font-size: 11pt;
89 90 }
90 91
91 92 span#kernel_status {
92 93 position: absolute;
93 94 top: 12%;
94 95 right: 10px;
95 96 font-weight: bold;
96 97 }
97 98
98 99 .status_idle {
99 100 color: gray;
100 101 }
101 102
102 103 .status_busy {
103 104 color: red;
104 105 }
105 106
106 107 .status_restarting {
107 108 color: black;
108 109 }
109 110
110 div.notebook {
111 /* This is a trick from Google Docs. We set the height artificially low
112 and set overflow-y: auto to force scrolling of this dev when needed,
113 but prevent the browser window from scrolling. Crazy hack */
114 height: 15px;
111 div#notebook_app {
112 }
113
114 div#left_panel {
115 width: 200px;
115 116 overflow-y: auto;
116 overflow-x: hidden;
117 }
118
119 div#pager_splitter {
120 height: 7px;
121 }
122
123 div#left_panel_splitter {
124 width: 7px;
125 }
126
127 div#pager {
128 height: 200px;
129 overflow: auto;
130
131 }
132
133 div#notebook {
134 overflow-y: scroll;
135 overflow-x: auto;
117 136 padding: 0px 40px;
118 137 background-color: white;
119 138 font-size: 12pt;
120 139 }
121 140
122 141 .monospace-font {
123 142 font-family: monospace;
124 /* font-family: Monaco, Consolas, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace;*/
125 143 font-size: 12pt;
126 144 }
127 145
128 146 div.cell {
129 147 width: 100%;
130 148 padding: 5px;
131 149 /* This acts as a spacer between cells, that is outside the border */
132 150 margin: 15px 0px 15px 0px;
133 151 position: relative;
134 152 }
135 153
136 154 div.code_cell {
137 155 background-color: white;
138 156 }
139 157
140 158 div.prompt {
141 159 width: 90px;
142 160 padding: 0px;
143 161 margin: 0px;
144 162 }
145 163
146 164 div.input_prompt {
147 165 color: navy;
148 166 }
149 167
150 168 div.output {
151 169 /* This is a spacer between the input and output of each cell */
152 170 margin-top: 15px;
153 171 }
154 172
155 173 div.output_prompt {
156 174 color: darkred;
157 175 }
158 176
159 177 div.output_area {
160 178 text-align: left;
161 179 color: black;
162 180 }
163 181
164 182 div.output_latex {
165 183 /* Slightly bigger than the rest of the notebook */
166 184 font-size: 13pt;
167 185 }
168 186
169 187 div.output_png {
170 188 }
171 189
172 190 div.text_cell {
173 191 background-color: white;
174 192 }
175 193
176 194 textarea.text_cell_input {
177 195 /* Slightly bigger than the rest of the notebook */
178 196 font-size: 13pt;
179 197 outline: none;
180 198 resize: none;
181 199 width: inherit;
182 200 border-style: none;
183 201 padding: 0px;
184 202 margin: 0px;
185 203 color: black;
186 204 }
187 205
188 206 div.text_cell_render {
189 207 font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
190 208 /* Slightly bigger than the rest of the notebook */
191 209 font-size: 13pt;
192 210 outline: none;
193 211 resize: none;
194 212 width: inherit;
195 213 border-style: none;
196 214 padding: 5px;
197 215 color: black;
198 216 }
199 217
200 218 div.text_cell_render em {font-style: italic;}
201 219 div.text_cell_render strong {font-weight: bold;}
202 220 div.text_cell_render u {text-decoration: underline;}
203 221 div.text_cell_render :link { text-decoration: underline }
204 222 div.text_cell_render :visited { text-decoration: underline }
205 223 div.text_cell_render h1 {font-size: 2.0em; margin: .67em 0; font-weight: bold;}
206 224 div.text_cell_render h2 {font-size: 1.5em; margin: .75em 0; font-weight: bold;}
207 225 div.text_cell_render h3 {font-size: 1.17em; margin: .83em 0; font-weight: bold;}
208 226 div.text_cell_render h4 {margin: 1.12em 0; font-weight: bold;}
209 227 div.text_cell_render h5 {font-size: .83em; margin: 1.5em 0; font-weight: bold;}
210 228 div.text_cell_render h6 {font-size: .75em; margin: 1.67em 0; font-weight: bold;}
211 229 div.text_cell_render ul {list-style:disc; margin-left: 40px;}
212 230 div.text_cell_render ul ul {list-style:square; margin-left: 40px;}
213 231 div.text_cell_render ul ul ul {list-style:circle; margin-left: 40px;}
214 232 div.text_cell_render ol {list-style:upper-roman; margin-left: 40px;}
215 233 div.text_cell_render ol ol {list-style:upper-alpha;}
216 234 div.text_cell_render ol ol ol {list-style:decimal;}
217 235 div.text_cell_render ol ol ol ol {list-style:lower-alpha;}
218 236 div.text_cell_render ol ol ol ol ol {list-style:lower-roman;}
219 237
220 238
@@ -1,62 +1,96 b''
1 1
2 2 //============================================================================
3 3 // On document ready
4 4 //============================================================================
5 5
6 6
7 7 $(document).ready(function () {
8 8
9 9 $('div#wrapper').addClass('vbox border-box-sizing')
10 $('div.notebook').addClass('box-flex1 border-box-sizing')
10 $('div#notebook_app').addClass('hbox box-flex1 border-box-sizing')
11 $('div#left_panel').addClass('vbox border-box-sizing ui-widget ui-widget-content')
12 $('div#pager_splitter').addClass('border-box-sizing ui-widget ui-widget-header')
13 $('div#notebook_panel').addClass('vbox box-flex1 border-box-sizing ui-widget ui-widget-content')
14 $('div#notebook').addClass('vbox box-flex1 border-box-sizing')
15 $('div#left_panel_splitter').addClass('border-box-sizing ui-widget ui-widget-header')
16 $('div#pager').addClass('border-box-sizing')
17
18 $('div#pager_splitter').click(function () {
19 $('div#pager').toggle('fast');
20 });
21
22 $('div#pager_splitter').hover(
23 function () {
24 $('div#pager_splitter').addClass('ui-state-hover');
25 },
26 function () {
27 $('div#pager_splitter').removeClass('ui-state-hover');
28 }
29 );
30
31 $('div#pager').hide();
32
33 $('div#left_panel_splitter').click(function () {
34 $('div#left_panel').toggle('fast');
35 });
36
37 $('div#left_panel_splitter').hover(
38 function () {
39 $('div#left_panel_splitter').addClass('ui-state-hover');
40 },
41 function () {
42 $('div#left_panel_splitter').removeClass('ui-state-hover');
43 }
44 );
11 45
12 46 MathJax.Hub.Config({
13 47 tex2jax: {
14 48 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
15 49 displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
16 50 },
17 51 displayAlign: 'left', // Change this to 'center' to center equations.
18 52 "HTML-CSS": {
19 53 styles: {'.MathJax_Display': {"margin": 0}}
20 54 }
21 55 });
22 56
23 IPython.notebook = new IPython.Notebook('div.notebook');
57 IPython.notebook = new IPython.Notebook('div#notebook');
24 58 IPython.notebook.insert_code_cell_after();
25 59
26 60 $("#menu_tabs").tabs();
27 61
28 62 $("#help_toolbar").buttonset();
29 63
30 64 $("#kernel_toolbar").buttonset();
31 65 $("#interrupt_kernel").click(function () {IPython.notebook.kernel.interrupt();});
32 66 $("#restart_kernel").click(function () {IPython.notebook.kernel.restart();});
33 67 $("#kernel_status").addClass("status_idle");
34 68
35 69 $("#move_cell").buttonset();
36 70 $("#move_up").button("option", "icons", {primary:"ui-icon-arrowthick-1-n"});
37 71 $("#move_up").button("option", "text", false);
38 72 $("#move_up").click(function () {IPython.notebook.move_cell_up();});
39 73 $("#move_down").button("option", "icons", {primary:"ui-icon-arrowthick-1-s"});
40 74 $("#move_down").button("option", "text", false);
41 75 $("#move_down").click(function () {IPython.notebook.move_cell_down();});
42 76
43 77 $("#insert_delete").buttonset();
44 78 $("#insert_cell_before").click(function () {IPython.notebook.insert_code_cell_before();});
45 79 $("#insert_cell_after").click(function () {IPython.notebook.insert_code_cell_after();});
46 80 $("#delete_cell").button("option", "icons", {primary:"ui-icon-closethick"});
47 81 $("#delete_cell").button("option", "text", false);
48 82 $("#delete_cell").click(function () {IPython.notebook.delete_cell();});
49 83
50 84 $("#cell_type").buttonset();
51 85 $("#to_code").click(function () {IPython.notebook.text_to_code();});
52 86 $("#to_text").click(function () {IPython.notebook.code_to_text();});
53 87
54 88 $("#sort").buttonset();
55 89 $("#sort_cells").click(function () {IPython.notebook.sort_cells();});
56 90
57 91 $("#toggle").buttonset();
58 92 $("#collapse").click(function () {IPython.notebook.collapse();});
59 93 $("#expand").click(function () {IPython.notebook.expand();});
60 94
61 95 });
62 96
@@ -1,112 +1,123 b''
1 1 <!DOCTYPE HTML>
2 2 <html>
3 3
4 4 <head>
5 5 <meta charset="utf-8">
6 6
7 7 <title>IPython Notebook</title>
8 8
9 9 <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" />
10 10 <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> -->
11 11 <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.11.custom.css" type="text/css" /> -->
12 12
13 13 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script>
14 14 <!-- <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script> -->
15 15 <script type="text/javascript">
16 16 if (typeof MathJax == 'undefined') {
17 17 console.log("Trying to load local copy of MathJax");
18 18 document.write(unescape("%3Cscript type='text/javascript' src='static/mathjax/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E"));
19 19 }
20 20 </script>
21 21
22 22 <link rel="stylesheet" href="static/codemirror2/lib/codemirror.css">
23 23 <link rel="stylesheet" href="static/codemirror2/mode/python/python.css">
24 24
25 25 <link rel="stylesheet" href="static/css/layout.css" type="text/css" />
26 26 <link rel="stylesheet" href="static/css/notebook.css" type="text/css" />
27 27
28 28 </head>
29 29
30 30 <body>
31 31
32 32 <div id="wrapper">
33 33
34 34 <div id="header">
35 <span id="ipython_notebook"><h1>[I]:Python Notebook</h1></span>
35 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
36 36 </div>
37 37
38 <div id="notebook_app">
38 39
39 <div id="tools">
40
41 <div id="menu_tabs">
42 <span id="kernel_status">Idle</span>
43 <ul>
44 <li><a href="#cell_tab">Cell</a></li>
45 <li><a href="#kernel_tab">Kernel</a></li>
46 <li><a href="#help_tab">Help</a></li>
47 </ul>
48 <div id="cell_tab">
49 <span id="cell_toolbar">
50 <span id="move_cell">
51 <button id="move_up">Move up</button>
52 <button id="move_down">Move down</button>
53 </span>
54 <span id="insert_delete">
55 <button id="insert_cell_before">Before</button>
56 <button id="insert_cell_after">After</button>
57 <button id="delete_cell">Delete</button>
58 </span>
59 <span id="cell_type">
60 <button id="to_code">Code</button>
61 <button id="to_text">Text</button>
62 </span>
63 <span id="sort">
64 <button id="sort_cells">Sort</button>
65 </span>
66 <span id="toggle">
67 <button id="collapse">Collapse</button>
68 <button id="expand">Expand</button>
69 </span>
70 </span>
40 <div id="left_panel"></div>
41 <div id="left_panel_splitter"></div>
42 <div id="notebook_panel">
43 <div id="notebook"></div>
44 <div id="pager_splitter"></div>
45 <div id="pager">This is a test</div>
71 46 </div>
72 <div id="kernel_tab">
73 <span id="kernel_toolbar">
74 <button id="interrupt_kernel">Interrupt</button>
75 <button id="restart_kernel">Restart</button>
76 </span>
77 </div>
78 <div id="help_tab">
79 <span id="help_toolbar">
80 <button><a href="http://docs.python.org" target="_blank">Python</a></button>
81 <button><a href="http://ipython.github.com/ipython-doc/dev/index.html" target="_blank">IPython</a></button>
82 <button><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></button>
83 <button><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></button>
84 <button><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></button>
85 <button><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></button>
86 </span>
87 </div>
88 </div>
89 47
90 48 </div>
91 49
92 <div class="notebook"></div>
93
94 50 </div>
95 51
96 52 <script src="static/jquery/js/jquery-1.5.1.min.js" type="text/javascript" charset="utf-8"></script>
97 53 <script src="static/jquery/js/jquery-ui-1.8.11.custom.min.js" type="text/javascript" charset="utf-8"></script>
98 54 <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script>
99 55 <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script>
100 56 <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script>
101 57 <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script>
102 58 <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script>
103 59 <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script>
104 60 <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script>
105 61 <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script>
106 62 <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script>
107 63 <script src="static/codemirror2/lib/codemirror.js"></script>
108 64 <script src="static/codemirror2/mode/python/python.js"></script>
109 65
110 66 </body>
111 67
112 68 </html>
69
70
71 <!--<div id="tools">-->
72
73 <!--<div id="menu_tabs">-->
74 <!-- <span id="kernel_status">Idle</span>-->
75 <!-- <ul>-->
76 <!-- <li><a href="#cell_tab">Cell</a></li>-->
77 <!-- <li><a href="#kernel_tab">Kernel</a></li>-->
78 <!-- <li><a href="#help_tab">Help</a></li>-->
79 <!-- </ul>-->
80 <!-- <div id="cell_tab">-->
81 <!-- <span id="cell_toolbar">-->
82 <!-- <span id="move_cell">-->
83 <!-- <button id="move_up">Move up</button>-->
84 <!-- <button id="move_down">Move down</button>-->
85 <!-- </span>-->
86 <!-- <span id="insert_delete">-->
87 <!-- <button id="insert_cell_before">Before</button>-->
88 <!-- <button id="insert_cell_after">After</button>-->
89 <!-- <button id="delete_cell">Delete</button>-->
90 <!-- </span>-->
91 <!-- <span id="cell_type">-->
92 <!-- <button id="to_code">Code</button>-->
93 <!-- <button id="to_text">Text</button>-->
94 <!-- </span>-->
95 <!-- <span id="sort">-->
96 <!-- <button id="sort_cells">Sort</button>-->
97 <!-- </span>-->
98 <!-- <span id="toggle">-->
99 <!-- <button id="collapse">Collapse</button>-->
100 <!-- <button id="expand">Expand</button>-->
101 <!-- </span>-->
102 <!-- </span>-->
103 <!-- </div>-->
104 <!-- <div id="kernel_tab">-->
105 <!-- <span id="kernel_toolbar">-->
106 <!-- <button id="interrupt_kernel">Interrupt</button>-->
107 <!-- <button id="restart_kernel">Restart</button>-->
108 <!-- </span>-->
109 <!-- </div>-->
110 <!-- <div id="help_tab">-->
111 <!-- <span id="help_toolbar">-->
112 <!-- <button><a href="http://docs.python.org" target="_blank">Python</a></button>-->
113 <!-- <button><a href="http://ipython.github.com/ipython-doc/dev/index.html" target="_blank">IPython</a></button>-->
114 <!-- <button><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></button>-->
115 <!-- <button><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></button>-->
116 <!-- <button><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></button>-->
117 <!-- <button><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></button>-->
118 <!-- </span>-->
119 <!-- </div>-->
120 <!--</div>-->
121
122 <!--</div>-->
123
General Comments 0
You need to be logged in to leave comments. Login now