new QualifiedEmbedManager(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 challengeId
ChallengeOptions Options to be set when creating an editor using
challengeId
as 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
QualifiedEmbedManager
constructor for configuration options.Returns:
Object that can be used to create, update, and destroy embedded challenges.
-
findEditor(searchKeys)
-
Returns an existing editor via the node OR the challenge ID. If no editor is found, returns
false
.Parameters:
Name Type Description searchKeys
Object Properties
Name Type Argument Description node
HTMLElement <nullable>
Node the editor was created on (preferred).
challengeId
string <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 config
Object Properties
Name Type Argument Description node
HTMLElement 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.
challengeId
string <nullable>
Challenge ID for this editor. If not provided, will attempt to be found via the node's
data-qualified-embed
attribute.options
ChallengeOptions <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 config
Object Properties
Name Type Argument Description node
HTMLElement <nullable>
DOM node to use as basis for the injection.
challengeId
string <nullable>
Challenge ID currently used on the editor.
options
ChallengeOptions <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.