Show More
@@ -1,379 +1,399 b'' | |||
|
1 | 1 | /** |
|
2 | 2 | * Primary styles |
|
3 | 3 | * |
|
4 | 4 | * Author: IPython Development Team |
|
5 | 5 | */ |
|
6 | 6 | |
|
7 | 7 | |
|
8 | 8 | body { |
|
9 | 9 | overflow: hidden; |
|
10 | 10 | } |
|
11 | 11 | |
|
12 | 12 | span#save_widget { |
|
13 | 13 | padding: 5px; |
|
14 | 14 | margin: 0px 0px 0px 300px; |
|
15 | 15 | display:inline-block; |
|
16 | 16 | } |
|
17 | 17 | |
|
18 | 18 | span#notebook_name { |
|
19 | 19 | height: 1em; |
|
20 | 20 | line-height: 1em; |
|
21 | 21 | padding: 3px; |
|
22 | 22 | border: none; |
|
23 | 23 | font-size: 146.5%; |
|
24 | 24 | } |
|
25 | 25 | |
|
26 | 26 | .ui-menubar-item .ui-button .ui-button-text { |
|
27 | 27 | padding: 0.4em 1.0em; |
|
28 | 28 | font-size: 100%; |
|
29 | 29 | } |
|
30 | 30 | |
|
31 | 31 | .ui-menu { |
|
32 | 32 | -moz-box-shadow: 0px 6px 10px -1px #adadad; |
|
33 | 33 | -webkit-box-shadow: 0px 6px 10px -1px #adadad; |
|
34 | 34 | box-shadow: 0px 6px 10px -1px #adadad; |
|
35 | 35 | } |
|
36 | 36 | |
|
37 | 37 | .ui-menu .ui-menu-item a { |
|
38 | 38 | padding: 2px 1.6em; |
|
39 | 39 | } |
|
40 | 40 | |
|
41 | 41 | .ui-menu hr { |
|
42 | 42 | margin: 0.3em 0; |
|
43 | 43 | } |
|
44 | 44 | |
|
45 | 45 | #menubar_container { |
|
46 | 46 | position: relative; |
|
47 | 47 | } |
|
48 | 48 | |
|
49 | 49 | #notification { |
|
50 | 50 | position: absolute; |
|
51 | 51 | right: 3px; |
|
52 | 52 | top: 3px; |
|
53 | 53 | height: 25px; |
|
54 | 54 | padding: 3px 6px; |
|
55 | 55 | z-index: 10; |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | #toolbar { |
|
59 | 59 | padding: 3px 15px; |
|
60 | 60 | } |
|
61 | 61 | |
|
62 | 62 | #cell_type { |
|
63 | 63 | font-size: 85%; |
|
64 | 64 | } |
|
65 | 65 | |
|
66 | 66 | |
|
67 | 67 | div#main_app { |
|
68 | 68 | width: 100%; |
|
69 | 69 | position: relative; |
|
70 | 70 | } |
|
71 | 71 | |
|
72 | 72 | span#quick_help_area { |
|
73 | 73 | position: static; |
|
74 | 74 | padding: 5px 0px; |
|
75 | 75 | margin: 0px 0px 0px 0px; |
|
76 | 76 | } |
|
77 | 77 | |
|
78 | 78 | .help_string { |
|
79 | 79 | float: right; |
|
80 | 80 | width: 170px; |
|
81 | 81 | padding: 0px 5px; |
|
82 | 82 | text-align: left; |
|
83 | 83 | font-size: 85%; |
|
84 | 84 | } |
|
85 | 85 | |
|
86 | 86 | .help_string_label { |
|
87 | 87 | float: right; |
|
88 | 88 | font-size: 85%; |
|
89 | 89 | } |
|
90 | 90 | |
|
91 | 91 | div#notebook_panel { |
|
92 | 92 | margin: 0px 0px 0px 0px; |
|
93 | 93 | padding: 0px; |
|
94 | 94 | } |
|
95 | 95 | |
|
96 | 96 | div#notebook { |
|
97 | 97 | overflow-y: scroll; |
|
98 | 98 | overflow-x: auto; |
|
99 | 99 | width: 100%; |
|
100 | 100 | /* This spaces the cell away from the edge of the notebook area */ |
|
101 | 101 | padding: 5px 5px 15px 5px; |
|
102 | 102 | margin: 0px |
|
103 | 103 | background-color: white; |
|
104 | 104 | } |
|
105 | 105 | |
|
106 | 106 | div#pager_splitter { |
|
107 | 107 | height: 8px; |
|
108 | 108 | } |
|
109 | 109 | |
|
110 | 110 | div#pager { |
|
111 | 111 | padding: 15px; |
|
112 | 112 | overflow: auto; |
|
113 | 113 | display: none; |
|
114 | 114 | } |
|
115 | 115 | |
|
116 | 116 | div.cell { |
|
117 | 117 | width: 100%; |
|
118 | 118 | padding: 5px 5px 5px 0px; |
|
119 | 119 | /* This acts as a spacer between cells, that is outside the border */ |
|
120 | 120 | margin: 2px 0px 2px 0px; |
|
121 | 121 | } |
|
122 | 122 | |
|
123 | 123 | div.code_cell { |
|
124 | 124 | background-color: white; |
|
125 | 125 | } |
|
126 | 126 | /* any special styling for code cells that are currently running goes here */ |
|
127 | 127 | div.code_cell.running { |
|
128 | 128 | } |
|
129 | 129 | |
|
130 | 130 | div.prompt { |
|
131 | 131 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ |
|
132 | 132 | width: 11ex; |
|
133 | 133 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ |
|
134 | 134 | padding: 0.4em; |
|
135 | 135 | margin: 0px; |
|
136 | 136 | font-family: monospace; |
|
137 | 137 | text-align:right; |
|
138 | 138 | } |
|
139 | 139 | |
|
140 | 140 | div.input { |
|
141 | 141 | page-break-inside: avoid; |
|
142 | 142 | } |
|
143 | 143 | |
|
144 | 144 | /* input_area and input_prompt must match in top border and margin for alignment */ |
|
145 | 145 | div.input_area { |
|
146 | 146 | color: black; |
|
147 | 147 | border: 1px solid #ddd; |
|
148 | 148 | border-radius: 3px; |
|
149 | 149 | background: #f7f7f7; |
|
150 | 150 | } |
|
151 | 151 | |
|
152 | 152 | div.input_prompt { |
|
153 | 153 | color: navy; |
|
154 | 154 | border-top: 1px solid transparent; |
|
155 | 155 | } |
|
156 | 156 | |
|
157 | 157 | div.output { |
|
158 | 158 | /* This is a spacer between the input and output of each cell */ |
|
159 | 159 | margin-top: 5px; |
|
160 | 160 | } |
|
161 | 161 | |
|
162 | 162 | div.output_prompt { |
|
163 | 163 | color: darkred; |
|
164 | 164 | } |
|
165 | 165 | |
|
166 | 166 | /* This class is the outer container of all output sections. */ |
|
167 | 167 | div.output_area { |
|
168 | 168 | padding: 0px; |
|
169 | 169 | page-break-inside: avoid; |
|
170 | 170 | } |
|
171 | 171 | |
|
172 | 172 | /* This class is for the output subarea inside the output_area and after |
|
173 | 173 | the prompt div. */ |
|
174 | 174 | div.output_subarea { |
|
175 | 175 | padding: 0.4em 6.1em 0.4em 0.4em; |
|
176 | 176 | } |
|
177 | 177 | |
|
178 | 178 | /* The rest of the output_* classes are for special styling of the different |
|
179 | 179 | output types */ |
|
180 | 180 | |
|
181 | 181 | /* all text output has this class: */ |
|
182 | 182 | div.output_text { |
|
183 | 183 | text-align: left; |
|
184 | 184 | color: black; |
|
185 | 185 | font-family: monospace; |
|
186 | 186 | } |
|
187 | 187 | |
|
188 | 188 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ |
|
189 | 189 | div.output_stream { |
|
190 | 190 | padding-top: 0.0em; |
|
191 | 191 | padding-bottom: 0.0em; |
|
192 | 192 | } |
|
193 | 193 | div.output_stdout { |
|
194 | 194 | } |
|
195 | 195 | div.output_stderr { |
|
196 | 196 | background: #fdd; /* very light red background for stderr */ |
|
197 | 197 | } |
|
198 | 198 | |
|
199 | 199 | div.output_latex { |
|
200 | 200 | text-align: left; |
|
201 | 201 | color: black; |
|
202 | 202 | } |
|
203 | 203 | |
|
204 | 204 | div.output_html { |
|
205 | 205 | } |
|
206 | 206 | |
|
207 | 207 | div.output_png { |
|
208 | 208 | } |
|
209 | 209 | |
|
210 | 210 | div.output_jpeg { |
|
211 | 211 | } |
|
212 | 212 | |
|
213 | 213 | div.text_cell { |
|
214 | 214 | background-color: white; |
|
215 | 215 | padding: 5px 5px 5px 5px; |
|
216 | 216 | } |
|
217 | 217 | |
|
218 | 218 | div.text_cell_input { |
|
219 | 219 | color: black; |
|
220 | 220 | border: 1px solid #ddd; |
|
221 | 221 | border-radius: 3px; |
|
222 | 222 | background: #f7f7f7; |
|
223 | 223 | } |
|
224 | 224 | |
|
225 | 225 | div.text_cell_render { |
|
226 | 226 | font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
227 | 227 | outline: none; |
|
228 | 228 | resize: none; |
|
229 | 229 | width: inherit; |
|
230 | 230 | border-style: none; |
|
231 | 231 | padding: 5px; |
|
232 | 232 | color: black; |
|
233 | 233 | } |
|
234 | 234 | |
|
235 | 235 | .CodeMirror { |
|
236 | 236 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
237 | 237 | } |
|
238 | 238 | |
|
239 | 239 | .CodeMirror-scroll { |
|
240 | 240 | height: auto; /* Changed to auto to autogrow */ |
|
241 | 241 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ |
|
242 | 242 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ |
|
243 | 243 | overflow-y: hidden; |
|
244 | 244 | overflow-x: auto; /* Changed from auto to remove scrollbar */ |
|
245 | 245 | } |
|
246 | 246 | |
|
247 | 247 | /* CSS font colors for translated ANSI colors. */ |
|
248 | 248 | |
|
249 | 249 | |
|
250 | 250 | .ansiblack {color: black;} |
|
251 | 251 | .ansired {color: darkred;} |
|
252 | 252 | .ansigreen {color: darkgreen;} |
|
253 | 253 | .ansiyellow {color: brown;} |
|
254 | 254 | .ansiblue {color: darkblue;} |
|
255 | 255 | .ansipurple {color: darkviolet;} |
|
256 | 256 | .ansicyan {color: steelblue;} |
|
257 | 257 | .ansigrey {color: grey;} |
|
258 | 258 | .ansibold {font-weight: bold;} |
|
259 | 259 | |
|
260 | 260 | .completions , .tooltip { |
|
261 | 261 | position: absolute; |
|
262 | 262 | z-index: 10; |
|
263 | 263 | overflow: auto; |
|
264 | 264 | border: 1px solid black; |
|
265 | 265 | } |
|
266 | 266 | |
|
267 | 267 | .completions select { |
|
268 | 268 | background: white; |
|
269 | 269 | outline: none; |
|
270 | 270 | border: none; |
|
271 | 271 | padding: 0px; |
|
272 | 272 | margin: 0px; |
|
273 | 273 | font-family: monospace; |
|
274 | 274 | } |
|
275 | 275 | |
|
276 | 276 | option.context { |
|
277 | 277 | background-color: #DEF7FF; |
|
278 | 278 | } |
|
279 | 279 | option.introspection { |
|
280 | 280 | background-color: #EBF4EB; |
|
281 | 281 | } |
|
282 | 282 | |
|
283 | 283 | @-moz-keyframes fadeIn { |
|
284 | 284 | from {opacity:0;} |
|
285 | 285 | to {opacity:1;} |
|
286 | 286 | } |
|
287 | 287 | |
|
288 | 288 | @-webkit-keyframes fadeIn { |
|
289 | 289 | from {opacity:0;} |
|
290 | 290 | to {opacity:1;} |
|
291 | 291 | } |
|
292 | 292 | |
|
293 | 293 | @keyframes fadeIn { |
|
294 | 294 | from {opacity:0;} |
|
295 | 295 | to {opacity:1;} |
|
296 | 296 | } |
|
297 | 297 | |
|
298 | 298 | /*"close" "expand" and "Open in pager button" of |
|
299 | 299 | /* the tooltip*/ |
|
300 | 300 | .tooltip a { |
|
301 | 301 | float:right; |
|
302 | 302 | } |
|
303 | 303 | |
|
304 | 304 | /*properties of tooltip after "expand"*/ |
|
305 | 305 | .bigtooltip { |
|
306 | 306 | height:30%; |
|
307 | 307 | } |
|
308 | 308 | |
|
309 | 309 | /*properties of tooltip before "expand"*/ |
|
310 | 310 | .smalltooltip { |
|
311 | 311 | text-overflow: ellipsis; |
|
312 | 312 | overflow: hidden; |
|
313 | 313 | height:15%; |
|
314 | 314 | } |
|
315 | 315 | |
|
316 | 316 | .tooltip { |
|
317 | 317 | /*transition when "expand"ing tooltip */ |
|
318 | font-size: 14px; | |
|
318 | 319 | -webkit-transition-property: height; |
|
319 | 320 | -webkit-transition-duration: 1s; |
|
320 | 321 | -moz-transition-property: height; |
|
321 | 322 | -moz-transition-duration: 1s; |
|
322 | 323 | transition-property: height; |
|
323 | 324 | transition-duration: 1s; |
|
324 | 325 | max-width:700px; |
|
325 | 326 | border-radius: 0px 10px 10px 10px; |
|
326 | 327 | box-shadow: 3px 3px 5px #999; |
|
327 | 328 | /*fade-in animation when inserted*/ |
|
328 | 329 | -webkit-animation: fadeIn 200ms; |
|
329 | 330 | -moz-animation: fadeIn 200ms; |
|
330 | 331 | animation: fadeIn 200ms; |
|
331 | 332 | vertical-align: middle; |
|
332 | background: #FDFDD8; | |
|
333 | ||
|
334 | background-image: linear-gradient(bottom, rgb(215,215,215) 13%, rgb(210,210,210) 39%, rgb(227,227,227) 56%, rgb(247,247,247) 91%); | |
|
335 | background-image: -o-linear-gradient(bottom, rgb(215,215,215) 13%, rgb(210,210,210) 39%, rgb(227,227,227) 56%, rgb(247,247,247) 91%); | |
|
336 | background-image: -ms-linear-gradient(bottom, rgb(215,215,215) 13%, rgb(210,210,210) 39%, rgb(227,227,227) 56%, rgb(247,247,247) 91%); | |
|
337 | background-image: -moz-linear-gradient(bottom, rgb(215,215,215) 13%, rgb(210,210,210) 39%, rgb(227,227,227) 56%, rgb(247,247,247) 91%); | |
|
338 | background-image: -webkit-linear-gradient(bottom, rgb(215,215,215) 13%, rgb(210,210,210) 39%, rgb(227,227,227) 56%, rgb(247,247,247) 91%); | |
|
339 | ||
|
340 | background-image: -webkit-gradient( | |
|
341 | linear, | |
|
342 | left bottom, | |
|
343 | left top, | |
|
344 | color-stop(0.13, rgb(215,215,215)), | |
|
345 | color-stop(0.39, rgb(210,210,210)), | |
|
346 | color-stop(0.56, rgb(227,227,227)), | |
|
347 | color-stop(0.91, rgb(247,247,247)) | |
|
348 | ); | |
|
349 | ||
|
350 | color: #000; | |
|
351 | border-color: #BBB; | |
|
333 | 352 | outline: none; |
|
334 | 353 | padding: 3px; |
|
335 | 354 | margin: 0px; |
|
355 | padding-left:7px; | |
|
336 | 356 | font-family: monospace; |
|
337 | 357 | min-height:50px; |
|
338 | 358 | } |
|
339 | 359 | |
|
340 | 360 | /*fixed part of the completion*/ |
|
341 | 361 | .completions p b { |
|
342 | 362 | font-weight:bold; |
|
343 | 363 | } |
|
344 | 364 | |
|
345 | 365 | .completions p { |
|
346 | 366 | background: #DDF; |
|
347 | 367 | /*outline: none; |
|
348 | 368 | padding: 0px;*/ |
|
349 | 369 | border-bottom: black solid 1px; |
|
350 | 370 | padding: 1px; |
|
351 | 371 | font-family: monospace; |
|
352 | 372 | } |
|
353 | 373 | |
|
354 | 374 | pre.dialog { |
|
355 | 375 | background-color: #f7f7f7; |
|
356 | 376 | border: 1px solid #ddd; |
|
357 | 377 | border-radius: 3px; |
|
358 | 378 | padding: 0.4em; |
|
359 | 379 | padding-left: 2em; |
|
360 | 380 | } |
|
361 | 381 | |
|
362 | 382 | p.dialog { |
|
363 | 383 | padding : 0.2em; |
|
364 | 384 | } |
|
365 | 385 | |
|
366 | 386 | .shortcut_key { |
|
367 | 387 | display: inline-block; |
|
368 | 388 | width: 15ex; |
|
369 | 389 | text-align: right; |
|
370 | 390 | font-family: monospace; |
|
371 | 391 | } |
|
372 | 392 | |
|
373 | 393 | .shortcut_descr { |
|
374 | 394 | } |
|
375 | 395 | |
|
376 | 396 | /* Word-wrap output correctly. This is the CSS3 spelling, though Firefox seems |
|
377 | 397 | to not honor it correctly. Webkit browsers (Chrome, rekonq, Safari) do. |
|
378 | 398 | */ |
|
379 | 399 | pre, code, kbd, samp { white-space: pre-wrap; } |
@@ -1,108 +1,112 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // Tooltip |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | |
|
14 | 14 | var utils = IPython.utils; |
|
15 | 15 | |
|
16 | 16 | var Tooltip = function (notebook) { |
|
17 | 17 | this.tooltip = $('#tooltip'); |
|
18 | 18 | this.text = $('<pre/>') |
|
19 | this.text.html('something'); | |
|
20 | this.tooltip.css('left',50+'px'); | |
|
21 | this.tooltip.css('top',50+'px'); | |
|
22 | this.tooltip.append(this.text); | |
|
19 | 23 | }; |
|
20 | 24 | |
|
21 | 25 | |
|
22 | 26 | |
|
23 | 27 | //TODO, try to diminish the number of parameters. |
|
24 | 28 | Tooltip.prototype.request_tooltip_after_time = function (pre_cursor,time){ |
|
25 | 29 | }; |
|
26 | 30 | |
|
27 | 31 | |
|
28 | 32 | Tooltip.prototype.remove_and_cancel_tooltip = function() { |
|
29 | 33 | // note that we don't handle closing directly inside the calltip |
|
30 | 34 | // as in the completer, because it is not focusable, so won't |
|
31 | 35 | // get the event. |
|
32 | 36 | if (this.tooltip_timeout != null){ |
|
33 | 37 | clearTimeout(this.tooltip_timeout); |
|
34 | 38 | $('#tooltip').remove(); |
|
35 | 39 | this.tooltip_timeout = null; |
|
36 | 40 | } |
|
37 | 41 | } |
|
38 | 42 | Tooltip.prototype.show = function() |
|
39 | 43 | { |
|
40 | 44 | this.tooltip.removeClass('hidden'); |
|
41 | 45 | } |
|
42 | 46 | |
|
43 | 47 | Tooltip.prototype.showInPager = function(){ |
|
44 | 48 | var msg_id = IPython.notebook.kernel.execute(name+"?"); |
|
45 | 49 | IPython.notebook.msg_cell_map[msg_id] = IPython.notebook.get_selected_cell().cell_id; |
|
46 | 50 | that.remove_and_cancel_tooltip(); |
|
47 | 51 | setTimeout(function(){that.code_mirror.focus();}, 50); |
|
48 | 52 | } |
|
49 | 53 | |
|
50 | 54 | Tooltip.prototype.finish_tooltip = function (reply) { |
|
51 | 55 | |
|
52 | 56 | var expandlink=$('<a/>').attr('href',"#"); |
|
53 | 57 | expandlink.addClass("ui-corner-all"); //rounded corner |
|
54 | 58 | expandlink.attr('role',"button"); |
|
55 | 59 | |
|
56 | 60 | var expandspan=$('<span/>').text('Expand'); |
|
57 | 61 | expandspan.addClass('ui-icon'); |
|
58 | 62 | expandspan.addClass('ui-icon-plus'); |
|
59 | 63 | |
|
60 | 64 | expandlink.append(expandspan); |
|
61 | 65 | expandlink.attr('id','expanbutton'); |
|
62 | 66 | expandlink.click(function(){ |
|
63 | 67 | tooltip.removeClass('smalltooltip'); |
|
64 | 68 | tooltip.addClass('bigtooltip'); |
|
65 | 69 | $('#expanbutton').remove(); |
|
66 | 70 | setTimeout(function(){that.code_mirror.focus();}, 50); |
|
67 | 71 | }); |
|
68 | 72 | |
|
69 | 73 | var morelink=$('<a/>').attr('href',"#"); |
|
70 | 74 | morelink.attr('role',"button"); |
|
71 | 75 | morelink.addClass('ui-button'); |
|
72 | 76 | var morespan=$('<span/>').text('Open in Pager'); |
|
73 | 77 | morespan.addClass('ui-icon'); |
|
74 | 78 | morespan.addClass('ui-icon-arrowstop-l-n'); |
|
75 | 79 | morelink.append(morespan); |
|
76 | 80 | morelink.click(function(){ |
|
77 | 81 | this.showInPager(); |
|
78 | 82 | }); |
|
79 | 83 | |
|
80 | 84 | |
|
81 | 85 | var closelink=$('<a/>').attr('href',"#"); |
|
82 | 86 | closelink.attr('role',"button"); |
|
83 | 87 | closelink.addClass('ui-button'); |
|
84 | 88 | |
|
85 | 89 | var closespan=$('<span/>').text('Close'); |
|
86 | 90 | closespan.addClass('ui-icon'); |
|
87 | 91 | closespan.addClass('ui-icon-close'); |
|
88 | 92 | closelink.append(closespan); |
|
89 | 93 | closelink.click(function(){ |
|
90 | 94 | that.remove_and_cancel_tooltip(); |
|
91 | 95 | setTimeout(function(){that.code_mirror.focus();}, 50); |
|
92 | 96 | }); |
|
93 | 97 | //construct the tooltip |
|
94 | 98 | tooltip.append(closelink); |
|
95 | 99 | tooltip.append(expandlink); |
|
96 | 100 | tooltip.append(morelink); |
|
97 | 101 | |
|
98 | 102 | var pos = this.code_mirror.cursorCoords(); |
|
99 | 103 | tooltip.css('left',pos.x+'px'); |
|
100 | 104 | tooltip.css('top',pos.yBot+'px'); |
|
101 | 105 | |
|
102 | 106 | }; |
|
103 | 107 | |
|
104 | 108 | |
|
105 | 109 | IPython.Tooltip = Tooltip; |
|
106 | 110 | |
|
107 | 111 | return IPython; |
|
108 | 112 | }(IPython)); |
General Comments 0
You need to be logged in to leave comments.
Login now