Module

sword_url_helper

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.

View Source frontend/helpers/sword_url_helper.js, line 21

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.

View Source frontend/helpers/sword_url_helper.js, line 102

# static isSwordUrl(href) → {boolean}

Check whether a given href string is a sword:// URL.

Parameters:
Name Type Description
href string

The URL to check

View Source frontend/helpers/sword_url_helper.js, line 85

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

View Source frontend/helpers/sword_url_helper.js, line 199

# 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

View Source frontend/helpers/sword_url_helper.js, line 185

# 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

View Source frontend/helpers/sword_url_helper.js, line 213

# 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

View Source frontend/helpers/sword_url_helper.js, line 150

# 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

View Source frontend/helpers/sword_url_helper.js, line 39

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

View Source frontend/helpers/sword_url_helper.js, line 230

# 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')

View Source frontend/helpers/sword_url_helper.js, line 243