new QualifiedEmbed(config)
Creates a new Qualified Embed Manager.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
Properties
|
- Tutorials:
Classes
Members
-
editors :Array.<QualifiedEmbeddedChallenge>
-
List of editors created on this manager.
Type:
- Array.<QualifiedEmbeddedChallenge>
-
options :ChallengeOptions
-
Shared options for new editors
Type:
-
challengeOptions :Object
-
Challenge-specific options for new embedded challenge editors.
Type:
- Object
Properties:
Name Type Description challengeIdChallengeOptions Options to be set when creating an editor using
challengeIdas a key.
Methods
-
<static> init(config)
-
Creates a new Qualified Embed Manager.
Parameters:
Name Type Description config* Configuration to pass into the manager. See the
QualifiedEmbedconstructor for configuration options.Returns:
Object that can be used to create, update, and destroy embedded challenges.
- Type
- QualifiedEmbed
-
findEditor(searchKeys)
-
Returns an existing editor via the node OR the challenge ID. If no editor is found, returns
false.Parameters:
Name Type Description searchKeysObject Properties
Name Type Argument Description nodeHTMLElement <nullable>
Node the editor was created on (preferred).
challengeIdstring <nullable>
Challenge ID currently in use within an editor.
Returns:
Challenge editor, or false if no editor was found.
- Type
- QualifiedEmbeddedEditor | boolean
-
createEditor(config)
-
Creates or updates a challenge editor. If an existing editor is found via node or challenge ID, then that editor is returned after updating it with any new options and/or the different challenge ID.
Parameters:
Name Type Description configObject Properties
Name Type Argument Description nodeHTMLElement DOM node to use as basis for the injection. Will be used directly if an iFrame, otherwise an iFrame will get appended to this node.
challengeIdstring <nullable>
Challenge ID for this editor. If not provided, will attempt to be found via the node's
data-qualified-embedattribute.optionsChallengeOptions <nullable>
Additional options for this editor, mixed with challenge-specific and shared options on the manager object.
Returns:
Existing or newly created challenge editor
-
updateEditor(config)
-
Updates an existing challenge editor, looking it up via node or challenge ID.
Parameters:
Name Type Description configObject Properties
Name Type Argument Description nodeHTMLElement <nullable>
DOM node to use as basis for the injection.
challengeIdstring <nullable>
Challenge ID currently used on the editor.
optionsChallengeOptions <nullable>
Updated options to set on the editor.
Returns:
Challenge editor, or false if no editor was found.
- Type
- QualifiedEmbeddedChallenge | boolean
-
destroy()
-
Destroy this manager and all embedded challenges and event listeners created through it.