Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is responsible for rendering the individual elements of a search result page.

Hierarchy

  • PageRenderer

Index

Constructors

constructor

  • Parameters

    • page: Page

      The corresponding page whose content is to be rendered.

    Returns PageRenderer

Accessors

didYouMeanTemplate

  • The 'Did you mean' template that is used to render alternative search suggestions.

    Returns DidYouMeanTemplate

paginationTemplate

  • The pagination template that is used to render a single pagination element.

    Returns PaginationTemplate

searchResultTemplate

  • The search result template that is used to render the search results.

    Returns SearchResultTemplate

Methods

renderDidYouMean

  • renderDidYouMean(): HTMLElement
  • Renders all 'Did you mean' suggestions into a div-element using the provided didYouMeanTemplate.

    throws

    an error if there are no 'Did you mean' search suggestions.

    Returns HTMLElement

    An element for you to place wherever you want in your DOM Tree.

renderDidYouMeanToHTMLElement

  • renderDidYouMeanToHTMLElement(element: HTMLElement): void
  • Renders all 'Did you mean' suggestions into a div-element using the provided didYouMeanTemplate and appends it to the element.

    throws

    an error if there are no 'Did you mean' search suggestions.

    Parameters

    • element: HTMLElement

      The html div element to attach the suggestions to.

    Returns void

renderNextButton

  • renderNextButton(label?: string): HTMLElement | undefined
  • Renders a next button (if a next page exists) using the paginationTemplate.

    Parameters

    • Default value label: string = "Next"

      The label used to describe the button.

    Returns HTMLElement | undefined

renderNextButtonToHTMLElement

  • renderNextButtonToHTMLElement(element: HTMLElement, label?: string): void
  • Renders a next button (if a next page exists) using the paginationTemplate and appends it to the element.

    Parameters

    • element: HTMLElement

      The HTML element to which the button is attached.

    • Default value label: string = "Next"

      The label used to describe the button.

    Returns void

renderPageButtons

  • renderPageButtons(amount: number): HTMLElement[]
  • Renders the buttons that are used to navigate to a specific page using the paginationTemplate.

    Parameters

    • amount: number

      The number of page buttons that are rendered.

    Returns HTMLElement[]

renderPageButtonsToHTMLElement

  • renderPageButtonsToHTMLElement(element: HTMLElement, amount: number): void
  • Renders the buttons that are used to navigate to a specific page using the paginationTemplate and appends it to the element.

    Parameters

    • element: HTMLElement

      The HTML element to which the button is attached.

    • amount: number

      The number of page buttons that are rendered.

    Returns void

renderPagination

  • renderPagination(amount: number): HTMLElement
  • Renders the complete navigation (previous button, page buttons and next button) using the paginationTemplate.

    Parameters

    • amount: number

      The number of page buttons that are rendered.

    Returns HTMLElement

renderPaginationToHTMLElement

  • renderPaginationToHTMLElement(element: HTMLElement, amount: number): void
  • Renders the complete navigation (previous button, page buttons and next button) using the paginationTemplate and appends them to the element.

    Parameters

    • element: HTMLElement

      The HTML element to which the button is attached.

    • amount: number

      The number of page buttons that are rendered.

    Returns void

renderPrevButton

  • renderPrevButton(label?: string): HTMLElement | undefined
  • Renders a previous button (if a previous page exists) using the paginationTemplate.

    Parameters

    • Default value label: string = "Prev"

      The label used to describe the button.

    Returns HTMLElement | undefined

renderPrevButtonToHTMLElement

  • renderPrevButtonToHTMLElement(element: HTMLElement, label?: string): void
  • Renders a previous button (if a previous page exists) using the paginationTemplate and appends it to the element.

    Parameters

    • element: HTMLElement

      The HTML element to which the button is attached.

    • Default value label: string = "Prev"

      The label used to describe the button.

    Returns void

renderSearchResults

  • renderSearchResults(): HTMLElement
  • Renders all search results into a div-element using the searchResultTemplate.

    Returns HTMLElement

    An element for you to place wherever you want in your DOM Tree.

renderSearchResultsToHTMLElement

  • renderSearchResultsToHTMLElement(element: HTMLElement): void
  • Renders all search results into a div-element using the searchResultTemplate and appends it to the element.

    Parameters

    • element: HTMLElement

      The html div element to attach the search results to.

    Returns void

Generated using TypeDoc