Element

livelike-widgets

Hierarchy

  • LitElement
    • LiveLikeWidgets

Constructors

Properties

authors: boolean = false

Add to element to enabled listing the widget author tag in timeline mode

customTemplateRenderer: CustomWidgetRenderer
customWidgetRenderer: CustomWidgetRenderer
dataId: string = ...
dateTimeFormatter: ((__namedParameters) => string) = formatDateTime

Type declaration

    • (__namedParameters): string
    • Formats timestamp

      Parameters

      • __namedParameters: {
            format: any;
            lang: any;
            time: any;
        }
        • format: any
        • lang: any
        • time: any

      Returns string

      Since

      2.43.0

      Argument

      object of type {time, format, lang}

hasWidgetAttached: boolean = false
hide_dismiss_button: boolean = false

Boolean to toggle displaying the widget's dismiss button

lang: any

Sets language code

loaded: boolean = false

If the element has loaded

mode: string = 'pop-up'

The mode of the element. Either "pop-up" or "timeline". Default is "pop-up"

programid: any

The id of the program to load the element with

queue: any
reactions: boolean = false

If true, widget reactions are shown once widget is not longer in 'ready' or 'interactive' phase

syncStrategy: any

Sets the custom syncStrategy

timeformat: {
    day: string;
    hour: string;
    minute: string;
    month: string;
    year: string;
} = ...

Object containing time formatting properties.

Type declaration

  • day: string
  • hour: string
  • minute: string
  • month: string
  • year: string
timestamps: boolean = false

Add to element to enabled listing the widget timestamps tag in timeline mode

updating: boolean = false

Methods

  • Parameters

    • __namedParameters: {
          interactionUrl: any;
          widgets: any;
      }
      • interactionUrl: any
      • widgets: any

    Returns Promise<void>

  • Parameters

    • widgetEl: Widget
    • position: "append" | "prepend"

    Returns Promise<void>

    Async

    Attaches widget to DOM. Fires widgetattached events.

    Fires

    widgetattached

  • Creates and queues widget from widget id and kind. Displays widget according to syncStrategy.

    Parameters

    Returns Promise<unknown>

    See

    https://docs.livelike.com/docs/web-spoiler-free-sync

    Since

    1.18.0

    Example

    const widgetEl = document.querySelector('livelike-widgets')\n
    widgetEl.createSyncWidget({id: c1f6082c-f7b9-4d1e-b64e-9071a3860ffc, kind: 'text-poll'})
  • Creates and immediately displays widget.

    Parameters

    Returns Promise<unknown>

    Since

    1.18.0

    Example

    const widgetEl = document.querySelector('livelike-widgets')\n
    widgetEl.createWidgetElement({id: c1f6082c-f7b9-4d1e-b64e-9071a3860ffc, kind: 'text-poll'})
  • Parameters

    Returns Promise<void>

    Async

    Removes widget from DOM. Fires beforewidgetdetached and widgetdetached events. Removes listeners.

    Fires

    beforewidgetdetached

    Fires

    widgetdetached

  • Returns void

  • Adds widget to the widgetQueue for spoiler prevention

    Parameters

    Returns any

    Since

    1.18.0

    Link

    spoilerPrevention

  • Returns void

  • Returns Promise<any>

  • Returns any

  • Parameters

    • programId: any

    Returns Promise<void>

  • Parameters

    • __namedParameters: {
          widgets: any;
      }
      • widgets: any

    Returns any

  • Parameters

    • __namedParameters: {
          widgets: any;
      }
      • widgets: any

    Returns any

  • Parameters

    • widgetPayload: any

    Returns any

  • Parameters

    • __namedParameters: {
          widget: any;
      }
      • widget: any

    Returns number

  • Registers widget mode

    Parameters

    Returns void

  • Returns TemplateResult

  • Immediately begins widget lifecycle and state transitions.

    Parameters

    Returns Promise<unknown>

    Since

    1.18.0

  • Returns void

  • Parameters

    • changedProps: any

    Returns void

  • Parameters

    • e: any

    Returns void

Generated using TypeDoc