Skip to content

Commit

Permalink
Merge pull request ipython#2421 from Carreau/nbconsole
Browse files Browse the repository at this point in the history
Some notebook tweaks.
  • Loading branch information
ellisonbg committed Oct 3, 2012
2 parents bd3bb26 + 3d4bcab commit c5ce993
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion IPython/frontend/html/notebook/static/css/notebook.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 26 additions & 3 deletions IPython/frontend/html/notebook/static/js/codecell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};


Expand Down
5 changes: 5 additions & 0 deletions IPython/frontend/html/notebook/static/js/notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5ce993

Please sign in to comment.