Metadata Feedback Tool API
The contents of this page are still in development and may change.
Overview
The feedback tool component creates a sticky toolbar at the top of the page where users can provide metadata feedback for the page content. The feedback tool also saves users' feedback, currently into a local pouch database, for statistical purposes.
Â
var feedback = gpii.metadata.feedbackLoader(container[, options]);
Â
Feedback Model
{ id: <user_id>, model: { Â match: boolean, mismatch: boolean, notInteresting: boolean, other: boolean, // Users can turn on "other" without giving any "otherFeedback" otherFeedback: string, requests: { text: boolean, transcripts: boolean, audio: boolean, audioDesc: boolean }, votes: { <voteType>: boolean } } }Â
API
Creator | gpii.metadata.feedbackLoader(container, options) |
---|---|
Supported Events | onTemplatesLoaded onSave Fires before the data gets saved into the db.afterSave Fires when the data has been saved. This event is fired in the callback function of the database set() function.afterMatchConfirmationButtonClicked afterMismatchDetailsButtonClicked onSkipAtMismatchDetails Fires when the skip link on the mismatch details dialog is clicked.onSubmitAtMismatchDetails |
Methods | None |
Options | templatePrefix (Optional) A string value representing the relative path to the directory containing the templates.templates (Optional) An object containing pairs of a template name and the relative path to this template. The default value is:{ feedback: "%prefix/feedbackTemplate.html", matchConfirmation: "%prefix/matchConfirmationTemplate.html", mismatchDetails: "%prefix/mismatchDetailsTemplate.html" } feedback (Optional) The data structure that configures thefeedback component. |
Subcomponents | templateLoader Load in all templates needed by the feedback tool.feedback Renders the feedback toolbar. |