Title

Global

Members

# constant crypto

Computes a hash using the same algorithm that the Dropbox API uses for the the "content_hash" metadata field.

The digest() method returns a raw binary representation of the hash. The "content_hash" field in the Dropbox API is a hexadecimal-encoded version of the digest.

Example:

const fs = require('fs');
const dch = require('dropbox-content-hasher');

const hasher = dch.create();
const f = fs.createReadStream('some-file');
f.on('data', function(buf) {
  hasher.update(buf);
});
f.on('end', function(err) {
  const hexDigest = hasher.digest('hex');
  console.log(hexDigest);
});
f.on('error', function(err) {
  console.error("Error reading from file: " + err);
  process.exit(1);
});

View Source backend/db_sync/dropbox_content_hasher.js, line 33

Methods

# clearLongPressTimer()

method responsible for clearing a pending long press timer

View Source frontend/controllers/longpress_controller.js, line 114

# generateDocument()

The docxController implements the generation of a Word document with certain verses with notes or tags. docxController.generateDocument gets called from exportController. Paragraph and heading styles for the generated Word document as well as some other helpful functions located in docxHelper.

View Source frontend/components/docx_export/docx_controller.js, line 33

# getCachedItem(key, defaultValue, shouldCheckIfInvalid) → {Promise.<(string|boolean)>}

Function for checking and getting item from the cache

Parameters:
Name Type Description
key string

cache key

defaultValue boolean | any

default value to return if no cache on that key or cache is invalid

shouldCheckIfInvalid boolean

should it check for validity of the cache

View Source frontend/controllers/cache_controller.js, line 31

cached string or false/default value if cache is invalid or not exists

Promise.<(string|boolean)>

# getLanguageCode()

returns ISO 639 language code (2-letter if available or 3-letter otherwise)

View Source backend/database/migrations/20190610132341-updateTranslationLanguageCodes.js, line 35

# handleTouchMove(event)

If the finger moves MAX_TOUCH_SHIFT pixels during long-press, cancel the timer

Parameters:
Name Type Description
event MouseEvent

browser event object

View Source frontend/controllers/longpress_controller.js, line 71

# listCheckboxSection(arr, selected, sectionTitleopt, options) → {DocumentFragment}

Generates an HTML fragment with title and checkboxes from array of items

Parameters:
Name Type Attributes Default Description
arr Array

array of items

selected Set.<string>

array of values that will be shown as checked

sectionTitle string <optional>

Section title

options object

additional options for the layout

columns number <optional>
'auto-fill'

number of columns

info boolean <optional>
false

display info icon and generate event on click

extraIndent boolean <optional>
false

add extra indent to make sure that all item icons will be visible

rowGap string <optional>
"0.5em"

CSS size for the gap between the rows

limitRows boolean <optional>
false

Explicity set grid rows height (for performance)

View Source frontend/components/module_assistant/assistant_helper.js, line 78

HTML fragment with appropriate elements for each item

DocumentFragment

# saveWordDocument()

The ExportController saves exported verses with notes or tags as generated Word document.

View Source frontend/components/docx_export/export_controller.js, line 27

# startTimer() → {object}

Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance

View Source frontend/controllers/longpress_controller.js, line 91

handle to the timeout object

object

# subscribe(event) → {void}

Starts the timer on mouse down and logs current position

Parameters:
Name Type Description
event MouseEvent

browser event object

View Source frontend/controllers/longpress_controller.js, line 47

void

Type Definitions

"on-startup-completed" | "on-theme-changed" | "on-fullscreen-changed" | "on-button-clicked" | "on-body-clicked" | "on-db-refresh"

# AppEvents

View Source frontend/event_types.js, line 41

# BibleBook

The BibleBook model is used to manage Bible books.

View Source backend/database/models/biblebook.js, line 285

"on-verse-list-init" | "on-bible-text-loaded" | "on-translation-changed" | "on-verses-selected"

# BibleTextEvents

View Source frontend/event_types.js, line 23

"on-locale-changed"

# I18nEvents

View Source frontend/event_types.js, line 38

# MetaRecord

The MetaRecord model is used to manage meta information for the Ezra Bible App database, currently the time of the last modification.

View Source backend/database/models/metarecord.js, line 21

"on-all-translations-removed" | "on-translation-removed" | "on-translation-added" | "on-dictionary-added" | "on-commentary-added" | "on-commentary-removed"

# ModuleAssistantEvents

View Source frontend/event_types.js, line 32

"on-module-search-started"

# ModuleSearchEvents

View Source frontend/event_types.js, line 56

# Note

The Note model is used to manage notes.

View Source backend/database/models/note.js, line 21

"on-note-created" | "on-note-deleted"

# NoteEvents

View Source frontend/event_types.js, line 50

"on-tag-panel-switched" | "on-tag-statistics-panel-switched" | "on-dictionary-panel-switched" | "on-compare-panel-switched"

# PanelEvents

View Source frontend/event_types.js, line 44

"on-repo-update-started" | "on-repo-update-progress" | "on-repo-update-completed"

# RepoUpdateEvents

View Source frontend/event_types.js, line 35

"on-tab-selected" | "on-tab-added"

# TabEvents

View Source frontend/event_types.js, line 26

"on-tab-search-results-available" | "on-tab-search-reset"

# TabSearchEvents

View Source frontend/event_types.js, line 29

# Tag

The Tag model is used to manage tags.

View Source backend/database/models/tag.js, line 21

"on-tag-created" | "on-tag-deleted" | "on-tag-renamed" | "on-latest-tag-changed"

# TagEvents

View Source frontend/event_types.js, line 47

# TagGroup

The TagGroup model is used to manage tag groups. Each tag can be associated to multiple tag groups.

View Source backend/database/models/taggroup.js, line 21

"on-tag-group-list-activated" | "on-tag-selection-menu-group-list-activated" | "on-tag-selection-menu-group-selected" | "on-tag-group-selected" | "on-tag-group-creation" | "on-tag-group-created" | "on-tag-group-members-changed" | "on-tag-group-renamed" | "on-tag-group-deleted" | "on-tag-group-filter-enabled" | "on-tag-group-filter-disabled"

# TagGroupEvents

View Source frontend/event_types.js, line 53

# VerseReference

The VerseReference model is used to manage verse references.

View Source backend/database/models/versereference.js, line 21

# VerseTag

The VerseTag model is used to handle the relationship between a VerseReference and a Tag.

View Source backend/database/models/versetag.js, line 20