Methods
fetchRevision(revId, [pageName], [section], [parseDocumentModulePromise]) → {jQuery.Promise}static
#
Fetch a specific revision from Parsoid as a DM document, and cache in memory
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
revId |
number | Revision ID |
||
pageName |
string |
optional |
Page name, defaults to wgRelevantPageName |
|
section |
string
|
null
|
optional |
null | Section. Null for the whole document. |
parseDocumentModulePromise |
jQuery.Promise |
optional |
Promise which resolves when Target#parseDocument is available |
Returns:
Promise which resolves with a document model
- Type
- jQuery.Promise
getModelFromResponse(response, section) → {ve.dm.Document|null
}static
#
null
}static
#
Get a ve.dm
.Document model from a Parsoid response
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | Parsoid response from the VisualEditor API |
section |
string
|
null
|
Section. Null for the whole document. |
Returns:
Document, or null if an invalid response
- Type
-
ve.dm.Document
|
null
ve.dm
.Document model from a Parsoid response
getVisualDiffGeneratorPromise(oldIdOrPromise, newIdOrPromise, [parseDocumentModulePromise], [oldPageName], [newPageName]) → {jQuery.Promise}static
#
Get a visual diff generator promise
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
oldIdOrPromise |
number | jQuery.Promise | Old revision ID, or document model promise |
|
newIdOrPromise |
number | jQuery.Promise | New revision ID, or document model promise |
|
parseDocumentModulePromise |
jQuery.Promise |
optional |
Promise which resolves when Target#parseDocument is available |
oldPageName |
string |
optional |
Old revision's page name, defaults to wgRelevantPageName |
newPageName |
string |
optional |
New revision's page name, defaults to oldPageName |
Returns:
Promise which resolves with a ve.dm
.VisualDiff generator function
- Type
- jQuery.Promise