Module for auto-linking glossary entries.
- Source:
- Copyright:
- 2023 Mihail Geshoski
- 2023 Mihail Geshoski
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(static, constant) init
Initialize the module.
(inner, constant) The :Object
object containing the relevant selectors.
Type:
- Object
Methods
(inner) fetchGlossaryEntry(entryId) → {Promise}
Fetch the linked glossary entry.
Parameters:
Name | Type | Description |
---|---|---|
entryId |
int | The id of the linked glossary entry. |
Returns:
The glossary entry promise.
- Type
- Promise
(inner) generateTagListData(tags) → {Object}
Generates an object that contains the data required to render a tag list.
Parameters:
Name | Type | Description |
---|---|---|
tags |
array | The array containing the tags related to the linked glossary entry. |
Returns:
The data required to render a tag list.
- Type
- Object
(inner) glossaryEntryViewed(entryId) → {Promise}
Notify that the linked glossary entry was viewed.
Parameters:
Name | Type | Description |
---|---|---|
entryId |
int | The id of the linked glossary entry. |
Returns:
The promise object.
- Type
- Promise
(inner) registerEventListeners() → {void}
Register the event listeners for the glossary entry auto-linker.
Returns:
- Type
- void
(inner) showGlossaryEntry(entryId) → {Promise}
Show the linked glossary entry in a modal.
Parameters:
Name | Type | Description |
---|---|---|
entryId |
int | The id of the linked glossary entry. |
Returns:
The modal promise.
- Type
- Promise