Merge pull request #2421 from Carreau/nbconsole

Some notebook tweaks.
Brian E. Granger 14 years ago
commit 2be72dae5d

@ -238,7 +238,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 0.4em 0.4em 0.4em;
padding: 0.44em 0.4em 0.4em 1px;
}
/* The rest of the output_* classes are for special styling of the different

@ -225,10 +225,33 @@ var IPython = (function (IPython) {
};
CodeCell.input_prompt_classical = function (prompt_value, lines_number) {
var ns = prompt_value || " ";
return 'In [' + ns + ']:'
};
CodeCell.input_prompt_continuation = function (prompt_value, lines_number) {
var html = [CodeCell.input_prompt_classical(prompt_value, lines_number)];
for(var i=1; i < lines_number; i++){html.push(['...:'])};
return html.join('</br>')
};
CodeCell.input_prompt_function = CodeCell.input_prompt_classical;
CodeCell.prototype.set_input_prompt = function (number) {
this.input_prompt_number = number;
var ns = number || "&nbsp;";
this.element.find('div.input_prompt').html('In&nbsp;[' + ns + ']:');
var nline = 1
if( this.code_mirror != undefined) {
nline = this.code_mirror.lineCount();
}
if (number){
this.input_prompt_number = number;
}
var prompt_html = CodeCell.input_prompt_function(this.input_prompt_number, nline);
this.element.find('div.input_prompt').html(prompt_html);
};

@ -550,6 +550,11 @@ var IPython = (function (IPython) {
};
Notebook.prototype.insert_cell_at_bottom = function (type){
var len = this.ncells();
return this.insert_cell_below(type,len-1);
}
Notebook.prototype.insert_cell_below = function (type, index) {
// type = ('code','html','markdown')
// index = cell index or undefined to insert below selected

Loading…
Cancel
Save