Members
-
default
-
Retrieves the default language
Methods
-
addEventListeners()
-
Adds event listeners to the nav
-
addListeners()
-
Start listening to events
-
addListeners()
-
Start listening to events
-
addListeners()
-
Listen for events
-
addTags()
-
Add the tags in a Tags object to the provided Set
-
announce(text)
-
Updates the text of the ARIA live region so that the text will be announced to screen readers
Parameters:
Name Type Description text
String The text to announce
-
backup()
-
Check whether the app has been backed up within the time specified by the export option, and prompt user to back up the database if so
-
bindKeys()
-
Binds keyboard shortcuts to their functions
-
cancelEditing(event)
-
Remove the Tag Editor from the Word View and start listening for events on the Text Tagger again
Parameters:
Name Type Description event
Event -
changePage(page)
-
Changes the current page
Parameters:
Name Type Description page
String The page to change to
-
clearMain()
-
Clears the content of the
<main>
element -
clearSidebar()
-
Clears the content of the sidebar
-
compileTags()
-
Traverses the text to find any tags used at the Text, Utterance, Word, or Morpheme level, and compiles them into a single
tagsUsed
property.Returns:
Returns a hash of tags used, with 4 properties:
text
,utterance
,word
,morpheme
. The value of each is a Map object whose values are Sets.- Type
- Object
-
createCollections()
-
Creates the collections for performing operations on object stores
-
deleteDatabase()
-
Deletes the DLx database
Returns:
- Type
- Promise
-
<async> deleteTag(tag)
-
Delete the provided tag from the word view, word, and text, and save the data
Parameters:
Name Type Description tag
Tag A dlx-tag element
-
emit(eventName, data)
-
Emit an event with data
Parameters:
Name Type Description eventName
String The name of the event being emitted
data
Any Data accompanying the event
Returns:
- Type
- Promise
-
<async> exportData()
-
Trigger a download of the exported database
Returns:
- Type
- Promise
-
<async> exportData()
-
Exports all the data in the database into a single downloadable file
Returns:
- Type
- Promise
-
exportData()
-
Exports all the data in the database and returns an array of JavaScript objects
Returns:
- Type
- Promise.<Array>
-
<async> getStyles(stylesPath)
-
Retrieve the CSS stylesheet at the provided file path
Parameters:
Name Type Description stylesPath
String The path to the CSS stylesheet
Returns:
Resolves to a
<style>
tag- Type
- Promise
-
<async> getTemplate(templatePath)
-
Retrieve the template at the provided file path
Parameters:
Name Type Description templatePath
String The path to the HTML template
Returns:
Resolves to a
<template>
tag- Type
- Promise
-
<async> handleAction(ev)
-
Handler for click, enter, or spacebar events
Parameters:
Name Type Description ev
Event -
<async> importData()
-
Imports the selected files into the database, then rerenders the app
Returns:
- Type
- Promise
-
importData( [data])
-
Imports one or more items or array of items into the database.
Parameters:
Name Type Argument Default Description data
Object | Array <optional>
[] An object, or an array of of objects or arrays of objects, to import.
Returns:
- Type
- Promise
-
<async> initialize()
-
Initialize the App View
Returns:
- Type
- Promise
-
initialize()
-
Start listening for click events
-
<async> initialize()
-
Initialize the DLx database
Returns:
- Type
- Promise
-
itemTemplate(language)
-
The templating function to render each
<li>
element in the Languages ListParameters:
Name Type Description language
Object The language object to render a
<li>
forReturns:
- Type
- HTMLLIElement
-
itemTemplate(Text)
-
The templating function to render each
<li>
element in the Texts ListParameters:
Name Type Description Text
Object A Text object to render
Returns:
- Type
- Promise
-
off(eventName, function)
-
Unsubscribe a function from an event
Parameters:
Name Type Description eventName
String The name of the event to unsubscribe from
function
function The function to unsubscribe from the event
-
on(eventName, function)
-
Add an event listener to this emitter
Parameters:
Name Type Description eventName
String The name of the event to subscribe to
function
function The function to trigger when the event is emitted
Returns:
Returns a function that can be called to remove the subscription
- Type
- function
-
<async> reload()
-
Reloads the app with the current page
Returns:
- Type
- Promise
-
<async> render()
-
Render the LanguageDropdown
-
render()
-
Renders the list and saves it to ListView.el
Returns:
- Type
- HTMLUListElement
-
render()
-
The render method of the base View class is a no-op. View subclasses should overwrite this method with one that sets this.el to be the rendered DOM element or a document fragment, and returns that rendered element. Note that views should not insert themselves into the DOM - this is the responsibility of their controller. Views should however attach event listeners to their element.
Returns:
- Type
- HTMLElement | DocumentFragment
-
<async> render()
-
Render the Language Editor
-
<async> render(languageCID)
-
Render the Languages page
Parameters:
Name Type Description languageCID
String The client ID of the language to render the Languages page with. If provided, the Language Editor will be rendered for that language when the Languages page renders. Otherwise, only the Languages List will be rendered.
-
<async> render(languageCID)
-
Render the Languages List, setting the current language if provided
Parameters:
Name Type Description languageCID
String The client ID of the current language
Returns:
- Type
- Promise
-
<async> render()
-
Render the Settings page
Returns:
- Type
- Promise
-
render()
-
Render the interlinear gloss view
Returns:
- Type
- HTMLElement
-
render()
-
Render the MultiLangStringView
Returns:
Returns a fieldset element containing the text
- Type
- HTMLFieldSetElement
-
<async> render( [textCID])
-
Render the Tagger page
Parameters:
Name Type Argument Description textCID
String <optional>
The client ID of the text to render the Tagger page with
Returns:
- Type
- Promise
-
<async> render()
-
Render the Tags List
Returns:
- Type
- HTMLSectionElement
-
render()
-
Render the text tagger
Returns:
- Type
- Promise
-
<async> render(textCID)
-
Render the Texts List, setting the current language if provided
Parameters:
Name Type Description textCID
String The client ID of the text to show as selected
Returns:
- Type
- Promise
-
render()
-
Render the Transcription view
Returns:
- Type
- HTMLFieldSetElement
-
render()
-
Render the WordView
Returns:
- Type
- HTMLLIElement
-
renderAnalysis()
-
Render the analysis line
Returns:
[description]
- Type
- Boolean
-
renderClickToTag()
-
Renders the Click to Tag dropdown
-
renderGloss()
-
Render the gloss line
-
renderHelpSection()
-
Renders the help section
Returns:
- Type
- HTMLSectionElement
-
<async> renderLanguageDropdown()
-
Renders the Language Dropdown
-
<async> renderLanguageDropdown()
-
Render the Language Dropdown instead of the Tagger page, forcing the user to select a language
Returns:
- Type
- Promise
-
<async> renderLanguageEditor(languageCID)
-
Render the Language Editor
Parameters:
Name Type Description languageCID
String The client ID of the language to render the Language Editor for
Returns:
- Type
- Promise
-
<async> renderLanguagesList(languageCID)
-
Render the Languages List
Parameters:
Name Type Description languageCID
String The client ID of the language to show as selected when the list renders
Returns:
- Type
- Promise
-
<async> renderLanguagesPage(languageCID)
-
Render the Languages page with the active language
Parameters:
Name Type Description languageCID
String The client ID of the language to render the Languages page with
Returns:
- Type
- Promise
-
renderLiteral()
-
Render the literal translation line
-
<async> renderPage( [page] [, args])
-
Render a specific page of the app. This method is triggered by each route. Does not rerender the entire app.
Parameters:
Name Type Argument Default Description page
String <optional>
"home" The page to render
args
Any <optional>
<repeatable>
Any additional arguments to page to the page-specific rendering function
-
renderSettingsPage()
-
Render the Settings page
Returns:
- Type
- Promise
-
<async> renderStyles()
-
Adds the
<style>
tag for the Languages pageReturns:
- Type
- Promise
-
<async> renderTaggerPage(languageCID, textCID)
-
Render the Tagger page
Parameters:
Name Type Description languageCID
String The client ID of the Language to render the Tagger page for
textCID
String The client ID of the Text to render the Tagger page for
Returns:
- Type
- Promise
-
renderTags()
-
Render the tag elements
-
renderTags()
-
Render the word-level tags
-
<async> renderTagsList()
-
Render the list of tags in the sidebar
Returns:
- Type
- Promise
-
<async> renderTextsList()
-
Render the Texts List
Returns:
- Type
- Promise
-
<async> renderTextTagger(textCID)
-
Renders the Text Tagger
Parameters:
Name Type Description textCID
String The client ID of the text to render
Returns:
- Type
- Promise
-
renderTitle()
-
Render the title of the text
-
renderTranscript()
-
Render the transcript line
-
renderTranscription()
-
Render the transcription line
-
renderTranscription()
-
Render the transcription line
-
renderTranslation()
-
Render the translation line
-
renderUtterances()
-
Render the utterances list
-
renderWords()
-
Render individual words
-
setCurrentLanguage(languageCID)
-
Set the currently selected language in the list
Parameters:
Name Type Description languageCID
String The client ID of the language to set as selected
-
setCurrentPage(page)
-
Adds the aria-describedby attribute to the indicated page
Parameters:
Name Type Description page
String The page route to set as current
-
setCurrentText(textCID)
-
Sets the currently selected text in the list
Parameters:
Name Type Description textCID
String The client ID of the text to set as selected
-
startEditing(event)
-
Handle the Enter or Spacebar event, and render the Tag Editor if the event happens on a Word View
Parameters:
Name Type Description event
Event -
toggle()
-
Toggles the expanded/collapsed state of the nav
-
toJSON()
-
Create a version of the data suitable for JSON serialization
Returns:
- Type
- Object
-
toJSON()
-
Create a version of the data suitable for JSON serialization
Returns:
- Type
- Object
-
toJSON()
-
Create a version of the data suitable for JSON serialization
Returns:
- Type
- Object
-
updateAbbreviation(value)
-
Update abbreviation and save Language to the database
Parameters:
Name Type Description value
String Returns:
- Type
- Promise
-
updateGlottolog(value)
-
Update Glottolog code and save Language to the database
Parameters:
Name Type Description value
String Returns:
- Type
- Promise
-
updateISO(value)
-
Update ISO code and save Language to the database
Parameters:
Name Type Description value
String Returns:
- Type
- Promise
-
<async> updateTags(tagData, wordCID, utteranceCID [, options])
-
Updates and saves the tag data on the word and text
Parameters:
Name Type Argument Default Description tagData
Object A hash containing
category
andvalue
propertieswordCID
String The CID of the word to update
utteranceCID
String The CID of the utterance to update
options
Object <optional>
{} An options hash
Properties
Name Type Argument Default Description remove
Boolean <optional>
false Whether to remove the tag
-
updateWordView(oldView, word)
-
Replace an existing Word View with a new one
Parameters:
Name Type Description oldView
WordView The old view to replace
word
models.Word A DLx Word object containing the new data to render