Merge pull request #2774 from iamlemec/master

Factor out output_prompt_function, as is done with input prompt
This commit is contained in:
Thomas Kluyver 2017-09-15 20:47:44 +01:00 committed by GitHub
commit 9dabaa2ccf

View File

@ -467,6 +467,11 @@ define([
this.element.trigger('changed', {output_area: this});
};
OutputArea.output_prompt_classical = function(prompt_value) {
return $('<bdi>').text(i18n.msg.sprintf(i18n.msg._('Out[%d]:'),prompt_value));
};
OutputArea.output_prompt_function = OutputArea.output_prompt_classical;
OutputArea.prototype.append_execute_result = function (json) {
var n = json.execution_count || ' ';
@ -476,9 +481,7 @@ define([
toinsert.find('div.prompt')
.addClass('output_prompt')
.empty()
.append(
$('<bdi>').text(i18n.msg.sprintf(i18n.msg._('Out[%d]:'),n))
);
.append(OutputArea.output_prompt_function(n));
}
var inserted = this.append_mime_type(json, toinsert);
if (inserted) {