A selector is a wrapper for the combination of an accordion that has a carousel in each of its elements. To use the bootstrap functionality of an accordion it needs unique ids. The selector class generates unique ids on creation to avoid id collision.

The selector uses two classes to delegate functionality:

  • SelectorCarousel
  • CounterManager

Hierarchy (View Summary)

Constructors

  • Parameters

    • circuitFiles: CircuitFilesManager

      {CircuitFilesManager}

    • pageToShowAnimationOn: typeof Page

      {typeof Page}

    • idLangMap: Map<string, Function> = undefined

      {Map<string, function>} filed ids to update with the language manager call to get language value

    Returns Selector

Properties

accordionID: number
carousels: Map<string, SelectorCarousel> = ...
circuitFiles: CircuitFilesManager
counters: CounterManager
idLangMap: Map<any, any> = ...

string is an id used for an element in the dom that displays a language string. The language string is retrieved dynamically from the LanguageManager and put as innerHTML of the element if Content.updateLang is called

items: Map<string, HTMLDivElement> = ...
mainID: string

the id of the element in the dom that holds this content

Accessors

  • get accordionDiv(): string

    Returns string

  • get accordionItem(): Element

    Returns Element

Methods

  • Parameters

    • identifier: any
    • idx: any

    Returns void

  • adds event listeners to elements if necessary

    Returns void

  • Executes code that depends on Pyodide fully loaded. Is called after Pyodide is ready and makes changes to the element created with this.setup() that can only be active or made after Pyodide is loaded. Is called by PageManager as soon as Pyodide is ready.

    Returns void

  • Returns HTMLButtonElement

  • generate a start button that can display the loading progress of Pyodide

    Parameters

    • id: string

      {string} id of the element in the dom

    Returns HTMLButtonElement

  • Returns Promise<void>

  • Parameters

    • updateCounter: boolean = true

    Returns void

  • Parameters

    • element: any
    • key: any

    Returns void

  • Returns HTMLDivElement

  • Is called after the Page is usable by PageManager and is the set-up of funny functionality but not necessary for function of page.

    Returns void

  • adds the innerHTML to an HTML element that indicate the loading progress of Pyodide

    Parameters

    • startBtn: HTMLButtonElement

      {HTMLButtonElement}

    Returns void

  • updates the color of elements, text or headings if necessary

    Returns void

  • Parameters

    • identifier: {
          capacitor: string;
          inductor: string;
          kirchhoff: string;
          magnetic: string;
          mixed: string;
          quickstart: string;
          resistor: string;
          symbolic: string;
          wheatstone: string;
      }

      {window.definitions.selectorIDs}

    Returns void

  • iterates over each id specified in Content.idLangMap and reassigns the current language string to the innerHTML of the element retrieved from the dom with document.getElementById(id)

    Returns void