Extends
Constructor
new ve.init.mw.DesktopCollabTarget(title, rebaserUrl, [config])
#
Methods
addSurface()
#
- Inherited from:
- Source:
attachToolbar()
#
clearDocState()
#
Clear any stored document state
- Inherited from:
- Source:
createSurface()
#
- Inherited from:
- Source:
createTargetWidget()
#
- Inherited from:
- Source:
documentReady(doc)
#
Handle both DOM and modules being loaded and ready.
Parameters:
Name | Type | Description |
---|---|---|
doc |
HTMLDocument | string | HTML document or source text |
- Inherited from:
- Source:
getContentApi([doc], [options]) → {mw.Api}
#
Get an API object associated with the wiki where the document content is hosted.
This would be overridden if editing content on another wiki.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
doc |
ve.dm.Document |
optional |
API for a specific document, should default to document of current surface. |
||||||||
options |
Object |
optional |
API options Properties:
|
- Inherited from:
- Source:
Returns:
- Type
- mw.Api
Get an API object associated with the wiki where the document content is hosted.
getHtml(newDoc, [oldDoc]) → {string}
#
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
newDoc |
HTMLDocument | ||
oldDoc |
HTMLDocument |
optional |
- Inherited from:
- Deprecated:
- Moved to mw.libs.ve.targetSaver.getHtml
- Source:
Returns:
- Type
- string
getLocalApi([options]) → {mw.Api}
#
getPageName([doc]) → {string}
#
Get the page name associated with a specific document
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
doc |
ve.dm.Document |
optional |
Document, defaults to current surface's |
- Inherited from:
- Source:
Returns:
Page name
- Type
- string
getSurfaceClasses() → {Array.<string>}
#
Get a list of CSS classes to be added to surfaces, and target widget surfaces
- Inherited from:
- Source:
Returns:
CSS classes
- Type
- Array.<string>
getSurfaceConfig()
#
- Inherited from:
- Source:
getWikitextFragment(doc, [useRevision]) → {jQuery.Promise}
#
Get a wikitext fragment from a document
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
doc |
ve.dm.Document | |||
useRevision |
boolean |
optional |
true | Whether to use the revision ID + ETag |
- Inherited from:
- Source:
Returns:
Abortable promise which resolves with a wikitext string
- Type
- jQuery.Promise
initAutosave([config])
#
Intialise autosave, recovering changes if applicable
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
- Inherited from:
- Source:
parseWikitextFragment(wikitext, pst, [doc]) → {jQuery.Promise}
#
Parse a fragment of wikitext into HTML
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
wikitext |
string | ||
pst |
boolean | Perform pre-save transform |
|
doc |
ve.dm.Document |
optional |
Parse for a specific document, defaults to current surface's |
- Inherited from:
- Source:
Returns:
Abortable promise
- Type
- jQuery.Promise
refreshUser([doc]) → {jQuery.Promise}
#
Refresh our knowledge about the logged-in user.
This should be called in response to a user assertion error, to look up the new user name, and update the current user variables in mw.config.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
doc |
ve.dm.Document |
optional |
Document to associate with the API request |
- Inherited from:
- Source:
Returns:
Promise resolved with new username, or null if anonymous
- Type
- jQuery.Promise
restorePage()
#
Page modifications after editor teardown.
setSurface()
#
- Overrides:
- Source:
setupSurface(doc)
#
Switch to editing mode.
Parameters:
Name | Type | Description |
---|---|---|
doc |
HTMLDocument | string | HTML document or source text |
- Inherited from:
- Source:
storeDocState([html])
#
Store a snapshot of the current document state.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
html |
string |
optional |
Document HTML, will generate from current state if not provided |
- Inherited from:
- Source:
surfaceReady()
#
Once surface is ready, initialize the UI
- Inherited from:
- Source:
Fires:
teardown()
#
- Inherited from:
- Source:
track(name)
#
Track an event
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Event name |
- Inherited from:
- Source:
transformPage()
#
Page modifications after editor load.