Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions notebook/static/notebook/js/notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ define([
};

/**
* Get all Cell objects in this notebook.
* Get all cell objects in this notebook.
*
* @return {Array} This notebook's Cell objects
*/
Expand All @@ -614,7 +614,7 @@ define([
};

/**
* Get a Cell objects from this notebook.
* Get a cell object from this notebook.
*
* @param {integer} index - An index of a cell to retrieve
* @return {Cell} Cell or null if no cell was found.
Expand Down Expand Up @@ -721,13 +721,21 @@ define([
return i;
};


/**
* Get the selected cells.
*
* @return {Cell} The selected cells or null if no cell was found.
*/
Notebook.prototype.get_selected_cells = function () {
return this.get_cells().filter(function(cell, index){ return cell.selected || soft_selected(cell) || cell.anchor;});
};


/**
* Get the selected cells.
*
* @return {array} cell indicies
*/
Notebook.prototype.get_selected_cells_indices = function () {

var result = [];
this.get_cells().filter(function (cell, index) {
if (cell.selected || soft_selected(cell) || cell.anchor) {
Expand All @@ -737,7 +745,6 @@ define([
return result;
};


/**
* Get the currently selected cell.
*
Expand Down Expand Up @@ -970,7 +977,7 @@ define([
};

/**
* Ensure either cell, or codemirror is focused. Is none
* Ensure either cell or codemirror is focused. If none
* is focused, focus the cell.
*/
Notebook.prototype.ensure_focused = function(){
Expand Down Expand Up @@ -1715,7 +1722,7 @@ define([
};

/**
* Re-render the output of a CodeCell.
* Re-render the output of a code cell.
*/
Notebook.prototype.render_cell_output = function (code_cell) {
var cell_data = code_cell.toJSON();
Expand Down Expand Up @@ -1998,7 +2005,7 @@ define([
};

/**
* Clear the selected CodeCell's output area.
* Clear a code cell's output area.
*
* @param {integer} index - cell index
*/
Expand All @@ -2012,7 +2019,7 @@ define([
};

/**
* Clear multiple selected CodeCells' output areas.
* Clear multiple selected code cells' output areas.
*
*/
Notebook.prototype.clear_cells_outputs = function(indices) {
Expand Down