Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple examples: Fix comments to satisfy JSDoc lint warnings #2032

Merged
merged 1 commit into from
Sep 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/combobox/js/grid-combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ var aria = aria || {};

/**
* @class
*
* @description
* Combobox object representing the state and interactions for a combobox
* widget
*
* @param input
* The input node
* @param grid
Expand Down
2 changes: 0 additions & 2 deletions examples/dialog-modal/js/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ aria.Utils = aria.Utils || {};
*
* Assumptions: The element serving as the dialog container is present in the
* DOM and hidden. The dialog container has role='dialog'.
*
* @param dialogId
* The ID of the element serving as the dialog container.
* @param focusAfterClosed
Expand Down Expand Up @@ -261,7 +260,6 @@ aria.Utils = aria.Utils || {};
/**
* @description
* Hides the current dialog and replaces it with another.
*
* @param newDialogId
* ID of the dialog that will replace the currently open top dialog.
* @param newFocusAfterClosed
Expand Down
28 changes: 0 additions & 28 deletions examples/grid/js/dataGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ aria.CSSClass = {

/**
* @class
*
* @description
* Grid object representing the state and interactions for a grid widget
*
* Assumptions:
* All focusable cells initially have tabindex="-1"
* Produces a fully filled in mxn grid (with no holes)
*
* @param gridNode
* The DOM node pointing to the grid
*/
Expand Down Expand Up @@ -130,13 +128,10 @@ aria.Grid.prototype.setupFocusGrid = function () {
/**
* @description
* If possible, set focus pointer to the cell with the specified coordinates
*
* @param row
* The index of the cell's row
*
* @param col
* The index of the cell's column
*
* @returns {boolean}
* Returns whether or not the focus could be set on the cell.
*/
Expand Down Expand Up @@ -172,10 +167,8 @@ aria.Grid.prototype.setFocusPointer = function (row, col) {
/**
* @param row
* The index of the cell's row
*
* @param col
* The index of the cell's column
*
* @returns {boolean}
* Returns whether or not the coordinates are within the grid's boundaries.
*/
Expand All @@ -195,10 +188,8 @@ aria.Grid.prototype.isValidCell = function (row, col) {
/**
* @param row
* The index of the cell's row
*
* @param col
* The index of the cell's column
*
* @returns {boolean}
* Returns whether or not the cell has been hidden.
*/
Expand Down Expand Up @@ -261,10 +252,8 @@ aria.Grid.prototype.registerEvents = function () {
/**
* @description
* Focus on the cell in the specified row and column
*
* @param row
* The index of the cell's row
*
* @param col
* The index of the cell's column
*/
Expand Down Expand Up @@ -293,7 +282,6 @@ aria.Grid.prototype.hideKeysIndicator = function () {
* @description
* Triggered on keydown. Checks if an arrow key was pressed, and (if possible)
* moves focus to the next valid cell in the direction of the arrow key.
*
* @param event
* Keydown event
*/
Expand Down Expand Up @@ -363,7 +351,6 @@ aria.Grid.prototype.checkFocusChange = function (event) {
/**
* @description
* Reset focused row and col if it doesn't match focusedRow and focusedCol
*
* @param focusedTarget
* Element that is currently focused by browser
*/
Expand All @@ -390,7 +377,6 @@ aria.Grid.prototype.findFocusedItem = function (focusedTarget) {
/**
* @description
* Triggered on click. Finds the cell that was clicked on and focuses on it.
*
* @param event
* Keydown event
*/
Expand All @@ -417,7 +403,6 @@ aria.Grid.prototype.focusClickedCell = function (event) {
* @description
* Triggered on click. Checks if user clicked on a header with aria-sort.
* If so, it sorts the column based on the aria-sort attribute.
*
* @param event
* Keydown event
*/
Expand Down Expand Up @@ -464,13 +449,10 @@ aria.Grid.prototype.delegateButtonHandler = function (event) {
* @description
* Toggles the mode of an editable cell between displaying the edit button
* and displaying the editable input.
*
* @param editCell
* Cell to toggle
*
* @param toggleOn
* Whether to show or hide edit input
*
* @param updateText
* Whether or not to update the button text with the input text
*/
Expand Down Expand Up @@ -503,7 +485,6 @@ aria.Grid.prototype.toggleEditMode = function (editCell, toggleOn, updateText) {
* All other headers with aria-sort are reset to "none"
*
* Note: This implementation assumes that there is no pagination on the grid.
*
* @param headerNode
* Header DOM node
*/
Expand Down Expand Up @@ -546,7 +527,6 @@ aria.Grid.prototype.handleSort = function (headerNode) {
/**
* @description
* Sorts the grid's rows according to the specified compareFn
*
* @param compareFn
* Comparison function to sort the rows
*/
Expand Down Expand Up @@ -599,7 +579,6 @@ aria.Grid.prototype.setPaginationChangeHandler = function (onPaginationChange) {
/**
* @description
* Check if page up or page down was pressed, and show the next page if so.
*
* @param event
* Keydown event
*/
Expand Down Expand Up @@ -634,10 +613,8 @@ aria.Grid.prototype.movePageDown = function () {
/**
* @description
* Scroll the specified row into view in the specified direction
*
* @param startIndex
* Row index to use as the start index
*
* @param scrollDown
* Whether to scroll the new page above or below the row index
*/
Expand Down Expand Up @@ -848,10 +825,8 @@ aria.Grid.prototype.getNextVisibleCell = function (directionX, directionY) {
/**
* @description
* Show or hide the cells in the specified column
*
* @param columnIndex
* Index of the column to toggle
*
* @param isShown
* Whether or not to show the column
*/
Expand Down Expand Up @@ -880,13 +855,10 @@ aria.Grid.prototype.toggleColumn = function (columnIndex, isShown) {
* @description
* Find the closest element matching the selector. Only checks parent and
* direct children.
*
* @param element
* Element to start searching from
*
* @param selector
* Index of the column to toggle
*
* @returns {object} matching element
*/
aria.Grid.prototype.findClosest = function (element, selector) {
Expand Down
30 changes: 0 additions & 30 deletions examples/grid/js/menuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ var aria = aria || {};

/**
* @class Menu
*
* @memberof aria.Utils
*
* @description Computes absolute position of an element
*/

Expand Down Expand Up @@ -71,9 +69,7 @@ aria.widget = aria.widget || {};

/**
* @class Menu
*
* @memberof aria.Widget
*
* @description Creates a Menu Button widget using ARIA
*/

Expand Down Expand Up @@ -109,9 +105,7 @@ aria.widget.Menu = function (node, menuButton) {

/**
* @function initMenuButton
*
* @memberof aria.widget.Menu
*
* @description Adds event handlers to button elements
*/

Expand Down Expand Up @@ -156,9 +150,7 @@ aria.widget.Menu.prototype.initMenu = function () {

/**
* @function nextMenuItem
*
* @memberof aria.widget.Menu
*
* @description Moves focus to next menuItem
*/

Expand All @@ -183,9 +175,7 @@ aria.widget.Menu.prototype.nextMenuItem = function (currentMenuItem) {

/**
* @function previousMenuItem
*
* @memberof aria.widget.Menu
*
* @description Moves focus to previous menuItem
*/

Expand All @@ -210,9 +200,7 @@ aria.widget.Menu.prototype.previousMenuItem = function (currentMenuItem) {

/**
* @function eventKeyDown
*
* @memberof aria.widget.Menu
*
* @description Keydown event handler for Menu Object
* NOTE: The menu parameter is needed to provide a reference to the specific
* menu
Expand Down Expand Up @@ -264,9 +252,7 @@ aria.widget.Menu.prototype.eventKeyDown = function (event, menu) {

/**
* @function eventMouseClick
*
* @memberof aria.widget.Menu
*
* @description onclick event handler for Menu Object
* NOTE: The menu parameter is needed to provide a reference to the specific
* menu
Expand Down Expand Up @@ -315,9 +301,7 @@ aria.widget.Menu.prototype.eventFocus = function (event, menu) {

/**
* @class Menu Button
*
* @memberof aria.Widget
*
* @description Creates a Menu Button widget using ARIA
*/

Expand Down Expand Up @@ -352,9 +336,7 @@ aria.widget.MenuButton = function (node) {

/**
* @function initMenuButton
*
* @memberof aria.widget.MenuButton
*
* @description Adds event handlers to button elements
*/

Expand Down Expand Up @@ -388,9 +370,7 @@ aria.widget.MenuButton.prototype.initMenuButton = function () {

/**
* @function openMenu
*
* @memberof aria.widget.MenuButton
*
* @description Opens the menu
*/

Expand All @@ -403,9 +383,7 @@ aria.widget.MenuButton.prototype.openMenu = function () {

/**
* @function closeMenu
*
* @memberof aria.widget.MenuButton
*
* @description Close the menu
*/

Expand Down Expand Up @@ -434,9 +412,7 @@ aria.widget.MenuButton.prototype.closeMenu = function (force, focusMenuButton) {

/**
* @function toggleMenu
*
* @memberof aria.widget.MenuButton
*
* @description Close or open the menu depending on current state
*/

Expand All @@ -452,9 +428,7 @@ aria.widget.MenuButton.prototype.toggleMenu = function () {

/**
* @function moveFocusToFirstMenuItem
*
* @memberof aria.widget.MenuButton
*
* @description Move keyboard focus to first menu item
*/

Expand All @@ -467,9 +441,7 @@ aria.widget.MenuButton.prototype.moveFocusToFirstMenuItem = function () {

/**
* @function moveFocusToLastMenuItem
*
* @memberof aria.widget.MenuButton
*
* @description Move keyboard focus to last menu item
*/

Expand All @@ -482,9 +454,7 @@ aria.widget.MenuButton.prototype.moveFocusToLastMenuItem = function () {

/**
* @function eventKeyDown
*
* @memberof aria.widget.MenuButton
*
* @description Keydown event handler for MenuButton Object
* NOTE: The menuButton parameter is needed to provide a reference to the specific
* menuButton
Expand Down
6 changes: 2 additions & 4 deletions examples/js/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ aria.widget.SourceCode = function () {
* @param {string} codeId - ID of element containing only and all of the html used to render the example widget
* @param {string} exampleHeaderId - ID of header element under which the "Open in Codepen" button belongs
* @param {string} cssJsFilesId - ID of element containing links to all the relevant js and css files used for the example widget
*
* @function add
* @memberof aria.widget.SourceCode
*/
Expand Down Expand Up @@ -117,7 +116,6 @@ aria.widget.SourceCode.prototype.make = function () {
* @param {object} node DOM Element node to use to generate the source code
* @param {number} indentLevel Level of indentation
* @param {boolean} skipFirst Whether to skip the first node
*
* @function createCode
* @memberof aria.widget.SourceCode
*/
Expand Down Expand Up @@ -293,11 +291,11 @@ function stripIndentation(textContent) {
*
* Algorithm:
*
* **Case 1: `textContent` is on the same line as opening and closing tag**:
* Case 1: `textContent` is on the same line as opening and closing tag**:
*
* In other words, the text doesn’t contain any newline. Return 0.
*
* **Case 2: `textContent` is on the same line as opening tag**:
* Case 2: `textContent` is on the same line as opening tag**:
*
* We already know there is at least one newline, because case 1 didn’t return.
* We can now find the first indented line that contains any non-whitespace
Expand Down