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:
|
Returns:
- Type
- mw.Api
- Inherited from:
- Source:
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 |
Returns:
- Type
- string
- Inherited from:
- Deprecated:
- Moved to mw.libs.ve.targetSaver.getHtml
- Source:
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 |
Returns:
Page name
- Type
- string
- Inherited from:
- Source:
getSurfaceClasses() → {Array.<string>}
#
Get a list of CSS classes to be added to surfaces, and target widget surfaces
Returns:
CSS classes
- Type
- Array.<string>
- Inherited from:
- Source:
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 |
Returns:
Abortable promise which resolves with a wikitext string
- Type
- jQuery.Promise
- Inherited from:
- Source:
initAutosave([config])
#
Intialise autosave, recovering changes if applicable
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
- Inherited from:
- Source:
isInterwikiUrl(url) → {jQuery.Promise.<boolean>}
#
Check if a URL is an interwiki link.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | URL to check |
Returns:
Promise resolving to true if the URL is an interwiki link, false otherwise
- Type
- jQuery.Promise.<boolean>
- Inherited from:
- Source:
parseWikitextFragment(wikitext, pst, [doc], [ajaxOptions]) → {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 |
ajaxOptions |
Object |
optional |
Returns:
Abortable promise
- Type
- jQuery.Promise
- Inherited from:
- Source:
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 |
Returns:
Promise resolved with new username, or null if anonymous
- Type
- jQuery.Promise
- Inherited from:
- Source:
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
Fires:
- Inherited from:
- Source:
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.
Events
teardown()
#
Fired when the target has been torn down
- Inherited from:
- Source: