Methods
attributeChangedCallback()
Native event that fires when element attribute changes.
Handle 'media' attribute when changed.
- Source:
connectedCallback()
Initializes component when inserted into DOM.
- Source:
disconnectedCallback()
Stops monetization when component is removed from DOM.
- Source:
initNotifications()
Binds to default notifications.
Shown on 'paragraphPending' event and hidden on 'paragraphLoaded' event.
- Source:
(async) loadParagraph()
Load the next paragragh, add it to DOM and start observing when it becomes visible
(which will cause another paragraph to be loaded).
When paragrah is loaded from backend, 'paragraphLoading' and 'paragraphLoaded'
events will be emitted.
- Source:
parseMedia()
Initialize frontend mode, if 'media' attribute exists.
In frontend mode the text is parsed from 'media' attribute,
and not loaded from the backend.
- Source:
startLoadingText()
Creates an IntersectionObserver, that calls loadParagraph()
when the last paragragh is visible on the screen.
- Source: