##// END OF EJS Templates
Fixing padding of output cells.
Brian E. Granger -
Show More
@@ -184,6 +184,10 b' div.prompt {'
184 font-family: monospace;
184 font-family: monospace;
185 }
185 }
186
186
187 div.input_area {
188 color: black;
189 }
190
187 div.input_prompt {
191 div.input_prompt {
188 color: navy;
192 color: navy;
189 }
193 }
@@ -197,23 +201,32 b' div.output_prompt {'
197 color: darkred;
201 color: darkred;
198 }
202 }
199
203
200 div.input_area {
204 /* This class is applied to all types of output (pyout, pyerr, stream, display_data) */
201 color: black;
205 div.output_area {
206 padding: 0px 0.4em
202 }
207 }
203
208
204 div.output_area {
209 /* This is the output area after the Out[] prompt of type pyout */
205 text-align: left;
210 div.pyout_area {
206 color: black;
211 padding: 0.4em;
207 font-family: monospace;
212 }
213
214 /* The rest of the output_* classes are for special styling of the different
215 output types */
216
217 div.output_pyout {
218 padding: 0px;
208 }
219 }
209
220
210 div.output_stream {
221 div.output_stream {
211 padding: 0.4em;
222 text-align: left;
223 color: black;
224 font-family: monospace;
212 }
225 }
213
226
214 div.output_latex {
227 div.output_latex {
215 /* Slightly bigger than the rest of the notebook */
228 text-align: left;
216 font-size: 100%;
229 color: black;
217 }
230 }
218
231
219 div.output_html {
232 div.output_html {
@@ -222,6 +235,9 b' div.output_html {'
222 div.output_png {
235 div.output_png {
223 }
236 }
224
237
238 div.output_jpeg {
239 }
240
225 div.text_cell {
241 div.text_cell {
226 background-color: white;
242 background-color: white;
227 }
243 }
@@ -232,8 +248,6 b' div.text_cell_input {'
232
248
233 div.text_cell_render {
249 div.text_cell_render {
234 font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
250 font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
235 /* Slightly bigger than the rest of the notebook */
236 font-size: 100%;
237 outline: none;
251 outline: none;
238 resize: none;
252 resize: none;
239 width: inherit;
253 width: inherit;
@@ -63,7 +63,6 b' var IPython = (function (IPython) {'
63 return true;
63 return true;
64 }
64 }
65 } else if (event.keyCode === 8 && event.type == 'keydown') {
65 } else if (event.keyCode === 8 && event.type == 'keydown') {
66 console.log(event);
67 // If backspace and the line ends with 4 spaces, remove them.
66 // If backspace and the line ends with 4 spaces, remove them.
68 var cur = editor.getCursor();
67 var cur = editor.getCursor();
69 var line = editor.getLine(cur.line);
68 var line = editor.getLine(cur.line);
@@ -187,13 +186,13 b' var IPython = (function (IPython) {'
187
186
188 CodeCell.prototype.append_pyout = function (json) {
187 CodeCell.prototype.append_pyout = function (json) {
189 n = json.prompt_number || ' ';
188 n = json.prompt_number || ' ';
190 var toinsert = $("<div/>").addClass("output_area output_pyout hbox");
189 var toinsert = $("<div/>").addClass("output_pyout hbox");
191 toinsert.append($('<div/>').
190 toinsert.append($('<div/>').
192 addClass('prompt output_prompt').
191 addClass('prompt output_prompt').
193 html('Out[' + n + ']:')
192 html('Out[' + n + ']:')
194 );
193 );
195 this.append_mime_type(json, toinsert);
194 this.append_mime_type(json, toinsert).addClass('output_area');
196 toinsert.children().last().addClass("box_flex1");
195 toinsert.children().last().addClass("box_flex1 pyout_area");
197 this.element.find("div.output").append(toinsert);
196 this.element.find("div.output").append(toinsert);
198 // If we just output latex, typeset it.
197 // If we just output latex, typeset it.
199 if (json.latex !== undefined) {
198 if (json.latex !== undefined) {
@@ -211,18 +210,18 b' var IPython = (function (IPython) {'
211 s = s + tb[i] + '\n';
210 s = s + tb[i] + '\n';
212 }
211 }
213 s = s + '\n';
212 s = s + '\n';
214 this.append_text(s);
213 this.append_text(s).addClass('output_area');
215 };
214 };
216 };
215 };
217
216
218
217
219 CodeCell.prototype.append_stream = function (json) {
218 CodeCell.prototype.append_stream = function (json) {
220 this.append_text(json.text);
219 this.append_text(json.text).addClass('output_area');
221 };
220 };
222
221
223
222
224 CodeCell.prototype.append_display_data = function (json) {
223 CodeCell.prototype.append_display_data = function (json) {
225 this.append_mime_type(json);
224 this.append_mime_type(json).addClass('output_area');
226 };
225 };
227
226
228
227
@@ -252,7 +251,7 b' var IPython = (function (IPython) {'
252
251
253 CodeCell.prototype.append_html = function (html, element) {
252 CodeCell.prototype.append_html = function (html, element) {
254 element = element || this.element.find("div.output");
253 element = element || this.element.find("div.output");
255 var toinsert = $("<div/>").addClass("output_area output_html");
254 var toinsert = $("<div/>").addClass("output_html");
256 toinsert.append(html);
255 toinsert.append(html);
257 element.append(toinsert);
256 element.append(toinsert);
258 return element;
257 return element;
@@ -261,7 +260,7 b' var IPython = (function (IPython) {'
261
260
262 CodeCell.prototype.append_text = function (data, element) {
261 CodeCell.prototype.append_text = function (data, element) {
263 element = element || this.element.find("div.output");
262 element = element || this.element.find("div.output");
264 var toinsert = $("<div/>").addClass("output_area output_stream");
263 var toinsert = $("<div/>").addClass("output_stream");
265 toinsert.append($("<pre/>").html(utils.fixConsole(data)));
264 toinsert.append($("<pre/>").html(utils.fixConsole(data)));
266 element.append(toinsert);
265 element.append(toinsert);
267 return element;
266 return element;
@@ -270,7 +269,7 b' var IPython = (function (IPython) {'
270
269
271 CodeCell.prototype.append_svg = function (svg, element) {
270 CodeCell.prototype.append_svg = function (svg, element) {
272 element = element || this.element.find("div.output");
271 element = element || this.element.find("div.output");
273 var toinsert = $("<div/>").addClass("output_area output_svg");
272 var toinsert = $("<div/>").addClass("output_svg");
274 toinsert.append(svg);
273 toinsert.append(svg);
275 element.append(toinsert);
274 element.append(toinsert);
276 return element;
275 return element;
@@ -279,7 +278,7 b' var IPython = (function (IPython) {'
279
278
280 CodeCell.prototype.append_png = function (png, element) {
279 CodeCell.prototype.append_png = function (png, element) {
281 element = element || this.element.find("div.output");
280 element = element || this.element.find("div.output");
282 var toinsert = $("<div/>").addClass("output_area output_png");
281 var toinsert = $("<div/>").addClass("output_png");
283 toinsert.append($("<img/>").attr('src','data:image/png;base64,'+png));
282 toinsert.append($("<img/>").attr('src','data:image/png;base64,'+png));
284 element.append(toinsert);
283 element.append(toinsert);
285 return element;
284 return element;
@@ -288,7 +287,7 b' var IPython = (function (IPython) {'
288
287
289 CodeCell.prototype.append_jpeg = function (jpeg, element) {
288 CodeCell.prototype.append_jpeg = function (jpeg, element) {
290 element = element || this.element.find("div.output");
289 element = element || this.element.find("div.output");
291 var toinsert = $("<div/>").addClass("output_area output_jpeg");
290 var toinsert = $("<div/>").addClass("output_jpeg");
292 toinsert.append($("<img/>").attr('src','data:image/jpeg;base64,'+jpeg));
291 toinsert.append($("<img/>").attr('src','data:image/jpeg;base64,'+jpeg));
293 element.append(toinsert);
292 element.append(toinsert);
294 return element;
293 return element;
@@ -299,7 +298,7 b' var IPython = (function (IPython) {'
299 // This method cannot do the typesetting because the latex first has to
298 // This method cannot do the typesetting because the latex first has to
300 // be on the page.
299 // be on the page.
301 element = element || this.element.find("div.output");
300 element = element || this.element.find("div.output");
302 var toinsert = $("<div/>").addClass("output_area output_latex");
301 var toinsert = $("<div/>").addClass("output_latex");
303 toinsert.append(latex);
302 toinsert.append(latex);
304 element.append(toinsert);
303 element.append(toinsert);
305 return element;
304 return element;
General Comments 0
You need to be logged in to leave comments. Login now