From d4303aad246db5f85a93477cc437aebd0205606c Mon Sep 17 00:00:00 2001 From: Tony Jin Date: Thu, 6 Jul 2017 11:01:05 -0700 Subject: [PATCH] Chore: Fix ESLint warnings (JSDoc cleanup) (#199) --- .eslintignore | 1 + .eslintrc | 7 ++-- src/lib/Popup.js | 5 +-- src/lib/annotations/AnnotationDialog.js | 2 +- src/lib/annotations/AnnotationService.js | 10 +++-- src/lib/annotations/BoxAnnotations.js | 4 +- src/lib/annotations/CommentBox.js | 31 +++++++------- src/lib/annotations/annotatorUtil.js | 25 ++++++++++-- .../annotations/doc/CreateHighlightDialog.js | 16 +++++--- src/lib/annotations/doc/DocAnnotator.js | 12 ++++-- src/lib/annotations/doc/DocHighlightThread.js | 7 ++++ src/lib/annotations/doc/docAnnotatorUtil.js | 25 +++++++++--- .../annotations/image/imageAnnotatorUtil.js | 8 ++-- src/lib/file.js | 6 +-- src/lib/tokens.js | 10 ++--- src/lib/util.js | 40 +++++++++++++++++-- src/lib/viewers/box3d/Box3DRenderer.js | 14 +++++++ src/lib/viewers/box3d/Box3DUIUtils.js | 2 - src/lib/viewers/box3d/Box3DViewer.js | 2 +- src/lib/viewers/box3d/SceneEntities.js | 3 +- .../box3d/image360/Image360Renderer.js | 11 +++-- .../model3d/Model3DAnimationClipsPullup.js | 2 +- .../viewers/box3d/model3d/Model3DControls.js | 2 +- .../viewers/box3d/model3d/Model3DRenderer.js | 18 +++++---- .../viewers/box3d/model3d/Model3DViewer.js | 16 +++++++- .../box3d/model3d/Model3DVrControls.js | 2 - .../viewers/box3d/model3d/SceneEntities.js | 5 ++- src/lib/viewers/doc/DocFindBar.js | 23 ++++++----- src/lib/viewers/image/ImageBaseViewer.js | 2 + src/lib/viewers/image/MultiImageViewer.js | 7 ++-- src/lib/viewers/media/DashViewer.js | 10 +++-- src/lib/viewers/media/MediaControls.js | 12 ++++-- src/lib/viewers/media/Settings.js | 15 +++---- src/lib/viewers/text/BoxCSV.js | 16 ++++---- src/lib/viewers/text/MarkdownViewer.js | 6 +-- 35 files changed, 252 insertions(+), 125 deletions(-) diff --git a/.eslintignore b/.eslintignore index bc9ca3d37..7ef575568 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ src/third-party/* dist/* +**/__tests__/* diff --git a/.eslintrc b/.eslintrc index d6c539241..fb41d74bd 100644 --- a/.eslintrc +++ b/.eslintrc @@ -109,11 +109,12 @@ "class": "constructor" }, "preferType": { - "object": "Object", "array": "Array", - "String": "string", + "function": "Function", + "object": "Object", "Boolean": "boolean", - "Number": "number" + "Number": "number", + "String": "string" } } ] diff --git a/src/lib/Popup.js b/src/lib/Popup.js index 48b494664..c7a137ffc 100644 --- a/src/lib/Popup.js +++ b/src/lib/Popup.js @@ -75,9 +75,8 @@ class Popup { * Shows a popup with a message. * * @param {string} message - Popup message - * @param {string} buttonText - Button text - * @param {function} [buttonHandler] - Optional onclick function for the button * @param {string} [buttonText] - Optional text to show in button + * @param {Function} [buttonHandler] - Optional onclick function for the button * @return {void} */ show(message, buttonText, buttonHandler) { @@ -185,7 +184,7 @@ class Popup { /** * Keydown handler for popup * - * @param {string} key - Keydown key + * @param {Event} event - Keydown event * @return {boolean} Consumed or not */ keydownHandler = (event) => { diff --git a/src/lib/annotations/AnnotationDialog.js b/src/lib/annotations/AnnotationDialog.js index 73a4adf63..aab0c6b5d 100644 --- a/src/lib/annotations/AnnotationDialog.js +++ b/src/lib/annotations/AnnotationDialog.js @@ -209,7 +209,7 @@ const CLASS_ANIMATE_DIALOG = 'bp-animate-show-dialog'; /** * Posts an annotation in the dialog. * - * @public + * @param {string} [textInput] - Annotation text to post * @return {void} */ postAnnotation(textInput) { diff --git a/src/lib/annotations/AnnotationService.js b/src/lib/annotations/AnnotationService.js index a654e4748..0f3e2b016 100644 --- a/src/lib/annotations/AnnotationService.js +++ b/src/lib/annotations/AnnotationService.js @@ -244,8 +244,8 @@ const ANONYMOUS_USER = { * * @private * @param {string} fileVersionId - File version ID to fetch annotations for - * @param {string} marker - marker to use if there are more than limit annotations - * * @param {int} limit - the amout of annotations the API will return per call + * @param {string} marker - Marker to use if there are more than limit annotations + * @param {int} limit - The amout of annotations the API will return per call * @return {Promise} Promise that resolves with fetched annotations */ getReadUrl(fileVersionId, marker = null, limit = null) { @@ -266,9 +266,11 @@ const ANONYMOUS_USER = { * limit is 100 annotations per API call. * * @private + * @param {Function} resolve - Promise resolution handler + * @param {Function} reject - Promise rejection handler * @param {string} fileVersionId - File version ID to fetch annotations for - * @param {string} marker - marker to use if there are more than limit annotations - * @param {int} limit - the amout of annotations the API will return per call + * @param {string} marker - Marker to use if there are more than limit annotations + * @param {int} limit - The amout of annotations the API will return per call * @return {void} */ readFromMarker(resolve, reject, fileVersionId, marker = null, limit = null) { diff --git a/src/lib/annotations/BoxAnnotations.js b/src/lib/annotations/BoxAnnotations.js index 79e1b4be3..2f1611646 100644 --- a/src/lib/annotations/BoxAnnotations.js +++ b/src/lib/annotations/BoxAnnotations.js @@ -36,9 +36,9 @@ class BoxAnnotations { } /** - * Chooses a annotator based on file extension. + * Chooses a annotator based on viewer. * - * @param {Object} file - Box file + * @param {Object} viewer - Current preview viewer * @param {Array} [disabledAnnotators] - List of disabled annotators * @return {Object} The annotator to use */ diff --git a/src/lib/annotations/CommentBox.js b/src/lib/annotations/CommentBox.js index 6d3deb5fc..1db15e7d1 100644 --- a/src/lib/annotations/CommentBox.js +++ b/src/lib/annotations/CommentBox.js @@ -10,21 +10,21 @@ const TEXT_ADD_COMMENT_PLACEHOLDER = __('annotation_add_comment_placeholder'); class CommentBox extends EventEmitter { /** * Text displayed in the Cancel button element. - * + * * @property {string} */ cancelText = TEXT_ANNOTATION_CANCEL; /** * Text displayed in the Post button element. - * + * * @property {string} */ postText = TEXT_ANNOTATION_POST; /** * Placeholder text displayed in the text area element. - * + * * @property {string} */ placeholderText = TEXT_ADD_COMMENT_PLACEHOLDER; @@ -73,10 +73,11 @@ class CommentBox extends EventEmitter { /** * Creates an element for text entry, submission and cancellation. * + * @param {HTMLElement} parentEl - Parent element * @param {Object} [config] - Object containing text values to be displayed to the user. - * config.cancel - Text displayed in the "Cancel" button - * config.post - Text displayed in the "Post" button - * config.placeholder - Placeholder text displayed in the text area + * @param {string} config.cancel - Text displayed in the "Cancel" button + * @param {string} config.post - Text displayed in the "Post" button + * @param {string} config.placeholder - Placeholder text displayed in the text area */ constructor(parentEl, config = {}) { super(); @@ -94,8 +95,7 @@ class CommentBox extends EventEmitter { /** * Focus on the text box. - * - * @public + * * @return {void} */ focus() { @@ -108,8 +108,7 @@ class CommentBox extends EventEmitter { /** * Clear out the text box. - * - * @public + * * @return {void} */ clear() { @@ -123,7 +122,6 @@ class CommentBox extends EventEmitter { /** * Hide the element. * - * @public * @return {void} */ hide() { @@ -137,7 +135,6 @@ class CommentBox extends EventEmitter { /** * Show the element. * - * @public * @return {void} */ show() { @@ -150,9 +147,9 @@ class CommentBox extends EventEmitter { } /** - * Destructor + * [destructor] * - * @public + * @return {void} */ destroy() { if (!this.containerEl) { @@ -196,7 +193,7 @@ class CommentBox extends EventEmitter { /** * Clear the current text in the textarea element and notify listeners. - * + * * @private * @return {void} */ @@ -207,7 +204,7 @@ class CommentBox extends EventEmitter { /** * Notify listeners of submit event and then clear textarea element. - * + * * @private * @return {void} */ @@ -219,7 +216,7 @@ class CommentBox extends EventEmitter { /** * Create HTML for the comment box. Assigns references to elements, attach event listeners. * ie) Post button, cancel button - * + * * @private * @return {HTMLElement} The HTML to append to this.parentElement */ diff --git a/src/lib/annotations/annotatorUtil.js b/src/lib/annotations/annotatorUtil.js index 7b200c2ef..ed3e8aebd 100644 --- a/src/lib/annotations/annotatorUtil.js +++ b/src/lib/annotations/annotatorUtil.js @@ -18,6 +18,7 @@ const THREAD_PARAMS = [ /** * Finds the closest ancestor DOM element with the specified class. + * * @param {HTMLElement} element - Element to search ancestors of * @param {string} className - Class name to query * @return {HTMLElement|null} Closest ancestor with given class or null @@ -34,6 +35,7 @@ export function findClosestElWithClass(element, className) { /** * Returns the page element and page number that the element is on. +* * @param {HTMLElement} element - Element to find page and page number for * @return {Object} Page element/page number if found or null/-1 if not */ @@ -52,6 +54,7 @@ export function getPageInfo(element) { * Finds the closest element with a data type and returns that data type. If * an attributeName is provided, search for that data atttribute instead of * data type. + * * @param {HTMLElement} element - Element to find closest data type for * @param {string} [attributeName] - Optional different data attribute to search * for @@ -71,6 +74,7 @@ export function findClosestDataType(element, attributeName) { /** * Shows the specified element or element with specified selector. + * * @param {HTMLElement|string} elementOrSelector - Element or CSS selector * @return {void} */ @@ -87,6 +91,7 @@ export function showElement(elementOrSelector) { /** * Hides the specified element or element with specified selector. + * * @param {HTMLElement|string} elementOrSelector - Element or CSS selector * @return {void} */ @@ -103,6 +108,7 @@ export function hideElement(elementOrSelector) { /** * Shows the specified element or element with specified selector. + * * @param {HTMLElement|string} elementOrSelector - Element or CSS selector * @return {void} */ @@ -120,6 +126,7 @@ export function showInvisibleElement(elementOrSelector) { /** * Hides the specified element or element with specified selector. The element * will still take up DOM space but not be visible in the UI + * * @param {HTMLElement|string} elementOrSelector - Element or CSS selector * @return {void} */ @@ -137,8 +144,9 @@ export function hideElementVisibility(elementOrSelector) { /** * Reset textarea element - clears value, resets styles, and remove active * state. + * * @param {HTMLElement} element - Textarea to reset - * @param {Boolean} clearText - Whether or not text in text area should be cleared + * @param {boolean} clearText - Whether or not text in text area should be cleared * @return {void} */ export function resetTextarea(element, clearText) { @@ -158,6 +166,8 @@ export function resetTextarea(element, clearText) { /** * Checks whether element is fully in viewport. + * + * @param {HTMLElement} element - Element to check * @return {boolean} Whether element is fully in viewport */ export function isElementInViewport(element) { @@ -175,6 +185,7 @@ export function isElementInViewport(element) { * Returns avatar image HTML for annotation dialog. This will be either an * image with the supplied avatar URL as a source if there is a URL passed in * or one generated using the initials of the annotator. + * * @param {string} avatarUrl - URL of avatar photo * @param {string} userId - User ID of annotator * @param {string} userName - Username of annotator @@ -197,6 +208,7 @@ export function getAvatarHtml(avatarUrl, userId, userName) { /** * Returns zoom scale of annotated element. + * * @param {HTMLElement} annotatedElement - HTML element being annotated on * @return {number} Zoom scale */ @@ -210,8 +222,9 @@ export function getScale(annotatedElement) { /** * Whether or not a highlight annotation has comments or is a plain highlight - * @param {Annotation[]} Annotations - in highlight thread - * @return {Boolean} Whether annotation is a plain highlight annotation + * + * @param {Annotation[]} annotations - Annotations in highlight thread + * @return {boolean} Whether annotation is a plain highlight annotation */ export function isPlainHighlight(annotations) { return annotations.length === 1 && annotations[0].text === ''; @@ -220,6 +233,8 @@ export function isPlainHighlight(annotations) { /** * Returns whether or not the annotation type is 'highlight' or * 'highlight-comment' + * + * @param {string} type - Annotatation type * @return {boolean} Whether or not annotation is a highlight */ export function isHighlightAnnotation(type) { @@ -263,6 +278,7 @@ export function getDimensionScale(dimensions, fileDimensions, zoomScale, heightP /** * Escapes HTML. + * * @param {string} str - Input string * @return {string} HTML escaped string */ @@ -280,6 +296,7 @@ export function htmlEscape(str) { * Repositions caret if annotations dialog will run off the right or left * side of the page. Otherwise positions caret at the center of the * annotations dialog and the updated left corner x coordinate. + * * @param {HTMLElement} dialogEl Annotations dialog element * @param {number} dialogX Left corner x coordinate of the annotations dialog * @param {number} highlightDialogWidth Width of the annotations dialog @@ -318,6 +335,8 @@ export function repositionCaret(dialogEl, dialogX, highlightDialogWidth, browser /** * Checks thread is in a pending or pending-active state + * + * @param {string} threadState - State of thread * @return {boolean} Whether annotation thread is in a pending state */ export function isPending(threadState) { diff --git a/src/lib/annotations/doc/CreateHighlightDialog.js b/src/lib/annotations/doc/CreateHighlightDialog.js index 3b695b797..44b044f7a 100644 --- a/src/lib/annotations/doc/CreateHighlightDialog.js +++ b/src/lib/annotations/doc/CreateHighlightDialog.js @@ -89,8 +89,11 @@ class CreateHighlightDialog extends EventEmitter { /** * A dialog used to create plain and comment highlights. - * + * * [constructor] + * + * @param {HTMLElement} parentEl - Parent element + * @return {CreateHighlightDialog} CreateHighlightDialog instance */ constructor(parentEl) { super(); @@ -171,9 +174,9 @@ class CreateHighlightDialog extends EventEmitter { } /** - * Destructor + * [destructor] * - * @public + * @return {void} */ destroy() { if (!this.containerEl) { @@ -209,7 +212,7 @@ class CreateHighlightDialog extends EventEmitter { /** * Update the position styling for the dialog so that the chevron points to * the desired location. - * + * * @return {void} */ updatePosition() { @@ -221,7 +224,7 @@ class CreateHighlightDialog extends EventEmitter { /** * Fire an event notifying that the plain highlight button has been clicked. - * + * * @return {void} */ onHighlightClick() { @@ -271,6 +274,7 @@ class CreateHighlightDialog extends EventEmitter { * Hide or show the plain and comment buttons, in the dialog. * * @param {boolean} visible - If true, shows the plain and comment buttons + * @return {void} */ setButtonVisibility(visible) { if (visible) { @@ -281,7 +285,7 @@ class CreateHighlightDialog extends EventEmitter { } /** - * Stop the dialog from propagating events to parent container. Pairs with + * Stop the dialog from propagating events to parent container. Pairs with * giving focus to the text area in the comment box and clicking "Post". * * @param {Event} event - The DOM event coming from interacting with the element. diff --git a/src/lib/annotations/doc/DocAnnotator.js b/src/lib/annotations/doc/DocAnnotator.js index 15539a7fa..c22366921 100644 --- a/src/lib/annotations/doc/DocAnnotator.js +++ b/src/lib/annotations/doc/DocAnnotator.js @@ -92,8 +92,9 @@ function isThreadInHoverState(thread) { * on document files. * * [constructor] + * * @inheritdoc - * @return {DocAnnotator} + * @return {DocAnnotator} DocAnnotator instance */ constructor(data) { super(data); @@ -112,9 +113,9 @@ function isThreadInHoverState(thread) { } /** - * Destructor + * [destructor] * - * @public + * @return {void} */ destroy() { super.destroy(); @@ -532,6 +533,11 @@ function isThreadInHoverState(thread) { this.highlightMousemoveHandler = this.onHighlightMouseMove.bind(this); + /** + * Highlight event loop + * + * @return {void} + */ const highlightLoop = () => { this.highlightThrottleHandle = requestAnimationFrame(highlightLoop); this.onHighlightCheck(); diff --git a/src/lib/annotations/doc/DocHighlightThread.js b/src/lib/annotations/doc/DocHighlightThread.js index 4f1d95b79..bf194938d 100644 --- a/src/lib/annotations/doc/DocHighlightThread.js +++ b/src/lib/annotations/doc/DocHighlightThread.js @@ -441,6 +441,13 @@ const HOVER_TIMEOUT_MS = 75; PAGE_PADDING_TOP + PAGE_PADDING_BOTTOM ); + /** + * Scale verticies according to dimension scale. + * + * @param {number} val - Value to scale + * @param {number} index - Vertex index + * @return {number} - Scaled value + */ const scaleVertices = (val, index) => { return index % 2 ? val * dimensionScale.y : val * dimensionScale.x; }; diff --git a/src/lib/annotations/doc/docAnnotatorUtil.js b/src/lib/annotations/doc/docAnnotatorUtil.js index 3541eb38c..d1d8c18dc 100644 --- a/src/lib/annotations/doc/docAnnotatorUtil.js +++ b/src/lib/annotations/doc/docAnnotatorUtil.js @@ -8,6 +8,12 @@ const PDF_UNIT_TO_CSS_PIXEL = 4 / 3; const CSS_PIXEL_TO_PDF_UNIT = 3 / 4; const HIGHLIGHT_DIALOG_HEIGHT = 48; +/** + * Checks whether this annotator is on a presentation (PPT) or not. + * + * @param {HTMLElement} annotatedElement - Annotated element + * @return {boolean} Whether annotations are on presentation or not + */ export function isPresentation(annotatedElement) { return annotatedElement.classList.contains(PREVIEW_PRESENTATION_CLASS); } @@ -19,9 +25,10 @@ export function isPresentation(annotatedElement) { /** * Checks whether mouse is inside the dialog represented by this thread. * + * @private * @param {Event} event - Mouse event + * @param {HTMLElement} dialogEl - Dialog element * @return {boolean} Whether or not mouse is inside dialog - * @private */ export function isInDialog(event, dialogEl) { if (!dialogEl) { @@ -49,9 +56,9 @@ export function isInDialog(event, dialogEl) { /** * Checks if there is an active annotation in the annotated document * + * @private * @param {HTMLElement} annotatedEl - Annotated document * @return {boolean} Whether or not a dialog is active - * @private */ export function hasActiveDialog(annotatedEl) { const commentsDialogEl = annotatedEl.querySelector('.bp-annotation-dialog:not(.bp-is-hidden)'); @@ -65,11 +72,12 @@ export function hasActiveDialog(annotatedEl) { * dialog from being cut off since the presentation viewer doesn't allow * the annotations dialog to overflow below the file * + * @private * @param {HTMLElement} annotatedElement - Annotated element * @param {HTMLElement} dialogEl - Annotations dialog element * @param {number} pageHeight - Page height + * @param {number} dialogY - Dialog y position * @return {void} - * @private */ export function fitDialogHeightInPage(annotatedElement, dialogEl, pageHeight, dialogY) { if (isPresentation(annotatedElement)) { @@ -89,6 +97,7 @@ export function fitDialogHeightInPage(annotatedElement, dialogEl, pageHeight, di /** * Fast test if a given point is within a polygon. Taken from * http://jsperf.com/ispointinpath-boundary-test-speed/6 + * * @param {number[]} poly - Polygon defined by array of [x,y] coordinates * @param {number} x - X coordinate of point to Test * @param {number} y - Y coordinate of point to Test @@ -104,14 +113,15 @@ export function isPointInPolyOpt(poly, x, y) { /* eslint-enable */ } +/* istanbul ignore next */ /** * Returns the Rangy highlight object and highlight elements representing * the current selection on the given page element. + * * @param {Object} highlighter - Rangy highlighter * @param {HTMLElement} pageEl - Page element highlight is over * @return {Object} Rangy highlight object and highlight DOM elements */ -/* istanbul ignore next */ export function getHighlightAndHighlightEls(highlighter, pageEl) { const highlight = highlighter.highlights[0]; // // Only grab highlights on the text layer @@ -129,6 +139,7 @@ export function getHighlightAndHighlightEls(highlighter, pageEl) { /** * Returns whether or not there currently is a non-empty selection. + * * @return {boolean} Whether there is a non-empty selection */ export function isSelectionPresent() { @@ -146,6 +157,7 @@ export function isSelectionPresent() { /** * Converts coordinates in PDF space to coordinates in DOM space. + * * @param {number[]} coordinates - Either a [x,y] coordinate location or * quad points in the format of 8xn numbers in PDF space in PDF units * @param {number} pageHeight - Height of page in CSS pixels, needed to convert @@ -167,6 +179,7 @@ export function convertPDFSpaceToDOMSpace(coordinates, pageHeight, scale) { /** * Converts coordinates in DOM space to coordinates in PDF space. + * * @param {number[]} coordinates - Either a [x,y] coordinate location or * quad points in the format of 8xn numbers in DOM space in CSS pixels * @param {number} pageHeight - Height of page in CSS pixels, needed to convert @@ -191,6 +204,7 @@ export function convertDOMSpaceToPDFSpace(coordinates, pageHeight, scale) { /** * Returns browser coordinates given an annotation location object and the HTML * element being annotated on. + * * @param {Object} location - Annotation location object * @param {HTMLElement} annotatedElement - HTML element being annotated on * @return {number[]} [x,y] browser coordinates @@ -218,6 +232,7 @@ export function getBrowserCoordinatesFromLocation(location, annotatedElement) { return convertPDFSpaceToDOMSpace([x, y], pageHeight, zoomScale); } +/* istanbul ignore next */ /** * Returns the coordinates of the quadrilateral representing this element * per the PDF text markup annotation spec. Note that these coordinates @@ -226,6 +241,7 @@ export function getBrowserCoordinatesFromLocation(location, annotatedElement) { * * We do this by letting the browser figure out the coordinates for us. * See http://stackoverflow.com/a/17098667 + * * @param {HTMLElement} element - Element to get quad points for * @param {HTMLElement} pageEl - Page element quad points are relative to * @param {number} scale - Document zoom scale @@ -234,7 +250,6 @@ export function getBrowserCoordinatesFromLocation(location, annotatedElement) { * element and the other 3 vertices in counterclockwise order. These are * in PDF default user space. */ -/* istanbul ignore next */ export function getQuadPoints(element, pageEl, scale) { const quadCornerContainerEl = document.createElement('div'); quadCornerContainerEl.classList.add('bp-quad-corner-container'); diff --git a/src/lib/annotations/image/imageAnnotatorUtil.js b/src/lib/annotations/image/imageAnnotatorUtil.js index 3554f8531..5ad647eec 100644 --- a/src/lib/annotations/image/imageAnnotatorUtil.js +++ b/src/lib/annotations/image/imageAnnotatorUtil.js @@ -11,8 +11,8 @@ const ROTATION_THRICE_DEG = -270; * @param {number} x - Annotation location x coordinate * @param {number} y - Annotation location y coordinate * @param {number} rotation - Current image rotation - * @param {Object} imageDimensions - * @param {number} scale + * @param {Object} imageDimensions - Image dimensions + * @param {number} scale - Zoom scale * @return {number[]} [x,y] browser coordinates */ export function getRotatedLocation(x, y, rotation, imageDimensions, scale) { @@ -40,8 +40,8 @@ export function getRotatedLocation(x, y, rotation, imageDimensions, scale) { * @param {number} x - Annotation location x coordinate * @param {number} y - Annotation location y coordinate * @param {number} rotation - Current image rotation - * @param {Object} imageDimensions - * @param {number} scale + * @param {Object} imageDimensions - Image dimensions + * @param {number} scale - Zoom scale * @return {number[]} [x,y] browser coordinates */ export function getLocationWithoutRotation(x, y, rotation, imageDimensions, scale) { diff --git a/src/lib/file.js b/src/lib/file.js index dd3e07500..84e791946 100644 --- a/src/lib/file.js +++ b/src/lib/file.js @@ -53,7 +53,7 @@ export function getRepresentation(file, repName) { /** * Is Watermarked * - * @param {object} file - Box file + * @param {Object} file - Box file * @return {boolean} Whether or not file is watermarked */ export function isWatermarked(file) { @@ -63,7 +63,7 @@ export function isWatermarked(file) { /** * Checks permission * - * @param {object} file - Box file + * @param {Object} file - Box file * @param {string} operation - Action to check permission for * @return {boolean} Whether or not action is permitted */ @@ -74,7 +74,7 @@ export function checkPermission(file, operation) { /** * Checks feature * - * @param {object} viewer - Viewer instance + * @param {Object} viewer - Viewer instance * @param {string} primary - Primary feature to check * @param {string} [secondary] - Secondary feature to check * @return {boolean} Whether or not feature is available diff --git a/src/lib/tokens.js b/src/lib/tokens.js index f887d0b05..9006fa5ae 100644 --- a/src/lib/tokens.js +++ b/src/lib/tokens.js @@ -5,9 +5,9 @@ const error = new Error('Missing Auth Token!'); * Helper function to create token map used below. * Maps the same token to multiple files. * - * @param {Array} ids - box file ids - * @param {string} token - * @return {Object} + * @param {Array} ids - Box file IDs + * @param {string} token - Token to use for map + * @return {Object} ID to token map */ function createIdTokenMap(ids, token) { const tokenMap = {}; @@ -25,8 +25,8 @@ function createIdTokenMap(ids, token) { * or an array of file ids * * @param {string|Array} id - box file id(s) - * @param {string|Function} token - * @return {void} + * @param {string|Function} token - Token to use or token generation function + * @return {Promise} Promise that resolves with ID to token map */ export default function getTokens(id, token) { // Access token should be available diff --git a/src/lib/util.js b/src/lib/util.js index 1a7583047..04332c18f 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -9,6 +9,12 @@ const CLIENT_NAME = __NAME__; const CLIENT_VERSION = __VERSION__; /* eslint-enable no-undef */ +/** + * Retrieves JSON from response. + * + * @param {Response} response - Response to parse + * @return {Promise|Response} Response if 204, otherwise promise that resolves with JSON + */ const parseJSON = (response) => { if (response.status === 204) { return response; @@ -16,8 +22,29 @@ const parseJSON = (response) => { return response.json(); }; + +/** + * Extract response body as text. + * + * @param {Response} response - Response to parse + * @return {Promise} Promise that resolves with text + */ const parseText = (response) => response.text(); + +/** + * Extract response body as blob. + * + * @param {Response} response - Response to parse + * @return {Promise} Promise that resolves with blob + */ const parseBlob = (response) => response.blob(); + +/** + * Pass through response. + * + * @param {Response} response - Response to pass through + * @return {Response} Unextracted response + */ const parseThrough = (response) => response; /** @@ -42,6 +69,10 @@ function checkStatus(response) { * Wrapper function for XHR post put and delete * * @private + * @param {string} method - XHR method + * @param {string} url - URL for XHR + * @param {Object} headers - Request headers + * @param {Object} data - Request data * @return {Promise} XHR promise */ function xhr(method, url, headers = {}, data = {}) { @@ -163,7 +194,7 @@ export function put(...rest) { * Used for downloads * * @param {string} url - URL to open - * @return {HTMLElement} + * @return {HTMLElement} IFrame element */ export function openUrlInsideIframe(url) { const iframe = createDownloadIframe(); @@ -176,7 +207,7 @@ export function openUrlInsideIframe(url) { * Used for printing * * @param {string} content - HTML content - * @return {HTMLElement} + * @return {HTMLElement} Iframe element */ export function openContentInsideIframe(content) { const iframe = createDownloadIframe(); @@ -190,7 +221,7 @@ export function openContentInsideIframe(content) { * * @param {Element} node - DOM node * @param {string} template - HTML template - * @return {DocumentFragment} + * @return {DocumentFragment} Document fragment */ export function createFragment(node, template) { const range = document.createRange(); @@ -579,7 +610,7 @@ export function replacePlaceholders(string, placeholderValues) { * Check to see if a file requires a Box3D viewer to be viewed * * @param {Object} file - The file to check - * @return {Boolean} True if the file needs a Box3D 360 degree viewer to be viewed + * @return {boolean} True if the file needs a Box3D 360 degree viewer to be viewed */ export function requires360Viewer(file) { // For now, we'll only support this preview if the filename has a secondary @@ -594,6 +625,7 @@ export function requires360Viewer(file) { * @param {HTMLElement} element - HTML element * @param {number} width - Width in pixels * @param {number} height - Height in pixels + * @return {void} */ export function setDimensions(element, width, height) { /* eslint-disable no-param-reassign */ diff --git a/src/lib/viewers/box3d/Box3DRenderer.js b/src/lib/viewers/box3d/Box3DRenderer.js index 65722b1cc..9f76ed376 100644 --- a/src/lib/viewers/box3d/Box3DRenderer.js +++ b/src/lib/viewers/box3d/Box3DRenderer.js @@ -368,6 +368,7 @@ class Box3DRenderer extends EventEmitter { /** * Enable the regular camera controls. * + * @param {string} cameraControllerId - Camera to enable * @return {void} */ enableCameraControls(cameraControllerId = PREVIEW_CAMERA_CONTROLLER_ID) { @@ -381,6 +382,7 @@ class Box3DRenderer extends EventEmitter { /** * Disable the regular camera controls. Useful when VR device is controlling camera. * + * @param {string} cameraControllerId - Camera to disable * @return {void} */ disableCameraControls(cameraControllerId = PREVIEW_CAMERA_CONTROLLER_ID) { @@ -437,6 +439,12 @@ class Box3DRenderer extends EventEmitter { createVrGamepad(handedness) { const controller = this.box3d.createNode(); + /** + * Gamepad model load handler. + * + * @param {Object} entities - Loaded entities + * @return {void} + */ const onGamepadModelLoad = (entities) => { const prefab = entities.find((e) => { return e.type === 'prefab'; @@ -450,6 +458,12 @@ class Box3DRenderer extends EventEmitter { } }; + /** + * Gamepad found handler. + * + * @param {Object} gamepad - Gamepad object + * @return {void} + */ const onGamepadFound = (gamepad) => { let controllerName = null; let commonEntities = null; diff --git a/src/lib/viewers/box3d/Box3DUIUtils.js b/src/lib/viewers/box3d/Box3DUIUtils.js index 972cef9c5..5304672c8 100644 --- a/src/lib/viewers/box3d/Box3DUIUtils.js +++ b/src/lib/viewers/box3d/Box3DUIUtils.js @@ -144,8 +144,6 @@ function createDropdown(labelText = '', listText = '', listContent = []) { /** * Used to register HTMLElements and events for easy management and destruction later. - * - * @class */ class UIRegistry { /** diff --git a/src/lib/viewers/box3d/Box3DViewer.js b/src/lib/viewers/box3d/Box3DViewer.js index bced94933..9f64312f9 100644 --- a/src/lib/viewers/box3d/Box3DViewer.js +++ b/src/lib/viewers/box3d/Box3DViewer.js @@ -322,7 +322,7 @@ const CLASS_VR_ENABLED = 'vr-enabled'; /** * Handle error events and emit a message * - * @param {Error} The - error that caused this to be triggered. To be emitted. + * @param {Error} error - The error that caused this to be triggered. To be emitted. * @return {void} */ handleError(error) { diff --git a/src/lib/viewers/box3d/SceneEntities.js b/src/lib/viewers/box3d/SceneEntities.js index f6d5925ec..6ac70ce6e 100644 --- a/src/lib/viewers/box3d/SceneEntities.js +++ b/src/lib/viewers/box3d/SceneEntities.js @@ -1,7 +1,8 @@ import Browser from '../../Browser'; /** * Returns the default scene entities array - * @return {array} Array of scene entities + * + * @return {Array} Array of scene entities */ function sceneEntities() { return [ diff --git a/src/lib/viewers/box3d/image360/Image360Renderer.js b/src/lib/viewers/box3d/image360/Image360Renderer.js index a30c34762..279c04a89 100644 --- a/src/lib/viewers/box3d/image360/Image360Renderer.js +++ b/src/lib/viewers/box3d/image360/Image360Renderer.js @@ -6,7 +6,6 @@ import sceneEntities from './SceneEntities'; * Image360Renderer * This class handles rendering the preview of the 3D model using the Box3D * Runtime library. - * @class */ class Image360Renderer extends Box3DRenderer { /** @@ -36,7 +35,7 @@ class Image360Renderer extends Box3DRenderer { /** * Cleanup the image and texture for the skybox. - * @method cleanupTexture + * * @private * @return {void} */ @@ -59,7 +58,6 @@ class Image360Renderer extends Box3DRenderer { * Get the skybox renderer component that exists on the root scene. * * @public - * @method getSkyboxComponent * @return {Object} A Box3d component for skybox rendering */ getSkyboxComponent() { @@ -74,7 +72,8 @@ class Image360Renderer extends Box3DRenderer { * Load a box3d json * * @inheritdoc - * @param {string} jsonUrl The url to the box3d json + * @param {string} assetUrl - The url to the box3d json + * @param {Object} options - Options * @return {Promise} a promise that resolves with the newly created runtime */ load(assetUrl, options = {}) { @@ -89,9 +88,9 @@ class Image360Renderer extends Box3DRenderer { /** * Load a box3d representation and initialize the scene. - * @method loadBox3dFile + * * @private - * @param {string} fileUrl - The representation URL. + * @param {string} assetUrl - The representation URL. * @param {string} assetPath - The asset path needed to access file * @return {void} */ diff --git a/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js b/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js index 7fd5a37f8..8d72e2719 100644 --- a/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js +++ b/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js @@ -62,7 +62,7 @@ class Model3DAnimationClipsPullup extends EventEmitter { * Format a duration, in seconds, as a time code of the form: HH:MM:SS. * @method formatDurationStr * @private - * @method {number} duration The duration, in seconds. + * @param {number} duration - The duration, in seconds. * @return {string} The time code string. */ formatDurationStr(duration) { diff --git a/src/lib/viewers/box3d/model3d/Model3DControls.js b/src/lib/viewers/box3d/model3d/Model3DControls.js index 98d4b740f..5983714f6 100644 --- a/src/lib/viewers/box3d/model3d/Model3DControls.js +++ b/src/lib/viewers/box3d/model3d/Model3DControls.js @@ -155,7 +155,7 @@ import { ICON_3D_RESET, ICON_ANIMATION, ICON_GEAR, ICON_PAUSE, ICON_PLAY } from /** * Handle change of render quality - * @param {string} mode - The quality level to use + * @param {string} level - The quality level to use * @return {void} */ handleSetQualityLevel(level) { diff --git a/src/lib/viewers/box3d/model3d/Model3DRenderer.js b/src/lib/viewers/box3d/model3d/Model3DRenderer.js index 87b5814ec..fcc9a59d5 100644 --- a/src/lib/viewers/box3d/model3d/Model3DRenderer.js +++ b/src/lib/viewers/box3d/model3d/Model3DRenderer.js @@ -49,10 +49,8 @@ const OPTIMIZE_FRAMETIME_THRESHOLD_MOBILE_VR = 66.6; // 15 FPS const DEFAULT_MODEL_SIZE = 1; /** - * Model3DRenderer * This class handles rendering the preview of the 3D model using the Box3D * Runtime library. - * @class */ class Model3DRenderer extends Box3DRenderer { /** @@ -129,8 +127,7 @@ class Model3DRenderer extends Box3DRenderer { * Load a box3d representation and initialize the scene. * * @private - * @param {string} fileUrl - The representation URL. - * @param {string} assetPath - The asset path needed to access file + * @param {string} assetUrl - The representation URL * @return {void} */ loadBox3dFile(assetUrl) { @@ -186,9 +183,9 @@ class Model3DRenderer extends Box3DRenderer { } /** - * Create an instance of the specified prefab and add it to the scene. - * @param {object} prefab - The prefab entity to instance. - * @param {object} scene - The scene asset to add the instance to. + * Adjust model for a scene. + * + * @param {Object} instance - Instance to adjust * @return {void} */ adjustModelForScene(instance) { @@ -574,6 +571,7 @@ class Model3DRenderer extends Box3DRenderer { * * @private * @param {string} level - Level name + * @return {void} */ setQualityLevel(level) { if (!this.box3d) { @@ -607,6 +605,12 @@ class Model3DRenderer extends Box3DRenderer { listenToRotateComplete(position, alignment) { this.isRotating = true; + /** + * Alignment adjustment after update. + * + * @param {boolean} finalize - Whether or not this is final alignment + * @return {void} + */ const postUpdate = (finalize) => { if (!this.instance) { return; diff --git a/src/lib/viewers/box3d/model3d/Model3DViewer.js b/src/lib/viewers/box3d/model3d/Model3DViewer.js index 7c102ce07..04ff95503 100644 --- a/src/lib/viewers/box3d/model3d/Model3DViewer.js +++ b/src/lib/viewers/box3d/model3d/Model3DViewer.js @@ -240,7 +240,8 @@ const DEFAULT_RENDER_GRID = true; /** * Handle error triggered by metadata load issues - * @param err {Error} The error thrown when trying to load metadata + * + * @param {Error} err - The error thrown when trying to load metadata * @return {void} */ onMetadataError(err) { @@ -254,6 +255,7 @@ const DEFAULT_RENDER_GRID = true; /** * Populate control bar with animation playback UI. + * * @method populateAnimationControls * @private * @return {void} @@ -303,6 +305,7 @@ const DEFAULT_RENDER_GRID = true; /** * Show the preview wrapper container element + * * @return {void} */ showWrapper() { @@ -331,7 +334,8 @@ const DEFAULT_RENDER_GRID = true; /** * Handle set render mode event - * @param {string} mode The selected render mode string + * + * @param {string} mode - The selected render mode string * @return {void} */ handleSetRenderMode(mode = 'Lit') { @@ -341,6 +345,7 @@ const DEFAULT_RENDER_GRID = true; /** * Show, hide or toggle the 'helpers' in the scene. These include the grid display * and axis markings. + * * @method handleToggleHelpers * @private * @param {boolean} show - True or false to show or hide. If not specified, the helpers will be toggled. @@ -352,7 +357,9 @@ const DEFAULT_RENDER_GRID = true; /** * Handle setting camera projection + * * @private + * @param {string} projection - Camera projection * @return {void} */ handleSetCameraProjection(projection) { @@ -361,7 +368,9 @@ const DEFAULT_RENDER_GRID = true; /** * Handle setting quality level for rendering + * * @private + * @param {string} level - Quality level * @return {void} */ handleSetQualityLevel(level) { @@ -370,6 +379,7 @@ const DEFAULT_RENDER_GRID = true; /** * Handle setting skeleton visibility. + * * @private * @param {boolean} visible - Indicates whether or not skeletons are visible. * @return {void} @@ -380,6 +390,7 @@ const DEFAULT_RENDER_GRID = true; /** * Handle setting wireframe visibility. + * * @private * @param {boolean} visible - Indicates whether or not wireframes are visible. * @return {void} @@ -390,6 +401,7 @@ const DEFAULT_RENDER_GRID = true; /** * Handle setting grid visibility. + * * @private * @param {boolean} visible - Indicates whether or not the grid is visible. * @return {void} diff --git a/src/lib/viewers/box3d/model3d/Model3DVrControls.js b/src/lib/viewers/box3d/model3d/Model3DVrControls.js index 0a93e9565..65be43730 100644 --- a/src/lib/viewers/box3d/model3d/Model3DVrControls.js +++ b/src/lib/viewers/box3d/model3d/Model3DVrControls.js @@ -15,9 +15,7 @@ const buttonMap = { }; /** - * Model3DVrControls * This class handles the gamepad input used my the Model3D viewer while in VR mode. - * @class */ class Model3DVrControls { constructor(vrGamepads, box3dEngine) { diff --git a/src/lib/viewers/box3d/model3d/SceneEntities.js b/src/lib/viewers/box3d/model3d/SceneEntities.js index 119276a76..878b1e923 100644 --- a/src/lib/viewers/box3d/model3d/SceneEntities.js +++ b/src/lib/viewers/box3d/model3d/SceneEntities.js @@ -3,8 +3,9 @@ import { MODEL3D_STATIC_ASSETS_VERSION } from '../../../constants'; /** * Returns the default scene entities array - * @param {string} prefix Prefix to be used for loading static assets - * @return {array} Array of scene entities + * + * @param {string} prefix - Prefix to be used for loading static assets + * @return {Array} Array of scene entities */ function sceneEntities(prefix) { return [ diff --git a/src/lib/viewers/doc/DocFindBar.js b/src/lib/viewers/doc/DocFindBar.js index a3e315969..00cdf6eb8 100644 --- a/src/lib/viewers/doc/DocFindBar.js +++ b/src/lib/viewers/doc/DocFindBar.js @@ -15,10 +15,12 @@ const FIND_MATCH_PENDING = 3; @autobind class DocFindBar extends EventEmitter { /** - * @constructor - * @param {string|HTML Element} findBar Find Bar node - * @param {Object} findController - * @return {void} + * [constructor] + * + * @param {string|HTMLElement} findBar - Find bar selector or element + * @param {Object} findController - Document find controller to use + * @param {boolean} canDownload - Whether user can download document or not + * @return {DocFindBar} DocFindBar instance */ constructor(findBar, findController, canDownload) { super(); @@ -106,8 +108,9 @@ const FIND_MATCH_PENDING = 3; /** * Dispatch custom find event based specified type - * @param {string} type - * @param {boolean} findPrev + * + * @param {string} type - Find event type + * @param {boolean} findPrev - Whether or not to find previous occurrence * @return {void} */ dispatchFindEvent(type, findPrev) { @@ -214,9 +217,10 @@ const FIND_MATCH_PENDING = 3; //-------------------------------------------------------------------------- /** * Handler to show/hide find bar - * @param {Event} event - * @return {void} + * * @private + * @param {Event} event - Key event + * @return {void} */ displayFindBarHandler(event) { // Lowercase keydown so we capture both lower and uppercase @@ -249,7 +253,8 @@ const FIND_MATCH_PENDING = 3; /** * Handler for find keyboard short cuts - * @param {Event} event + * + * @param {Event} event - Key event * @return {void} * @private */ diff --git a/src/lib/viewers/image/ImageBaseViewer.js b/src/lib/viewers/image/ImageBaseViewer.js index bf855979c..2ff04d496 100644 --- a/src/lib/viewers/image/ImageBaseViewer.js +++ b/src/lib/viewers/image/ImageBaseViewer.js @@ -13,6 +13,7 @@ const CSS_CLASS_PANNABLE = 'pannable'; @autobind class ImageBaseViewer extends BaseViewer { /** * [destructor] + * * @return {void} */ destroy() { @@ -218,6 +219,7 @@ const CSS_CLASS_PANNABLE = 'pannable'; * Handles image element loading errors. * * @private + * @param {Error} err - Error to handle * @return {void} */ errorHandler = (err) => { diff --git a/src/lib/viewers/image/MultiImageViewer.js b/src/lib/viewers/image/MultiImageViewer.js index dab2d9a95..97247fefb 100644 --- a/src/lib/viewers/image/MultiImageViewer.js +++ b/src/lib/viewers/image/MultiImageViewer.js @@ -131,8 +131,9 @@ const ZOOM_UPDATE_PAN_DELAY = 50; /** * Handles zoom - * @param {string} [type] - Type of zoom in|out|reset + * * @private + * @param {string} [type] - Type of zoom in|out|reset * @return {void} */ zoom(type) { @@ -196,7 +197,7 @@ const ZOOM_UPDATE_PAN_DELAY = 50; /** * Binds error and load event listeners for an image element. * - * @protected + * @param {number} index - Index of image to bind listeners to * @return {void} */ bindImageListeners(index) { @@ -210,7 +211,7 @@ const ZOOM_UPDATE_PAN_DELAY = 50; /** * Unbinds error and load event listeners for an image element. * - * @protected + * @param {number} index - Index of image to unbind listeners from * @return {void} */ unbindImageListeners(index) { diff --git a/src/lib/viewers/media/DashViewer.js b/src/lib/viewers/media/DashViewer.js index b61ad22ac..8c82c0285 100644 --- a/src/lib/viewers/media/DashViewer.js +++ b/src/lib/viewers/media/DashViewer.js @@ -154,6 +154,8 @@ const MANIFEST = 'manifest.mpd'; * Manifest type will use an asset name. Segments will not. * * @private + * @param {string} type - Request type + * @param {Request} request - Request to filter * @return {void} */ requestFilter(type, request) { @@ -167,7 +169,7 @@ const MANIFEST = 'manifest.mpd'; * Gets the active track * * @private - * @return {Object|undefined} + * @return {Object|undefined} Active track or undefined if there is no active track */ getActiveTrack() { const tracks = this.player.getVariantTracks(); @@ -178,7 +180,7 @@ const MANIFEST = 'manifest.mpd'; * Shows the loading indicator * * @override - * @param {number} id - rep id + * @param {number} id - Rep id * @return {void} */ showLoadingIcon(id) { @@ -214,7 +216,7 @@ const MANIFEST = 'manifest.mpd'; * Enables or disables automatic adaptation * * @private - * @param {boolean} [adapt] - enable or disable adaptation + * @param {boolean} [adapt] - Enable or disable adaptation * @return {void} */ enableAdaptation(adapt = true) { @@ -298,7 +300,7 @@ const MANIFEST = 'manifest.mpd'; * Handles errors thrown by shaka player. See https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html * * @private - * @param {Object} shakaError + * @param {Object} shakaError - Error to handle * @return {void} */ shakaErrorHandler(shakaError) { diff --git a/src/lib/viewers/media/MediaControls.js b/src/lib/viewers/media/MediaControls.js index bf2bec1c8..0d232a1f8 100644 --- a/src/lib/viewers/media/MediaControls.js +++ b/src/lib/viewers/media/MediaControls.js @@ -360,6 +360,9 @@ const FILMSTRIP_FRAME_HEIGHT = 90; /** * Toggles label for control element with more than one state + * + * @param {HTMLElement} el - Label element + * @param {string} label - String for label * @return {void} */ setLabel(el, label) { @@ -369,7 +372,8 @@ const FILMSTRIP_FRAME_HEIGHT = 90; /** * Tells if settings menu is open - * @return {boolean} true or false + * + * @return {boolean} Whether settings are visible */ isSettingsVisible() { return !!this.settings && this.settings.isVisible(); @@ -729,7 +733,7 @@ const FILMSTRIP_FRAME_HEIGHT = 90; * @param {number} rectLeft - Left position of the bounding rectangle * @param {number} rectWidth - Width of the bounding rectangle * @param {number} filmstripWidth - Pixel width of the filmstrip - * @return {Object} + * @return {Object} Filmstrip position object */ computeFilmstripPositions(pageX, rectLeft, rectWidth, filmstripWidth) { const time = this.timeScrubber.computeScrubberPosition(pageX) * this.mediaEl.duration; // given the mouse X position, get the relative time @@ -802,7 +806,7 @@ const FILMSTRIP_FRAME_HEIGHT = 90; /** * Checks if focus is on the time-scrubber * - * @return {boolean} + * @return {boolean} Whether time scrubber is focused */ isTimeScrubberFocused() { return document.activeElement === this.timeScrubberEl; @@ -811,7 +815,7 @@ const FILMSTRIP_FRAME_HEIGHT = 90; /** * Checks if focus is on the volume-scrubber * - * @return {boolean} + * @return {boolean} Whether volume scrubber is focused */ isVolumeScrubberFocused() { return document.activeElement === this.volScrubberEl; diff --git a/src/lib/viewers/media/Settings.js b/src/lib/viewers/media/Settings.js index 9c7a013b0..0ce988b50 100644 --- a/src/lib/viewers/media/Settings.js +++ b/src/lib/viewers/media/Settings.js @@ -153,9 +153,8 @@ const SUBTITLES_SUBITEM_TEMPLATE = `
{ diff --git a/src/lib/viewers/text/MarkdownViewer.js b/src/lib/viewers/text/MarkdownViewer.js index ffbfdb715..f827c94a4 100644 --- a/src/lib/viewers/text/MarkdownViewer.js +++ b/src/lib/viewers/text/MarkdownViewer.js @@ -67,9 +67,9 @@ const STATIC_URI = `third-party/text/${TEXT_STATIC_ASSETS_VERSION}/`; * Finishes loading by parsing Markdown and highlighting any necessary code. * * @override + * @protected * @param {string} content - Markdown text * @return {void} - * @protected */ finishLoading(content) { const md = this.initRemarkable(); @@ -90,8 +90,8 @@ const STATIC_URI = `third-party/text/${TEXT_STATIC_ASSETS_VERSION}/`; * Loads controls for fullscreen. Markdown viewer doesn't have zoom in or out. * * @override - * @return {void} * @protected + * @return {void} */ loadUI() { this.controls = new Controls(this.containerEl); @@ -107,8 +107,8 @@ const STATIC_URI = `third-party/text/${TEXT_STATIC_ASSETS_VERSION}/`; /** * Initializes and returns Remarkable parser. * - * @return {Remarkable} * @private + * @return {Remarkable} Remarkable parser instance */ initRemarkable() { /* global Remarkable */