Skip to content

Commit

Permalink
Minor typographical or comment changes (#6025)
Browse files Browse the repository at this point in the history
- Fix capitalization and pluralization of `Cells`
- Add comment for `.get_selected_cells`
- Add comment for `.get_selected_cells_indices`
- Fix typo in `.ensure_focused`
- Fix capitalization in `.render_cell_output` and `.clear_output` and `.clear_cells_outputs`
  • Loading branch information
misterhay authored Mar 27, 2021
1 parent 57d063c commit b97dda1
Showing 1 changed file with 17 additions and 10 deletions.
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

0 comments on commit b97dda1

Please sign in to comment.