new EditorGateway(options)
API that helps save and retrieve page content
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Configuration options Properties
|
Methods
(static) getBlockInfo(pageObj) → {Object|null}
Get the block (if there is one) from the result.
Parameters:
Name | Type | Description |
---|---|---|
pageObj |
Object | Page object |
Returns:
- Type
- Object | null
abortPreview()
Abort any pending previews.
getContent() → {jQuery.Promise}
Get the content of a page.
Returns:
- Type
- jQuery.Promise
getPreview(options) → {jQuery.Deferred}
Get page preview from the API and abort any existing previews.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | API query parameters |
Returns:
- Type
- jQuery.Deferred
save(options) → {jQuery.Deferred}
Save the new content of the section, previously set using #setContent.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Configuration options Properties
|
Returns:
On failure callback is passed an object with
type
and details
properties. type
is a string describing the type
of error, details
can be any object (usually error message).
- Type
- jQuery.Deferred
setContent(content)
Mark content as modified and set changes to be submitted when #save is invoked.
Parameters:
Name | Type | Description |
---|---|---|
content |
string | New section content. |