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);
});
Methods
# clearLongPressTimer()
method responsible for clearing a pending long press timer
# 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.
# 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 |
cached string or false/default value if cache is invalid or not exists
# getLanguageCode()
returns ISO 639 language code (2-letter if available or 3-letter otherwise)
# 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 |
# 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) |
HTML fragment with appropriate
# saveWordDocument()
The ExportController saves exported verses with notes or tags as generated Word document.
# startTimer() → {object}
Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
handle to the timeout object
# subscribe(event) → {void}
Starts the timer on mouse down and logs current position
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | browser event object |
Type Definitions
# AppEvents
# BibleBook
The BibleBook model is used to manage Bible books.
# BibleTextEvents
# EzraEvent
# MetaRecord
The MetaRecord model is used to manage meta information for the Ezra Bible App database, currently the time of the last modification.
# ModuleAssistantEvents
# PanelEvents
# RepoUpdateEvents
# TabSearchEvents
# TagEvents
# TagGroup
The TagGroup model is used to manage tag groups. Each tag can be associated to multiple tag groups.
# TagGroupEvents
# VerseReference
The VerseReference model is used to manage verse references.
# VerseTag
The VerseTag model is used to handle the relationship between a VerseReference and a Tag.