Misc fixes to the code cell and output area.

This commit is contained in:
Brian Granger 2012-05-15 14:01:15 -07:00
parent 32343c5973
commit 8bd7e041cf
4 changed files with 11 additions and 11 deletions

View File

@ -172,7 +172,7 @@ div.output_area {
/* This class is for the output subarea inside the output_area and after
the prompt div. */
div.output_subarea {
padding: 0.4em 6.1em 0.4em 0.4em;
padding: 0.4em 0.4em 0.4em 0.4em;
}
/* The rest of the output_* classes are for special styling of the different

View File

@ -83,7 +83,7 @@ var IPython = (function (IPython) {
// browser and keyboard layout !
// Pressing '(' , request tooltip, don't forget to reappend it
IPython.tooltip.pending(that);
} else if (event.which === key.UPARROW) {
} else if (event.which === key.UPARROW && event.type === 'keydown') {
// If we are not at the top, let CM handle the up arrow and
// prevent the global keydown handler from handling it.
if (!that.at_top()) {
@ -92,7 +92,7 @@ var IPython = (function (IPython) {
} else {
return true;
};
} else if (event.which === key.DOWNARROW) {
} else if (event.which === key.DOWNARROW && event.type === 'keydown') {
// If we are not at the bottom, let CM handle the down arrow and
// prevent the global keydown handler from handling it.
if (!that.at_bottom()) {

View File

@ -238,7 +238,7 @@ var IPython = (function (IPython) {
OutputArea.prototype.append_html = function (html, element) {
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_html rendered_html");
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_html rendered_html");
toinsert.append(html);
element.append(toinsert);
};
@ -246,8 +246,7 @@ var IPython = (function (IPython) {
OutputArea.prototype.append_javascript = function (js, container) {
// We just eval the JS code, element appears in the local scope.
var element = $("<div/>").addClass("box_flex1 output_subarea");
var kernel = this.kernel;
var element = $("<div/>").addClass("box-flex1 output_subarea");
container.append(element);
// Div for js shouldn't be drawn, as it will add empty height to the area.
container.hide();
@ -258,7 +257,7 @@ var IPython = (function (IPython) {
OutputArea.prototype.append_text = function (data, element, extra_class) {
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_text");
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_text");
// escape ANSI & HTML specials in plaintext:
data = utils.fixConsole(data);
if (extra_class){
@ -270,21 +269,21 @@ var IPython = (function (IPython) {
OutputArea.prototype.append_svg = function (svg, element) {
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_svg");
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_svg");
toinsert.append(svg);
element.append(toinsert);
};
OutputArea.prototype.append_png = function (png, element) {
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_png");
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_png");
toinsert.append($("<img/>").attr('src','data:image/png;base64,'+png));
element.append(toinsert);
};
OutputArea.prototype.append_jpeg = function (jpeg, element) {
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_jpeg");
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_jpeg");
toinsert.append($("<img/>").attr('src','data:image/jpeg;base64,'+jpeg));
element.append(toinsert);
};
@ -293,7 +292,7 @@ var IPython = (function (IPython) {
OutputArea.prototype.append_latex = function (latex, element) {
// This method cannot do the typesetting because the latex first has to
// be on the page.
var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_latex");
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_latex");
toinsert.append(latex);
element.append(toinsert);
};

View File

@ -99,6 +99,7 @@ IPython.utils = (function (IPython) {
SHIFT : 16,
CTRL : 17,
CONTROL : 17,
ALT : 18,
ESC : 27,
SPACE : 32,
PGUP : 33,