This module handles sword:// URL navigation across the application. It parses sword:// URLs, determines the target module type, and routes to the appropriate tool panel (Dictionary, Word Study, or Commentary).
sword:// URL format: sword://ModuleName/Key When no module is specified (sword:///Key), the key is treated as a scripture reference using the current Bible translation.
Methods
# static handleSwordUrl(href, referenceBoxHelperopt)
Handle a sword:// URL by determining the target module type and routing to the appropriate panel.
- Strongs dictionary modules -> Word Study Panel
- Dictionary / Map / Image modules -> Dictionary Panel
- Bible modules or no module specified -> Reference box (scripture navigation)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
href |
string
|
The sword:// URL to handle |
||
referenceBoxHelper |
Object
|
<optional> |
null | Optional ReferenceBoxHelper instance for handling scripture references. If provided, Bible references will be shown in the reference box of the calling panel. |
# static initSwordUrlLinks(container, referenceBoxHelperopt)
Set up click handlers for all sword:// links within a given container element. This finds all elements whose href contains 'sword://' and attaches click handlers that delegate to handleSwordUrl.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
container |
HTMLElement
|
The DOM element to search for sword:// links |
||
referenceBoxHelper |
Object
|
<optional> |
null | Optional ReferenceBoxHelper for scripture refs |
# static isSwordUrl(href) → {boolean}
Check whether a given href string is a sword:// URL.
Parameters:
| Name | Type | Description |
|---|---|---|
href |
string
|
The URL to check |
True if the href is a sword:// URL
boolean
# async inner handleCommentaryReference(moduleName, key)
Handle navigation to a commentary module entry. Opens the entry in the Commentary Panel, switching to the correct module if necessary.
Parameters:
| Name | Type | Description |
|---|---|---|
moduleName |
string
|
The commentary module code |
key |
string
|
The entry key to open |
# async inner handleDictionaryReference(moduleName, key)
Handle navigation to a dictionary/map/image module entry. Opens the entry in the Dictionary Panel, switching to the correct module if necessary.
Parameters:
| Name | Type | Description |
|---|---|---|
moduleName |
string
|
The dictionary module code |
key |
string
|
The entry key to open |
# async inner handleScriptureReference(key, referenceBoxHelperopt)
Handle a scripture reference key (e.g., Gen.1.1). If a referenceBoxHelper is provided, the reference is shown inline in the calling panel's reference box. Otherwise it is ignored.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
key |
string
|
The OSIS scripture reference |
||
referenceBoxHelper |
Object
|
<optional> |
null | Optional ReferenceBoxHelper |
# async inner handleStrongsReference(moduleName, key)
Handle navigation to a Strongs dictionary entry. Builds the proper Strongs key (e.g., G4652 or H1234) and opens it in the Word Study Panel.
Parameters:
| Name | Type | Description |
|---|---|---|
moduleName |
string
|
The Strongs module name |
key |
string
|
The raw key from the URL |
# inner parseSwordUrl(href) → {Object|null}
Parse a sword:// URL into its module and key components.
Parameters:
| Name | Type | Description |
|---|---|---|
href |
string
|
The sword:// URL to parse |
Parsed URL components, or null if invalid
Object
|
null
# inner showModuleNotInstalledMessage(moduleName)
Show a toast notification when a referenced module is not installed.
Parameters:
| Name | Type | Description |
|---|---|---|
moduleName |
string
|
The module code that is not installed |
# inner switchToPanel(panelId)
Switch the tool panel to the specified panel ID.
Parameters:
| Name | Type | Description |
|---|---|---|
panelId |
string
|
The panel ID to switch to (e.g., 'dictionary-panel', 'word-study-panel') |