Passage display options

Working out which features are supported by a particular version

Passage options are dynamically worked out for each version that is available. For example, the BBE text does not contain strong numbers. As a result, no interlinear options will be available. getFeatures defined in JSwordMetadataServiceImpl defines which options are available for any given version. This is used to determine whether a version supports a particular feature.

Because the user may switch version, and have their options grayed out, it is important to trim these options down to what is supported by the version. The trim() function in BibleInformationServiceImpl is responsible for trimming down options that are not supported by particular layouts (e.g. normal, interlinear, interleaved, column view) and reducing the requested options to those that are supported by the selected options.

What is a LookupOption

The LookupOption defines the name of the minimum stylesheet required to execute a request. JSwordPassageServiceImpl iterates through the selected LookupOptions and works out which stylesheet to use. 

  • commentaries.xsl: used for all commentaries
  • interlinear.xsl: used for all interlinears, that is, where words are matched vertically, for example, with the lexicon line, transliteration line, Greek or Hebrew text, etc.
  • default.xsl: used if no other stylesheet will be used

The stylesheets were originally based on BibleDesktop's stylesheets. As a result, they contain a bit of repetition which could ideally be refactored, given time.

Toolbar menu in the client-side code

The event "version-changed-{passageId}" where passageId is the column number (indexed from 0) is listened upon. When an event is fired, a new call is made to the server (BIBLE_GET_FEATURES). Its response is the set of features available in the current mode of display (e.g. Interleaved). Options that are not available are grayed out.