Merge pull request #182 from frederikhermans/master

Properly render newlines etc. in raw_input() prompt
Min RK 11 years ago
commit e8b3c17693

@ -774,23 +774,23 @@ define([
$("<div/>")
.addClass("box-flex1 output_subarea raw_input_container")
.append(
$("<span/>")
$("<pre/>")
.addClass("raw_input_prompt")
.text(content.prompt)
)
.append(
$("<input/>")
.addClass("raw_input")
.attr('type', input_type)
.attr("size", 47)
.keydown(function (event, ui) {
// make sure we submit on enter,
// and don't re-execute the *cell* on shift-enter
if (event.which === keyboard.keycodes.enter) {
that._submit_raw_input();
return false;
}
})
.append(
$("<input/>")
.addClass("raw_input")
.attr('type', input_type)
.attr("size", 47)
.keydown(function (event, ui) {
// make sure we submit on enter,
// and don't re-execute the *cell* on shift-enter
if (event.which === keyboard.keycodes.enter) {
that._submit_raw_input();
return false;
}
})
)
)
);
@ -807,7 +807,7 @@ define([
OutputArea.prototype._submit_raw_input = function (evt) {
var container = this.element.find("div.raw_input_container");
var theprompt = container.find("span.raw_input_prompt");
var theprompt = container.find("pre.raw_input_prompt");
var theinput = container.find("input.raw_input");
var value = theinput.val();
var echo = value;

@ -157,18 +157,18 @@ div.output_javascript:empty {
/* raw_input styles */
div.raw_input_container {
font-family: @font-family-monospace;
line-height: @code_line_height;
// for some reason, em padding doesn't compute the same for raw_input
// that is not the first input, but px does
padding-top: 5px;
}
span.raw_input_prompt {
/* nothing needed here */
pre.raw_input_prompt {
/* nothing needed here. */
}
input.raw_input {
font-family: inherit;
font-family: @font-family-monospace;
font-size: inherit;
color: inherit;
width: auto;

Loading…
Cancel
Save